From b35b33ca50fc0761cbe0dc85bf67083732ed6a56 Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:00:52 -0500 Subject: [PATCH 001/129] Update docker-compose.yaml --- docker-compose.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 33918c38..c3c74065 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -39,9 +39,9 @@ services: ports: - 5432:5432 environment: - - POSTGRES_USER=user - - POSTGRES_PASSWORD=pass - - POSTGRES_DB=evolution + - POSTGRES_DB=${POSTGRES_DATABASE} + - POSTGRES_USER=${POSTGRES_USERNAME} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_HOST_AUTH_METHOD=trust volumes: - postgres_data:/var/lib/postgresql/data From f7e7a6c901024bafa8a34344af8c18f694403acd Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:02:34 -0500 Subject: [PATCH 002/129] Update docker-compose.yaml --- docker-compose.yaml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index c3c74065..bf8f2e22 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,5 @@ +version: "3.8" + services: api: container_name: evolution_api @@ -7,37 +9,44 @@ services: - redis - postgres ports: - - 8080:8080 + - "8080:8080" volumes: - evolution_instances:/evolution/instances networks: - evolution-net + - dokploy-network env_file: - .env expose: - - 8080 + - "8080" redis: image: redis:latest - networks: - - evolution-net container_name: redis command: > redis-server --port 6379 --appendonly yes volumes: - evolution_redis:/data ports: - - 6379:6379 + - "6379:6379" + expose: + - "6379" + networks: + - evolution-net + - dokploy-network postgres: container_name: postgres image: postgres:15 - networks: - - evolution-net - command: ["postgres", "-c", "max_connections=1000", "-c", "listen_addresses=*"] + command: + - postgres + - -c + - max_connections=1000 + - -c + - listen_addresses=* restart: always ports: - - 5432:5432 + - "5432:5432" environment: - POSTGRES_DB=${POSTGRES_DATABASE} - POSTGRES_USER=${POSTGRES_USERNAME} @@ -46,15 +55,19 @@ services: volumes: - postgres_data:/var/lib/postgresql/data expose: - - 5432 + - "5432" + networks: + - evolution-net + - dokploy-network volumes: evolution_instances: evolution_redis: postgres_data: - networks: evolution-net: name: evolution-net driver: bridge + dokploy-network: + external: true From 17f97fb0516cb0bfd3e27ed722e60b87f60764b8 Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:03:45 -0500 Subject: [PATCH 003/129] Update docker-compose.yaml --- docker-compose.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index bf8f2e22..656b8e16 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -57,8 +57,12 @@ services: expose: - "5432" networks: - - evolution-net - - dokploy-network + evolution-net: + aliases: + - evolution-postgres + dokploy-network: + aliases: + - evolution-postgres volumes: evolution_instances: From 419324837c5d8852508827519f5a084e15fa95a5 Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:05:12 -0500 Subject: [PATCH 004/129] Update docker-compose.yaml --- docker-compose.yaml | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 656b8e16..750d30d5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,7 +7,7 @@ services: restart: always depends_on: - redis - - postgres + - evolution-postgres ports: - "8080:8080" volumes: @@ -21,48 +21,43 @@ services: - "8080" redis: + container_name: evolution_redis image: redis:latest - container_name: redis + restart: always command: > redis-server --port 6379 --appendonly yes volumes: - evolution_redis:/data - ports: - - "6379:6379" - expose: - - "6379" networks: - evolution-net - dokploy-network + expose: + - "6379" - postgres: - container_name: postgres + evolution-postgres: + container_name: evolution_postgres image: postgres:15 + restart: always + env_file: + - .env command: - postgres - -c - max_connections=1000 - -c - listen_addresses=* - restart: always - ports: - - "5432:5432" environment: - - POSTGRES_DB=${POSTGRES_DATABASE} - - POSTGRES_USER=${POSTGRES_USERNAME} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - POSTGRES_HOST_AUTH_METHOD=trust + POSTGRES_DB: ${POSTGRES_DATABASE} + POSTGRES_USER: ${POSTGRES_USERNAME} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_HOST_AUTH_METHOD: trust volumes: - postgres_data:/var/lib/postgresql/data + networks: + - evolution-net + - dokploy-network expose: - "5432" - networks: - evolution-net: - aliases: - - evolution-postgres - dokploy-network: - aliases: - - evolution-postgres volumes: evolution_instances: From 1c247498d89e49f4189de353b68c34f4758a8ad7 Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:25:44 -0500 Subject: [PATCH 005/129] Update docker-compose.yaml --- docker-compose.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 750d30d5..31d0734e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -47,10 +47,9 @@ services: - -c - listen_addresses=* environment: - POSTGRES_DB: ${POSTGRES_DATABASE} - POSTGRES_USER: ${POSTGRES_USERNAME} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_HOST_AUTH_METHOD: trust + - POSTGRES_DB=${POSTGRES_DATABASE} + - POSTGRES_USER=${POSTGRES_USERNAME} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: - postgres_data:/var/lib/postgresql/data networks: From 6dfbfe2d839515f566beac22f3b56538292db6ff Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:27:42 -0500 Subject: [PATCH 006/129] Update docker-compose.yaml --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 31d0734e..f0840acf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -36,7 +36,7 @@ services: evolution-postgres: container_name: evolution_postgres - image: postgres:15 + image: postgres:16-alpine restart: always env_file: - .env From 675745ae3c542feac2fafa28e05b0d287f34ee4e Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:28:42 -0500 Subject: [PATCH 007/129] Update docker-compose.yaml --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f0840acf..31d0734e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -36,7 +36,7 @@ services: evolution-postgres: container_name: evolution_postgres - image: postgres:16-alpine + image: postgres:15 restart: always env_file: - .env From 505490d237eb1948af5ab5469e8ff1bb98627300 Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:36:21 -0500 Subject: [PATCH 008/129] Update docker-compose.yaml --- docker-compose.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 31d0734e..20f05d3b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -29,8 +29,12 @@ services: volumes: - evolution_redis:/data networks: - - evolution-net - - dokploy-network + evolution-net: + aliases: + - evolution-redis + dokploy-network: + aliases: + - evolution-redis expose: - "6379" From 192c34caa077ac00daac7a0d1b04f45c442b9ae3 Mon Sep 17 00:00:00 2001 From: codingbox2022 <119642326+codingbox2022@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:47:36 -0500 Subject: [PATCH 009/129] Update docker-compose.yaml --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 20f05d3b..005769a1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,7 +9,7 @@ services: - redis - evolution-postgres ports: - - "8080:8080" + - "127.0.0.1:8080:8080" volumes: - evolution_instances:/evolution/instances networks: From 96d3ec20178fd20152b061be7d82f4c71a46660a Mon Sep 17 00:00:00 2001 From: Marco Buono Date: Wed, 23 Jul 2025 16:06:14 -0300 Subject: [PATCH 010/129] fix: avoid corrupting URLs with query strings --- .../channel/whatsapp/whatsapp.baileys.service.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index de31b503..03870285 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -2504,7 +2504,9 @@ export class BaileysStartupService extends ChannelStartupService { imageBuffer = Buffer.from(base64Data, 'base64'); } else { const timestamp = new Date().getTime(); - const url = `${image}?timestamp=${timestamp}`; + const parsedURL = new URL(image); + parsedURL.searchParams.set('timestamp', timestamp.toString()); + const url = parsedURL.toString(); let config: any = { responseType: 'arraybuffer' }; @@ -2725,7 +2727,9 @@ export class BaileysStartupService extends ChannelStartupService { if (isURL(audio)) { const timestamp = new Date().getTime(); - const url = `${audio}?timestamp=${timestamp}`; + const parsedURL = new URL(audio); + parsedURL.searchParams.set('timestamp', timestamp.toString()); + const url = parsedURL.toString(); const config: any = { responseType: 'stream' }; @@ -3591,7 +3595,9 @@ export class BaileysStartupService extends ChannelStartupService { let pic: WAMediaUpload; if (isURL(picture)) { const timestamp = new Date().getTime(); - const url = `${picture}?timestamp=${timestamp}`; + const parsedURL = new URL(picture); + parsedURL.searchParams.set('timestamp', timestamp.toString()); + const url = parsedURL.toString(); let config: any = { responseType: 'arraybuffer' }; @@ -3873,7 +3879,9 @@ export class BaileysStartupService extends ChannelStartupService { let pic: WAMediaUpload; if (isURL(picture.image)) { const timestamp = new Date().getTime(); - const url = `${picture.image}?timestamp=${timestamp}`; + const parsedURL = new URL(picture.image); + parsedURL.searchParams.set('timestamp', timestamp.toString()); + const url = parsedURL.toString(); let config: any = { responseType: 'arraybuffer' }; From 6101c8d65140fe8a2716e0507bee700db23ac5f1 Mon Sep 17 00:00:00 2001 From: William Dumes Date: Fri, 25 Jul 2025 17:08:14 -0300 Subject: [PATCH 011/129] fix: corrigido disparo de eventos quando nao usa a opcao da ENV de salvar mensagens no banco --- .../whatsapp/whatsapp.baileys.service.ts | 91 +++++++++++-------- 1 file changed, 53 insertions(+), 38 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index f454473a..7d7da2be 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1443,16 +1443,7 @@ export class BaileysStartupService extends ChannelStartupService { } } - const findMessage = await this.prismaRepository.message.findFirst({ - where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } }, - }); - - if (!findMessage) { - continue; - } - const message: any = { - messageId: findMessage.id, keyId: key.id, remoteJid: key?.remoteJid, fromMe: key.fromMe, @@ -1462,6 +1453,16 @@ export class BaileysStartupService extends ChannelStartupService { instanceId: this.instanceId, }; + let findMessage: any; + const configDatabaseData = this.configService.get('DATABASE').SAVE_DATA; + if (configDatabaseData.HISTORIC || configDatabaseData.NEW_MESSAGE) { + findMessage = await this.prismaRepository.message.findFirst({ + where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } }, + }); + + if (findMessage) message.messageId = findMessage.id; + } + if (update.message === null && update.status === undefined) { this.sendDataWebhook(Events.MESSAGES_DELETE, key); @@ -1477,7 +1478,9 @@ export class BaileysStartupService extends ChannelStartupService { } continue; - } else if (update.status !== undefined && status[update.status] !== findMessage.status) { + } + + if (findMessage && update.status !== undefined && status[update.status] !== findMessage.status) { if (!key.fromMe && key.remoteJid) { readChatToUpdate[key.remoteJid] = true; @@ -3431,16 +3434,18 @@ export class BaileysStartupService extends ChannelStartupService { where: { id: message.id }, data: { key: { ...existingKey, deleted: true }, status: 'DELETED' }, }); - const messageUpdate: any = { - messageId: message.id, - keyId: messageId, - remoteJid: response.key.remoteJid, - fromMe: response.key.fromMe, - participant: response.key?.remoteJid, - status: 'DELETED', - instanceId: this.instanceId, - }; - await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); + if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) { + const messageUpdate: any = { + messageId: message.id, + keyId: messageId, + remoteJid: response.key.remoteJid, + fromMe: response.key.fromMe, + participant: response.key?.remoteJid, + status: 'DELETED', + instanceId: this.instanceId, + }; + await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); + } } else { await this.prismaRepository.message.deleteMany({ where: { id: message.id } }); } @@ -3771,6 +3776,10 @@ export class BaileysStartupService extends ChannelStartupService { private async formatUpdateMessage(data: UpdateMessageDto) { try { + if (!this.configService.get('DATABASE').SAVE_DATA.NEW_MESSAGE) { + return data; + } + const msg: any = await this.getMessage(data.key, true); if (msg?.messageType === 'conversation' || msg?.messageType === 'extendedTextMessage') { @@ -3804,13 +3813,15 @@ export class BaileysStartupService extends ChannelStartupService { try { const oldMessage: any = await this.getMessage(data.key, true); - if (!oldMessage) throw new NotFoundException('Message not found'); - if (oldMessage?.key?.remoteJid !== jid) { - throw new BadRequestException('RemoteJid does not match'); - } - if (oldMessage?.messageTimestamp > Date.now() + 900000) { - // 15 minutes in milliseconds - throw new BadRequestException('Message is older than 15 minutes'); + if (this.configService.get('DATABASE').SAVE_DATA.NEW_MESSAGE) { + if (!oldMessage) throw new NotFoundException('Message not found'); + if (oldMessage?.key?.remoteJid !== jid) { + throw new BadRequestException('RemoteJid does not match'); + } + if (oldMessage?.messageTimestamp > Date.now() + 900000) { + // 15 minutes in milliseconds + throw new BadRequestException('Message is older than 15 minutes'); + } } const messageSent = await this.client.sendMessage(jid, { ...(options as any), edit: data.key }); @@ -3828,7 +3839,7 @@ export class BaileysStartupService extends ChannelStartupService { ); const messageId = messageSent.message?.protocolMessage?.key?.id; - if (messageId) { + if (messageId && this.configService.get('DATABASE').SAVE_DATA.NEW_MESSAGE) { let message = await this.prismaRepository.message.findFirst({ where: { key: { path: ['id'], equals: messageId } }, }); @@ -3840,6 +3851,7 @@ export class BaileysStartupService extends ChannelStartupService { if ((message.key.valueOf() as any)?.deleted) { new BadRequestException('You cannot edit deleted messages'); } + if (oldMessage.messageType === 'conversation' || oldMessage.messageType === 'extendedTextMessage') { oldMessage.message.conversation = data.text; } else { @@ -3853,16 +3865,19 @@ export class BaileysStartupService extends ChannelStartupService { messageTimestamp: Math.floor(Date.now() / 1000), // Convert to int32 by dividing by 1000 to get seconds }, }); - const messageUpdate: any = { - messageId: message.id, - keyId: messageId, - remoteJid: messageSent.key.remoteJid, - fromMe: messageSent.key.fromMe, - participant: messageSent.key?.remoteJid, - status: 'EDITED', - instanceId: this.instanceId, - }; - await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); + + if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) { + const messageUpdate: any = { + messageId: message.id, + keyId: messageId, + remoteJid: messageSent.key.remoteJid, + fromMe: messageSent.key.fromMe, + participant: messageSent.key?.remoteJid, + status: 'EDITED', + instanceId: this.instanceId, + }; + await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); + } } } } From 69726f0dc2b77c6c017d08fd65491195059617c7 Mon Sep 17 00:00:00 2001 From: William Dumes Date: Mon, 28 Jul 2025 09:24:22 -0300 Subject: [PATCH 012/129] fix(evo): melhorado controle de recebimento do ack das msgs --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 02130c43..261b734c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,6 +55,6 @@ COPY --from=builder /evolution/tsup.config.ts ./tsup.config.ts ENV DOCKER_ENV=true -EXPOSE 8080 +EXPOSE 9000 ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ] From a62f9ebe465fc6a933716b787063387435f1fe7e Mon Sep 17 00:00:00 2001 From: William Dumes Date: Mon, 28 Jul 2025 11:19:07 -0300 Subject: [PATCH 013/129] chore: voltar porta do dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 261b734c..02130c43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,6 +55,6 @@ COPY --from=builder /evolution/tsup.config.ts ./tsup.config.ts ENV DOCKER_ENV=true -EXPOSE 9000 +EXPOSE 8080 ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ] From 7f8293f4c657b89f1b9aa472e6f9f1cd065f43cf Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 29 Jul 2025 09:16:19 -0300 Subject: [PATCH 014/129] changelog: v2.3.1 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1bc86d6..818602b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 2.3.1 (develop) +### Feature + +* Add BaileysMessageProcessor for improved message handling and integrate rxjs for asynchronous processing +* Enhance message processing with retry logic for error handling + ### Fixed * Update Baileys Version @@ -8,6 +13,8 @@ * Add unreadMessages in the response * Phone number as message ID for Evo AI * Fix upload to s3 when media message +* Simplify edited message check in BaileysStartupService +* Avoid corrupting URLs with query strings # 2.3.0 (2025-06-17 09:19) From b5c67774dc033dbd66411d334cadfb9458e207bf Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 29 Jul 2025 09:20:08 -0300 Subject: [PATCH 015/129] chore: remove CONFIG_SESSION_PHONE_VERSION and update related code - Removed the CONFIG_SESSION_PHONE_VERSION environment variable from the configuration and Docker files. - Updated the BaileysStartupService to directly fetch the latest WhatsApp Web version without relying on the removed environment variable. - Adjusted the index router to reflect the changes in the WhatsApp Web version retrieval. --- CHANGELOG.md | 1 + Docker/swarm/evolution_api_v2.yaml | 1 - .../whatsapp/whatsapp.baileys.service.ts | 21 ++++++++++--------- src/api/routes/index.router.ts | 3 +-- src/config/env.config.ts | 3 +-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 818602b0..383282ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Fix upload to s3 when media message * Simplify edited message check in BaileysStartupService * Avoid corrupting URLs with query strings +* Removed CONFIG_SESSION_PHONE_VERSION environment variable # 2.3.0 (2025-06-17 09:19) diff --git a/Docker/swarm/evolution_api_v2.yaml b/Docker/swarm/evolution_api_v2.yaml index c4cd30d6..4055dfa3 100644 --- a/Docker/swarm/evolution_api_v2.yaml +++ b/Docker/swarm/evolution_api_v2.yaml @@ -94,7 +94,6 @@ services: - WEBHOOK_EVENTS_ERRORS_WEBHOOK= - CONFIG_SESSION_PHONE_CLIENT=Evolution API V2 - CONFIG_SESSION_PHONE_NAME=Chrome - #- CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200 - QRCODE_LIMIT=30 - OPENAI_ENABLED=true - DIFY_ENABLED=true diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 619dd6c6..758a5bf9 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -549,17 +549,18 @@ export class BaileysStartupService extends ChannelStartupService { this.logger.info(`Browser: ${browser}`); } - let version; - let log; + const baileysVersion = await fetchLatestWaWebVersion({}); + const version = baileysVersion.version; + const log = `Baileys version: ${version.join('.')}`; - if (session.VERSION) { - version = session.VERSION.split('.'); - log = `Baileys version env: ${version}`; - } else { - const baileysVersion = await fetchLatestWaWebVersion({}); - version = baileysVersion.version; - log = `Baileys version: ${version}`; - } + // if (session.VERSION) { + // version = session.VERSION.split('.'); + // log = `Baileys version env: ${version}`; + // } else { + // const baileysVersion = await fetchLatestWaWebVersion({}); + // version = baileysVersion.version; + // log = `Baileys version: ${version}`; + // } this.logger.info(log); diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index fd2372fa..48954ea0 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -69,8 +69,7 @@ router clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME, manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined, documentation: `https://doc.evolution-api.com`, - whatsappWebVersion: - process.env.CONFIG_SESSION_PHONE_VERSION || (await fetchLatestWaWebVersion({})).version.join('.'), + whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'), }); }) .post('/verify-creds', authGuard['apikey'], async (req, res) => { diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 8c253163..c59acd38 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -249,7 +249,7 @@ export type Webhook = { }; }; export type Pusher = { ENABLED: boolean; GLOBAL?: GlobalPusher; EVENTS: EventsPusher }; -export type ConfigSessionPhone = { CLIENT: string; NAME: string; VERSION: string }; +export type ConfigSessionPhone = { CLIENT: string; NAME: string }; export type QrCode = { LIMIT: number; COLOR: string }; export type Typebot = { ENABLED: boolean; API_VERSION: string; SEND_MEDIA_BASE64: boolean }; export type Chatwoot = { @@ -590,7 +590,6 @@ export class ConfigService { CONFIG_SESSION_PHONE: { CLIENT: process.env?.CONFIG_SESSION_PHONE_CLIENT || 'Evolution API', NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'Chrome', - VERSION: process.env?.CONFIG_SESSION_PHONE_VERSION || null, }, QRCODE: { LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30, From 095e435561a2eb955f50daee6c9c0ff2fb2c6d21 Mon Sep 17 00:00:00 2001 From: Bilal Iqbal Date: Thu, 31 Jul 2025 14:26:05 +0500 Subject: [PATCH 016/129] Fixed boolean and integer type attributes --- prisma/mysql-schema.prisma | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/prisma/mysql-schema.prisma b/prisma/mysql-schema.prisma index 33d09d2b..70efea47 100644 --- a/prisma/mysql-schema.prisma +++ b/prisma/mysql-schema.prisma @@ -647,22 +647,22 @@ model IsOnWhatsapp { model N8n { id String @id @default(cuid()) - enabled Boolean @default(true) @db.Boolean + enabled Boolean @default(true) @db.TinyInt(1) description String? @db.VarChar(255) webhookUrl String? @db.VarChar(255) basicAuthUser String? @db.VarChar(255) basicAuthPass String? @db.VarChar(255) expire Int? @default(0) @db.Int keywordFinish String? @db.VarChar(100) - delayMessage Int? @db.Integer + delayMessage Int? @db.Int unknownMessage String? @db.VarChar(100) listeningFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false) keepOpen Boolean? @default(false) - debounceTime Int? @db.Integer + debounceTime Int? @db.Int ignoreJids Json? splitMessages Boolean? @default(false) - timePerChar Int? @default(50) @db.Integer + timePerChar Int? @default(50) @db.Int triggerType TriggerType? triggerOperator TriggerOperator? triggerValue String? @@ -677,15 +677,15 @@ model N8nSetting { id String @id @default(cuid()) expire Int? @default(0) @db.Int keywordFinish String? @db.VarChar(100) - delayMessage Int? @db.Integer + delayMessage Int? @db.Int unknownMessage String? @db.VarChar(100) listeningFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false) keepOpen Boolean? @default(false) - debounceTime Int? @db.Integer + debounceTime Int? @db.Int ignoreJids Json? splitMessages Boolean? @default(false) - timePerChar Int? @default(50) @db.Integer + timePerChar Int? @default(50) @db.Int createdAt DateTime? @default(now()) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Fallback N8n? @relation(fields: [n8nIdFallback], references: [id]) @@ -696,21 +696,21 @@ model N8nSetting { model Evoai { id String @id @default(cuid()) - enabled Boolean @default(true) @db.Boolean + enabled Boolean @default(true) @db.TinyInt(1) description String? @db.VarChar(255) agentUrl String? @db.VarChar(255) apiKey String? @db.VarChar(255) expire Int? @default(0) @db.Int keywordFinish String? @db.VarChar(100) - delayMessage Int? @db.Integer + delayMessage Int? @db.Int unknownMessage String? @db.VarChar(100) listeningFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false) keepOpen Boolean? @default(false) - debounceTime Int? @db.Integer + debounceTime Int? @db.Int ignoreJids Json? splitMessages Boolean? @default(false) - timePerChar Int? @default(50) @db.Integer + timePerChar Int? @default(50) @db.Int triggerType TriggerType? triggerOperator TriggerOperator? triggerValue String? @@ -725,15 +725,15 @@ model EvoaiSetting { id String @id @default(cuid()) expire Int? @default(0) @db.Int keywordFinish String? @db.VarChar(100) - delayMessage Int? @db.Integer + delayMessage Int? @db.Int unknownMessage String? @db.VarChar(100) listeningFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false) keepOpen Boolean? @default(false) - debounceTime Int? @db.Integer + debounceTime Int? @db.Int ignoreJids Json? splitMessages Boolean? @default(false) - timePerChar Int? @default(50) @db.Integer + timePerChar Int? @default(50) @db.Int createdAt DateTime? @default(now()) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id]) From bc11d0f751f68816db68a46788c6821d7328de2f Mon Sep 17 00:00:00 2001 From: William Dumes Date: Thu, 31 Jul 2025 17:27:06 -0300 Subject: [PATCH 017/129] fix: corrigido delete de mensagem quando nao salvo no banco de dados --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 7d7da2be..8496a759 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -3447,6 +3447,7 @@ export class BaileysStartupService extends ChannelStartupService { await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); } } else { + if (!message) return response; await this.prismaRepository.message.deleteMany({ where: { id: message.id } }); } this.sendDataWebhook(Events.MESSAGES_DELETE, { From 79f4a22217e6cb52e9ed41254c5f1037ed545aa4 Mon Sep 17 00:00:00 2001 From: William Dumes Date: Mon, 4 Aug 2025 13:56:16 -0300 Subject: [PATCH 018/129] refactor: lint check --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index f9dbeed0..c036a281 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1482,7 +1482,7 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - + if (findMessage && update.status !== undefined && status[update.status] !== findMessage.status) { if (!key.fromMe && key.remoteJid) { readChatToUpdate[key.remoteJid] = true; From 4f043f9576bbda13b16ae47981fd77151a199fad Mon Sep 17 00:00:00 2001 From: Felipe Augusto Rieck Date: Mon, 4 Aug 2025 16:34:20 -0300 Subject: [PATCH 019/129] Securing websockets --- src/api/integrations/event/websocket/websocket.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index a1cef2db..c0d3e5de 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -28,10 +28,11 @@ export class WebsocketController extends EventController implements EventControl allowRequest: async (req, callback) => { try { const url = new URL(req.url || '', 'http://localhost'); + const isInternalConnection = req.socket.remoteAddress === '127.0.0.1' || req.socket.remoteAddress === '::1'; const params = new URLSearchParams(url.search); // Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4) - if (params.has('EIO')) { + if (params.has('EIO') && isInternalConnection) { return callback(null, true); } From d4eb61f64d9fe263270146926e973018cf803880 Mon Sep 17 00:00:00 2001 From: Felipe Augusto Rieck Date: Mon, 4 Aug 2025 18:14:33 -0300 Subject: [PATCH 020/129] Improving localhost check --- .../integrations/event/websocket/websocket.controller.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index c0d3e5de..f7250b7a 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -28,11 +28,14 @@ export class WebsocketController extends EventController implements EventControl allowRequest: async (req, callback) => { try { const url = new URL(req.url || '', 'http://localhost'); - const isInternalConnection = req.socket.remoteAddress === '127.0.0.1' || req.socket.remoteAddress === '::1'; const params = new URLSearchParams(url.search); + const remoteAddress = req.socket.remoteAddress; + const isLocalhost = + remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1'; + // Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4) - if (params.has('EIO') && isInternalConnection) { + if (params.has('EIO') && isLocalhost) { return callback(null, true); } From fb11f3f99cc19bf1631cb42538e29eb46cb87484 Mon Sep 17 00:00:00 2001 From: Felipe Augusto Rieck Date: Mon, 4 Aug 2025 18:19:14 -0300 Subject: [PATCH 021/129] Code quality --- src/api/integrations/event/websocket/websocket.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index f7250b7a..3f4afd9b 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -30,7 +30,7 @@ export class WebsocketController extends EventController implements EventControl const url = new URL(req.url || '', 'http://localhost'); const params = new URLSearchParams(url.search); - const remoteAddress = req.socket.remoteAddress; + const { remoteAddress } = req.socket; const isLocalhost = remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1'; From 3390958314f20b603788b7a975694014110b0975 Mon Sep 17 00:00:00 2001 From: Henry Barreto Date: Fri, 1 Aug 2025 19:40:39 -0300 Subject: [PATCH 022/129] feat: add support to socks proxy --- package-lock.json | 64 +++++++++++++++++++++++++++++++++++++ package.json | 1 + src/utils/makeProxyAgent.ts | 27 ++++++++++++++-- 3 files changed, 89 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb9f0c48..6e81cc53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "sharp": "^0.34.2", "socket.io": "^4.8.1", "socket.io-client": "^4.8.1", + "socks-proxy-agent": "^8.0.5", "swagger-ui-express": "^5.0.1", "tsup": "^8.3.5" }, @@ -7739,6 +7740,19 @@ "node": ">= 0.4" } }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/ipaddr.js": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", @@ -8249,6 +8263,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -10761,6 +10781,16 @@ "node": ">=8" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, "node_modules/socket.io": { "version": "4.8.1", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", @@ -10897,6 +10927,34 @@ } } }, + "node_modules/socks": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", + "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/sonic-boom": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", @@ -10921,6 +10979,12 @@ "node": ">= 10.x" } }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", diff --git a/package.json b/package.json index 9de9d07c..107cca49 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,7 @@ "sharp": "^0.34.2", "socket.io": "^4.8.1", "socket.io-client": "^4.8.1", + "socks-proxy-agent": "^8.0.5", "swagger-ui-express": "^5.0.1", "tsup": "^8.3.5" }, diff --git a/src/utils/makeProxyAgent.ts b/src/utils/makeProxyAgent.ts index dcf560f6..3b1379bd 100644 --- a/src/utils/makeProxyAgent.ts +++ b/src/utils/makeProxyAgent.ts @@ -1,4 +1,5 @@ import { HttpsProxyAgent } from 'https-proxy-agent'; +import { SocksProxyAgent } from 'socks-proxy-agent'; type Proxy = { host: string; @@ -8,9 +9,28 @@ type Proxy = { username?: string; }; -export function makeProxyAgent(proxy: Proxy | string) { +function selectProxyAgent(proxyUrl: string): HttpsProxyAgent | SocksProxyAgent { + const url = new URL(proxyUrl); + + // NOTE: The following constants are not used in the function but are defined for clarity. + // When a proxy URL is used to build the URL object, the protocol returned by procotol's property contains a `:` at + // the end so, we add the protocol constants without the `:` to avoid confusion. + const PROXY_HTTP_PROTOCOL = 'http:'; + const PROXY_SOCKS_PROTOCOL = 'socks:'; + + switch (url.protocol) { + case PROXY_HTTP_PROTOCOL: + return new HttpsProxyAgent(url); + case PROXY_SOCKS_PROTOCOL: + return new SocksProxyAgent(url); + default: + throw new Error(`Unsupported proxy protocol: ${url.protocol}`); + } +} + +export function makeProxyAgent(proxy: Proxy | string): HttpsProxyAgent | SocksProxyAgent { if (typeof proxy === 'string') { - return new HttpsProxyAgent(proxy); + return selectProxyAgent(proxy); } const { host, password, port, protocol, username } = proxy; @@ -19,5 +39,6 @@ export function makeProxyAgent(proxy: Proxy | string) { if (username && password) { proxyUrl = `${protocol}://${username}:${password}@${host}:${port}`; } - return new HttpsProxyAgent(proxyUrl); + + return selectProxyAgent(proxyUrl); } From ab9e0edad684ec9ca6a15a4422ff3e01393f9ebd Mon Sep 17 00:00:00 2001 From: Henry Barreto Date: Fri, 1 Aug 2025 12:49:15 -0300 Subject: [PATCH 023/129] feat: enhance logging for proxy testing errors This commit improves the logging in the testProxy method of the ProxyController class. Now, when an Axios error occurs, the specific error message will be logged if available. For unexpected errors, the error object is included for better insight. For reference, see the "message" field in the Axios documentation: [Axios Error Handling](https://axios-http.com/docs/handling_errors). --- src/api/controllers/proxy.controller.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/api/controllers/proxy.controller.ts b/src/api/controllers/proxy.controller.ts index fac00375..b6e7d153 100644 --- a/src/api/controllers/proxy.controller.ts +++ b/src/api/controllers/proxy.controller.ts @@ -53,15 +53,21 @@ export class ProxyController { httpsAgent: makeProxyAgent(proxy), }); - return response?.data !== serverIp?.data; - } catch (error) { - if (axios.isAxiosError(error) && error.response?.data) { - logger.error('testProxy error: ' + error.response.data); - } else if (axios.isAxiosError(error)) { - logger.error('testProxy error: '); + const result = response?.data !== serverIp?.data; + if (result) { + logger.info('testProxy: proxy connection successful'); } else { - logger.error('testProxy error: '); + logger.warn("testProxy: proxy connection doesn't change the origin IP"); } + + return result; + } catch (error) { + if (axios.isAxiosError(error)) { + logger.error('testProxy error: axios error: ' + error.message); + } else { + logger.error('testProxy error: unexpected error: ' + error); + } + return false; } } From 4945345519478345d04becafabd055e566de7ad6 Mon Sep 17 00:00:00 2001 From: "Neto, Aristides da Silva" Date: Tue, 5 Aug 2025 22:07:20 -0300 Subject: [PATCH 024/129] docs(readme): corrigidos badge Docker image no README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrigida formatação do badge Docker image no README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ad5fa0a..6d9b3344 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
-[![Docker Image (https://img.shields.io/badge/Docker-Image-blue)](https://hub.docker.com/r/evoapicloud/evolution-api)] +[![Docker Image](https://img.shields.io/badge/Docker-image-blue)](https://hub.docker.com/r/evoapicloud/evolution-api) [![Whatsapp Group](https://img.shields.io/badge/Group-WhatsApp-%2322BC18)](https://evolution-api.com/whatsapp) [![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord) [![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman) From 74cb65c4ea9ee84f4b85eb238773e94e73cd2add Mon Sep 17 00:00:00 2001 From: Bilal Iqbal Date: Thu, 14 Aug 2025 00:51:41 +0500 Subject: [PATCH 025/129] Added key id into webhook payload in n8n service --- src/api/integrations/chatbot/n8n/services/n8n.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/integrations/chatbot/n8n/services/n8n.service.ts b/src/api/integrations/chatbot/n8n/services/n8n.service.ts index 2d0802b9..5bb40890 100644 --- a/src/api/integrations/chatbot/n8n/services/n8n.service.ts +++ b/src/api/integrations/chatbot/n8n/services/n8n.service.ts @@ -49,6 +49,7 @@ export class N8nService extends BaseChatbotService { sessionId: session.sessionId, remoteJid: remoteJid, pushName: pushName, + keyId: msg?.key?.id, fromMe: msg?.key?.fromMe, instanceName: instance.instanceName, serverUrl: this.configService.get('SERVER').URL, From 6e652d6ea25819fdfe22e398a6b0c61c07db0360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ca=C3=ADque=20Zanetoni=20Fim?= <50633626+caiquezanetoni@users.noreply.github.com> Date: Mon, 18 Aug 2025 08:43:21 -0300 Subject: [PATCH 026/129] Update migration.sql --- .../migration.sql | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/prisma/postgresql-migrations/20250116001415_add_wavoip_token_to_settings_table/migration.sql b/prisma/postgresql-migrations/20250116001415_add_wavoip_token_to_settings_table/migration.sql index 26898a08..00f9bc7d 100644 --- a/prisma/postgresql-migrations/20250116001415_add_wavoip_token_to_settings_table/migration.sql +++ b/prisma/postgresql-migrations/20250116001415_add_wavoip_token_to_settings_table/migration.sql @@ -6,14 +6,4 @@ Warnings: */ -- AlterTable -DO $$ -BEGIN - IF NOT EXISTS ( - SELECT 1 - FROM information_schema.columns - WHERE table_name = 'Setting' - AND column_name = 'wavoipToken' - ) THEN - ALTER TABLE "Setting" ADD COLUMN "wavoipToken" VARCHAR(100); - END IF; -END $$; \ No newline at end of file +ALTER TABLE "Setting" ADD COLUMN IF NOT EXISTS "wavoipToken" VARCHAR(100); From 7a99fba556c183194bdf64e7dc4aed5026a3f55a Mon Sep 17 00:00:00 2001 From: luissantosjs Date: Wed, 20 Aug 2025 12:29:45 +0100 Subject: [PATCH 027/129] feat: enhance RabbitMQ controller with improved connection management and shutdown procedures --- .../event/rabbitmq/rabbitmq.controller.ts | 381 +++++++++++++----- 1 file changed, 270 insertions(+), 111 deletions(-) diff --git a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts index be73b157..a6d1e565 100644 --- a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts +++ b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts @@ -14,6 +14,9 @@ export class RabbitmqController extends EventController implements EventControll private maxReconnectAttempts = 10; private reconnectDelay = 5000; // 5 seconds private isReconnecting = false; + private reconnectTimer: NodeJS.Timeout | null = null; + private connectionStatus: 'connected' | 'disconnected' | 'connecting' | 'reconnecting' = 'disconnected'; + private isShuttingDown = false; constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { super(prismaRepository, waMonitor, configService.get('RABBITMQ')?.ENABLED, 'rabbitmq'); @@ -27,7 +30,91 @@ export class RabbitmqController extends EventController implements EventControll await this.connect(); } + public async shutdown(): Promise { + this.logger.info('Shutting down RabbitMQ controller...'); + this.isShuttingDown = true; + + // Clear any pending reconnect timer + if (this.reconnectTimer) { + clearTimeout(this.reconnectTimer); + this.reconnectTimer = null; + } + + // Close channel and connection gracefully + await this.closeConnection(); + this.logger.info('RabbitMQ controller shutdown complete'); + } + + private async closeConnection(): Promise { + try { + if (this.amqpChannel) { + await new Promise((resolve) => { + this.amqpChannel?.close((err) => { + if (err) { + this.logger.warn(`Error closing channel: ${err.message}`); + } + resolve(); + }); + }); + this.amqpChannel = null; + } + + if (this.amqpConnection) { + await new Promise((resolve) => { + this.amqpConnection?.close((err) => { + if (err) { + this.logger.warn(`Error closing connection: ${err.message}`); + } + resolve(); + }); + }); + this.amqpConnection = null; + } + } catch (error) { + this.logger.error({ + local: 'RabbitmqController.closeConnection', + message: 'Error during connection cleanup', + error: error.message || error, + }); + } + } + + public getConnectionStatus(): string { + return this.connectionStatus; + } + + public isConnected(): boolean { + return this.connectionStatus === 'connected' && this.amqpChannel !== null && this.amqpConnection !== null; + } + + public async forceReconnect(): Promise { + this.logger.info('Force reconnect requested'); + + // Reset reconnect attempts for forced reconnect + this.reconnectAttempts = 0; + + // Close existing connections + await this.closeConnection(); + + // Clear any pending reconnect + if (this.reconnectTimer) { + clearTimeout(this.reconnectTimer); + this.reconnectTimer = null; + } + + this.isReconnecting = false; + + // Attempt immediate reconnection + await this.connect(); + } + private async connect(): Promise { + if (this.isShuttingDown) { + return; + } + + this.connectionStatus = this.reconnectAttempts > 0 ? 'reconnecting' : 'connecting'; + return new Promise((resolve, reject) => { const uri = configService.get('RABBITMQ').URI; const frameMax = configService.get('RABBITMQ').FRAME_MAX; @@ -47,6 +134,7 @@ export class RabbitmqController extends EventController implements EventControll amqp.connect(connectionOptions, (error, connection) => { if (error) { + this.connectionStatus = 'disconnected'; this.logger.error({ local: 'RabbitmqController.connect', message: 'Failed to connect to RabbitMQ', @@ -63,16 +151,25 @@ export class RabbitmqController extends EventController implements EventControll message: 'RabbitMQ connection error', error: err.message || err, }); - this.handleConnectionLoss(); + this.handleConnectionLoss('connection_error', err); }); connection.on('close', () => { this.logger.warn('RabbitMQ connection closed'); - this.handleConnectionLoss(); + this.handleConnectionLoss('connection_closed'); + }); + + connection.on('blocked', (reason) => { + this.logger.warn(`RabbitMQ connection blocked: ${reason}`); + }); + + connection.on('unblocked', () => { + this.logger.info('RabbitMQ connection unblocked'); }); connection.createChannel((channelError, channel) => { if (channelError) { + this.connectionStatus = 'disconnected'; this.logger.error({ local: 'RabbitmqController.createChannel', message: 'Failed to create RabbitMQ channel', @@ -89,12 +186,21 @@ export class RabbitmqController extends EventController implements EventControll message: 'RabbitMQ channel error', error: err.message || err, }); - this.handleConnectionLoss(); + this.handleConnectionLoss('channel_error', err); }); channel.on('close', () => { this.logger.warn('RabbitMQ channel closed'); - this.handleConnectionLoss(); + this.handleConnectionLoss('channel_closed'); + }); + + channel.on('return', (msg) => { + this.logger.warn('RabbitMQ message returned' + JSON.stringify({ + exchange: msg.fields.exchange, + routingKey: msg.fields.routingKey, + replyCode: msg.fields.replyCode, + replyText: msg.fields.replyText, + })); }); const exchangeName = rabbitmqExchangeName; @@ -102,25 +208,37 @@ export class RabbitmqController extends EventController implements EventControll channel.assertExchange(exchangeName, 'topic', { durable: true, autoDelete: false, + }, (exchangeError) => { + if (exchangeError) { + this.connectionStatus = 'disconnected'; + this.logger.error({ + local: 'RabbitmqController.assertExchange', + message: 'Failed to assert exchange', + error: exchangeError.message || exchangeError, + }); + reject(exchangeError); + return; + } + + this.amqpConnection = connection; + this.amqpChannel = channel; + this.reconnectAttempts = 0; // Reset reconnect attempts on successful connection + this.isReconnecting = false; + this.connectionStatus = 'connected'; + + this.logger.info('AMQP initialized successfully'); + resolve(); }); - - this.amqpConnection = connection; - this.amqpChannel = channel; - this.reconnectAttempts = 0; // Reset reconnect attempts on successful connection - this.isReconnecting = false; - - this.logger.info('AMQP initialized successfully'); - - resolve(); }); }); }) .then(() => { if (configService.get('RABBITMQ')?.GLOBAL_ENABLED) { - this.initGlobalQueues(); + return this.initGlobalQueues(); } }) .catch((error) => { + this.connectionStatus = 'disconnected'; this.logger.error({ local: 'RabbitmqController.init', message: 'Failed to initialize AMQP', @@ -131,21 +249,30 @@ export class RabbitmqController extends EventController implements EventControll }); } - private handleConnectionLoss(): void { - if (this.isReconnecting) { - return; // Already attempting to reconnect + private handleConnectionLoss(reason?: string, error?: any): void { + if (this.isReconnecting || this.isShuttingDown) { + return; // Already attempting to reconnect or shutting down } + this.logger.warn(`Connection lost due to: ${reason || 'unknown reason'}` + JSON.stringify(error ? { error: error.message || error } : {})); + + this.connectionStatus = 'disconnected'; this.amqpChannel = null; this.amqpConnection = null; + this.scheduleReconnect(); } private scheduleReconnect(): void { + if (this.isShuttingDown) { + return; + } + if (this.reconnectAttempts >= this.maxReconnectAttempts) { this.logger.error( `Maximum reconnect attempts (${this.maxReconnectAttempts}) reached. Stopping reconnection attempts.`, ); + this.connectionStatus = 'disconnected'; return; } @@ -162,7 +289,11 @@ export class RabbitmqController extends EventController implements EventControll `Scheduling RabbitMQ reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms`, ); - setTimeout(async () => { + this.reconnectTimer = setTimeout(async () => { + if (this.isShuttingDown) { + return; + } + try { this.logger.info( `Attempting to reconnect to RabbitMQ (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`, @@ -177,6 +308,8 @@ export class RabbitmqController extends EventController implements EventControll }); this.isReconnecting = false; this.scheduleReconnect(); + } finally { + this.reconnectTimer = null; } }, delay); } @@ -190,9 +323,9 @@ export class RabbitmqController extends EventController implements EventControll } private async ensureConnection(): Promise { - if (!this.amqpChannel) { + if (!this.amqpChannel || !this.isConnected()) { this.logger.warn('AMQP channel is not available, attempting to reconnect...'); - if (!this.isReconnecting) { + if (!this.isReconnecting && !this.isShuttingDown) { this.scheduleReconnect(); } return false; @@ -200,6 +333,25 @@ export class RabbitmqController extends EventController implements EventControll return true; } + public async waitForConnection(timeoutMs: number = 30000): Promise { + const startTime = Date.now(); + + while (Date.now() - startTime < timeoutMs) { + if (this.isConnected()) { + return true; + } + + if (this.isShuttingDown) { + return false; + } + + // Wait 100ms before checking again + await new Promise(resolve => setTimeout(resolve, 100)); + } + + return false; + } + public async emit({ instanceName, origin, @@ -246,106 +398,113 @@ export class RabbitmqController extends EventController implements EventControll if (instanceRabbitmq?.enabled && this.amqpChannel) { if (Array.isArray(rabbitmqLocal) && rabbitmqLocal.includes(we)) { const exchangeName = instanceName ?? rabbitmqExchangeName; - - let retry = 0; - - while (retry < 3) { - try { - await this.amqpChannel.assertExchange(exchangeName, 'topic', { - durable: true, - autoDelete: false, - }); - - const eventName = event.replace(/_/g, '.').toLowerCase(); - - const queueName = `${instanceName}.${eventName}`; - - await this.amqpChannel.assertQueue(queueName, { - durable: true, - autoDelete: false, - arguments: { - 'x-queue-type': 'quorum', - }, - }); - - await this.amqpChannel.bindQueue(queueName, exchangeName, eventName); - - await this.amqpChannel.publish(exchangeName, event, Buffer.from(JSON.stringify(message))); - - if (logEnabled) { - const logData = { - local: `${origin}.sendData-RabbitMQ`, - ...message, - }; - - this.logger.log(logData); - } - - break; - } catch (error) { - this.logger.error({ - local: 'RabbitmqController.emit', - message: `Error publishing local RabbitMQ message (attempt ${retry + 1}/3)`, - error: error.message || error, - }); - retry++; - if (retry >= 3) { - this.handleConnectionLoss(); - } - } - } + await this.publishMessage(exchangeName, event, message, instanceName, origin, logEnabled, 'local'); } } if (rabbitmqGlobal && rabbitmqEvents[we] && this.amqpChannel) { const exchangeName = rabbitmqExchangeName; + await this.publishMessage(exchangeName, event, message, instanceName, origin, logEnabled, 'global'); + } + } - let retry = 0; + private async publishMessage( + exchangeName: string, + event: string, + message: any, + instanceName: string, + origin: string, + logEnabled: boolean, + type: 'local' | 'global' + ): Promise { + let retry = 0; + const maxRetries = 3; - while (retry < 3) { - try { - await this.amqpChannel.assertExchange(exchangeName, 'topic', { - durable: true, - autoDelete: false, - }); + while (retry < maxRetries) { + try { + if (!(await this.ensureConnection())) { + throw new Error('No AMQP connection available'); + } - const queueName = prefixKey + await this.amqpChannel.assertExchange(exchangeName, 'topic', { + durable: true, + autoDelete: false, + }); + + let queueName: string; + let routingKey: string; + + if (type === 'local') { + const eventName = event.replace(/_/g, '.').toLowerCase(); + queueName = `${instanceName}.${eventName}`; + routingKey = eventName; + } else { + const prefixKey = configService.get('RABBITMQ').PREFIX_KEY; + queueName = prefixKey ? `${prefixKey}.${event.replace(/_/g, '.').toLowerCase()}` : event.replace(/_/g, '.').toLowerCase(); - - await this.amqpChannel.assertQueue(queueName, { - durable: true, - autoDelete: false, - arguments: { - 'x-queue-type': 'quorum', - }, - }); - - await this.amqpChannel.bindQueue(queueName, exchangeName, event); - - await this.amqpChannel.publish(exchangeName, event, Buffer.from(JSON.stringify(message))); - - if (logEnabled) { - const logData = { - local: `${origin}.sendData-RabbitMQ-Global`, - ...message, - }; - - this.logger.log(logData); - } - - break; - } catch (error) { - this.logger.error({ - local: 'RabbitmqController.emit', - message: `Error publishing global RabbitMQ message (attempt ${retry + 1}/3)`, - error: error.message || error, - }); - retry++; - if (retry >= 3) { - this.handleConnectionLoss(); - } + routingKey = event; } + + await this.amqpChannel.assertQueue(queueName, { + durable: true, + autoDelete: false, + arguments: { + 'x-queue-type': 'quorum', + }, + }); + + await this.amqpChannel.bindQueue(queueName, exchangeName, routingKey); + + const published = await new Promise((resolve) => { + const success = this.amqpChannel.publish( + exchangeName, + routingKey, + Buffer.from(JSON.stringify(message)), + { persistent: true }, + (err) => { + if (err) { + resolve(false); + } else { + resolve(true); + } + } + ); + + if (!success) { + resolve(false); + } + }); + + if (!published) { + throw new Error('Failed to publish message - channel write buffer full'); + } + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-RabbitMQ${type === 'global' ? '-Global' : ''}`, + ...message, + }; + + this.logger.log(logData); + } + + break; // Success, exit retry loop + } catch (error) { + this.logger.error({ + local: 'RabbitmqController.publishMessage', + message: `Error publishing ${type} RabbitMQ message (attempt ${retry + 1}/${maxRetries})`, + error: error.message || error, + }); + retry++; + + if (retry >= maxRetries) { + this.handleConnectionLoss('publish_error', error); + throw error; + } + + // Wait before retry + await new Promise(resolve => setTimeout(resolve, 1000 * retry)); } } } @@ -401,9 +560,9 @@ export class RabbitmqController extends EventController implements EventControll message: `Failed to initialize global queue for event ${event}`, error: error.message || error, }); - this.handleConnectionLoss(); + this.handleConnectionLoss('queue_init_error', error); break; } } } -} +} \ No newline at end of file From 4681576cfca1a6042dc615ba724ce59ba4a3579d Mon Sep 17 00:00:00 2001 From: luissantosjs Date: Fri, 22 Aug 2025 22:49:40 +0100 Subject: [PATCH 028/129] up --- .../event/rabbitmq/rabbitmq.controller.ts | 369 +++++------------- 1 file changed, 105 insertions(+), 264 deletions(-) diff --git a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts index a6d1e565..24468ac8 100644 --- a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts +++ b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts @@ -14,9 +14,6 @@ export class RabbitmqController extends EventController implements EventControll private maxReconnectAttempts = 10; private reconnectDelay = 5000; // 5 seconds private isReconnecting = false; - private reconnectTimer: NodeJS.Timeout | null = null; - private connectionStatus: 'connected' | 'disconnected' | 'connecting' | 'reconnecting' = 'disconnected'; - private isShuttingDown = false; constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { super(prismaRepository, waMonitor, configService.get('RABBITMQ')?.ENABLED, 'rabbitmq'); @@ -30,91 +27,7 @@ export class RabbitmqController extends EventController implements EventControll await this.connect(); } - public async shutdown(): Promise { - this.logger.info('Shutting down RabbitMQ controller...'); - this.isShuttingDown = true; - - // Clear any pending reconnect timer - if (this.reconnectTimer) { - clearTimeout(this.reconnectTimer); - this.reconnectTimer = null; - } - - // Close channel and connection gracefully - await this.closeConnection(); - this.logger.info('RabbitMQ controller shutdown complete'); - } - - private async closeConnection(): Promise { - try { - if (this.amqpChannel) { - await new Promise((resolve) => { - this.amqpChannel?.close((err) => { - if (err) { - this.logger.warn(`Error closing channel: ${err.message}`); - } - resolve(); - }); - }); - this.amqpChannel = null; - } - - if (this.amqpConnection) { - await new Promise((resolve) => { - this.amqpConnection?.close((err) => { - if (err) { - this.logger.warn(`Error closing connection: ${err.message}`); - } - resolve(); - }); - }); - this.amqpConnection = null; - } - } catch (error) { - this.logger.error({ - local: 'RabbitmqController.closeConnection', - message: 'Error during connection cleanup', - error: error.message || error, - }); - } - } - - public getConnectionStatus(): string { - return this.connectionStatus; - } - - public isConnected(): boolean { - return this.connectionStatus === 'connected' && this.amqpChannel !== null && this.amqpConnection !== null; - } - - public async forceReconnect(): Promise { - this.logger.info('Force reconnect requested'); - - // Reset reconnect attempts for forced reconnect - this.reconnectAttempts = 0; - - // Close existing connections - await this.closeConnection(); - - // Clear any pending reconnect - if (this.reconnectTimer) { - clearTimeout(this.reconnectTimer); - this.reconnectTimer = null; - } - - this.isReconnecting = false; - - // Attempt immediate reconnection - await this.connect(); - } - private async connect(): Promise { - if (this.isShuttingDown) { - return; - } - - this.connectionStatus = this.reconnectAttempts > 0 ? 'reconnecting' : 'connecting'; - return new Promise((resolve, reject) => { const uri = configService.get('RABBITMQ').URI; const frameMax = configService.get('RABBITMQ').FRAME_MAX; @@ -134,7 +47,6 @@ export class RabbitmqController extends EventController implements EventControll amqp.connect(connectionOptions, (error, connection) => { if (error) { - this.connectionStatus = 'disconnected'; this.logger.error({ local: 'RabbitmqController.connect', message: 'Failed to connect to RabbitMQ', @@ -151,25 +63,16 @@ export class RabbitmqController extends EventController implements EventControll message: 'RabbitMQ connection error', error: err.message || err, }); - this.handleConnectionLoss('connection_error', err); + this.handleConnectionLoss(); }); connection.on('close', () => { this.logger.warn('RabbitMQ connection closed'); - this.handleConnectionLoss('connection_closed'); - }); - - connection.on('blocked', (reason) => { - this.logger.warn(`RabbitMQ connection blocked: ${reason}`); - }); - - connection.on('unblocked', () => { - this.logger.info('RabbitMQ connection unblocked'); + this.handleConnectionLoss(); }); connection.createChannel((channelError, channel) => { if (channelError) { - this.connectionStatus = 'disconnected'; this.logger.error({ local: 'RabbitmqController.createChannel', message: 'Failed to create RabbitMQ channel', @@ -186,21 +89,12 @@ export class RabbitmqController extends EventController implements EventControll message: 'RabbitMQ channel error', error: err.message || err, }); - this.handleConnectionLoss('channel_error', err); + this.handleConnectionLoss(); }); channel.on('close', () => { this.logger.warn('RabbitMQ channel closed'); - this.handleConnectionLoss('channel_closed'); - }); - - channel.on('return', (msg) => { - this.logger.warn('RabbitMQ message returned' + JSON.stringify({ - exchange: msg.fields.exchange, - routingKey: msg.fields.routingKey, - replyCode: msg.fields.replyCode, - replyText: msg.fields.replyText, - })); + this.handleConnectionLoss(); }); const exchangeName = rabbitmqExchangeName; @@ -208,37 +102,25 @@ export class RabbitmqController extends EventController implements EventControll channel.assertExchange(exchangeName, 'topic', { durable: true, autoDelete: false, - }, (exchangeError) => { - if (exchangeError) { - this.connectionStatus = 'disconnected'; - this.logger.error({ - local: 'RabbitmqController.assertExchange', - message: 'Failed to assert exchange', - error: exchangeError.message || exchangeError, - }); - reject(exchangeError); - return; - } - - this.amqpConnection = connection; - this.amqpChannel = channel; - this.reconnectAttempts = 0; // Reset reconnect attempts on successful connection - this.isReconnecting = false; - this.connectionStatus = 'connected'; - - this.logger.info('AMQP initialized successfully'); - resolve(); }); + + this.amqpConnection = connection; + this.amqpChannel = channel; + this.reconnectAttempts = 0; // Reset reconnect attempts on successful connection + this.isReconnecting = false; + + this.logger.info('AMQP initialized successfully'); + + resolve(); }); }); }) .then(() => { if (configService.get('RABBITMQ')?.GLOBAL_ENABLED) { - return this.initGlobalQueues(); + this.initGlobalQueues(); } }) .catch((error) => { - this.connectionStatus = 'disconnected'; this.logger.error({ local: 'RabbitmqController.init', message: 'Failed to initialize AMQP', @@ -249,30 +131,21 @@ export class RabbitmqController extends EventController implements EventControll }); } - private handleConnectionLoss(reason?: string, error?: any): void { - if (this.isReconnecting || this.isShuttingDown) { - return; // Already attempting to reconnect or shutting down + private handleConnectionLoss(): void { + if (this.isReconnecting) { + return; // Already attempting to reconnect } - this.logger.warn(`Connection lost due to: ${reason || 'unknown reason'}` + JSON.stringify(error ? { error: error.message || error } : {})); - - this.connectionStatus = 'disconnected'; this.amqpChannel = null; this.amqpConnection = null; - this.scheduleReconnect(); } private scheduleReconnect(): void { - if (this.isShuttingDown) { - return; - } - if (this.reconnectAttempts >= this.maxReconnectAttempts) { this.logger.error( `Maximum reconnect attempts (${this.maxReconnectAttempts}) reached. Stopping reconnection attempts.`, ); - this.connectionStatus = 'disconnected'; return; } @@ -289,11 +162,7 @@ export class RabbitmqController extends EventController implements EventControll `Scheduling RabbitMQ reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms`, ); - this.reconnectTimer = setTimeout(async () => { - if (this.isShuttingDown) { - return; - } - + setTimeout(async () => { try { this.logger.info( `Attempting to reconnect to RabbitMQ (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`, @@ -308,8 +177,6 @@ export class RabbitmqController extends EventController implements EventControll }); this.isReconnecting = false; this.scheduleReconnect(); - } finally { - this.reconnectTimer = null; } }, delay); } @@ -323,9 +190,9 @@ export class RabbitmqController extends EventController implements EventControll } private async ensureConnection(): Promise { - if (!this.amqpChannel || !this.isConnected()) { + if (!this.amqpChannel) { this.logger.warn('AMQP channel is not available, attempting to reconnect...'); - if (!this.isReconnecting && !this.isShuttingDown) { + if (!this.isReconnecting) { this.scheduleReconnect(); } return false; @@ -333,25 +200,6 @@ export class RabbitmqController extends EventController implements EventControll return true; } - public async waitForConnection(timeoutMs: number = 30000): Promise { - const startTime = Date.now(); - - while (Date.now() - startTime < timeoutMs) { - if (this.isConnected()) { - return true; - } - - if (this.isShuttingDown) { - return false; - } - - // Wait 100ms before checking again - await new Promise(resolve => setTimeout(resolve, 100)); - } - - return false; - } - public async emit({ instanceName, origin, @@ -398,113 +246,106 @@ export class RabbitmqController extends EventController implements EventControll if (instanceRabbitmq?.enabled && this.amqpChannel) { if (Array.isArray(rabbitmqLocal) && rabbitmqLocal.includes(we)) { const exchangeName = instanceName ?? rabbitmqExchangeName; - await this.publishMessage(exchangeName, event, message, instanceName, origin, logEnabled, 'local'); + + let retry = 0; + + while (retry < 3) { + try { + await this.amqpChannel.assertExchange(exchangeName, 'topic', { + durable: true, + autoDelete: false, + }); + + const eventName = event.replace(/_/g, '.').toLowerCase(); + + const queueName = `${instanceName}.${eventName}`; + + await this.amqpChannel.assertQueue(queueName, { + durable: true, + autoDelete: false, + arguments: { + 'x-queue-type': 'quorum', + }, + }); + + await this.amqpChannel.bindQueue(queueName, exchangeName, eventName); + + await this.amqpChannel.publish(exchangeName, event, Buffer.from(JSON.stringify(message))); + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-RabbitMQ`, + ...message, + }; + + this.logger.log(logData); + } + + break; + } catch (error) { + this.logger.error({ + local: 'RabbitmqController.emit', + message: `Error publishing local RabbitMQ message (attempt ${retry + 1}/3)`, + error: error.message || error, + }); + retry++; + if (retry >= 3) { + this.handleConnectionLoss(); + } + } + } } } if (rabbitmqGlobal && rabbitmqEvents[we] && this.amqpChannel) { const exchangeName = rabbitmqExchangeName; - await this.publishMessage(exchangeName, event, message, instanceName, origin, logEnabled, 'global'); - } - } - private async publishMessage( - exchangeName: string, - event: string, - message: any, - instanceName: string, - origin: string, - logEnabled: boolean, - type: 'local' | 'global' - ): Promise { - let retry = 0; - const maxRetries = 3; + let retry = 0; - while (retry < maxRetries) { - try { - if (!(await this.ensureConnection())) { - throw new Error('No AMQP connection available'); - } + while (retry < 3) { + try { + await this.amqpChannel.assertExchange(exchangeName, 'topic', { + durable: true, + autoDelete: false, + }); - await this.amqpChannel.assertExchange(exchangeName, 'topic', { - durable: true, - autoDelete: false, - }); - - let queueName: string; - let routingKey: string; - - if (type === 'local') { - const eventName = event.replace(/_/g, '.').toLowerCase(); - queueName = `${instanceName}.${eventName}`; - routingKey = eventName; - } else { - const prefixKey = configService.get('RABBITMQ').PREFIX_KEY; - queueName = prefixKey + const queueName = prefixKey ? `${prefixKey}.${event.replace(/_/g, '.').toLowerCase()}` : event.replace(/_/g, '.').toLowerCase(); - routingKey = event; - } - await this.amqpChannel.assertQueue(queueName, { - durable: true, - autoDelete: false, - arguments: { - 'x-queue-type': 'quorum', - }, - }); + await this.amqpChannel.assertQueue(queueName, { + durable: true, + autoDelete: false, + arguments: { + 'x-queue-type': 'quorum', + }, + }); - await this.amqpChannel.bindQueue(queueName, exchangeName, routingKey); + await this.amqpChannel.bindQueue(queueName, exchangeName, event); - const published = await new Promise((resolve) => { - const success = this.amqpChannel.publish( - exchangeName, - routingKey, - Buffer.from(JSON.stringify(message)), - { persistent: true }, - (err) => { - if (err) { - resolve(false); - } else { - resolve(true); - } - } - ); - - if (!success) { - resolve(false); + await this.amqpChannel.publish(exchangeName, event, Buffer.from(JSON.stringify(message))); + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-RabbitMQ-Global`, + ...message, + }; + + this.logger.log(logData); } - }); - if (!published) { - throw new Error('Failed to publish message - channel write buffer full'); + break; + } catch (error) { + this.logger.error({ + local: 'RabbitmqController.emit', + message: `Error publishing global RabbitMQ message (attempt ${retry + 1}/3)`, + error: error.message || error, + }); + retry++; + if (retry >= 3) { + this.handleConnectionLoss(); + } } - - if (logEnabled) { - const logData = { - local: `${origin}.sendData-RabbitMQ${type === 'global' ? '-Global' : ''}`, - ...message, - }; - - this.logger.log(logData); - } - - break; // Success, exit retry loop - } catch (error) { - this.logger.error({ - local: 'RabbitmqController.publishMessage', - message: `Error publishing ${type} RabbitMQ message (attempt ${retry + 1}/${maxRetries})`, - error: error.message || error, - }); - retry++; - - if (retry >= maxRetries) { - this.handleConnectionLoss('publish_error', error); - throw error; - } - - // Wait before retry - await new Promise(resolve => setTimeout(resolve, 1000 * retry)); } } } @@ -560,7 +401,7 @@ export class RabbitmqController extends EventController implements EventControll message: `Failed to initialize global queue for event ${event}`, error: error.message || error, }); - this.handleConnectionLoss('queue_init_error', error); + this.handleConnectionLoss(); break; } } From b325500310da00a827baea406cbff8192a682fb7 Mon Sep 17 00:00:00 2001 From: luissantosjs Date: Tue, 26 Aug 2025 19:15:59 +0100 Subject: [PATCH 029/129] improve rabbit controller --- .../event/rabbitmq/rabbitmq.controller.ts | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts index 24468ac8..3295b12d 100644 --- a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts +++ b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts @@ -45,7 +45,7 @@ export class RabbitmqController extends EventController implements EventControll heartbeat: 30, // Add heartbeat of 30 seconds }; - amqp.connect(connectionOptions, (error, connection) => { + amqp.connect(connectionOptions, (error: Error, connection: amqp.Connection) => { if (error) { this.logger.error({ local: 'RabbitmqController.connect', @@ -57,7 +57,7 @@ export class RabbitmqController extends EventController implements EventControll } // Connection event handlers - connection.on('error', (err) => { + connection.on('error', (err: Error) => { this.logger.error({ local: 'RabbitmqController.connectionError', message: 'RabbitMQ connection error', @@ -71,7 +71,7 @@ export class RabbitmqController extends EventController implements EventControll this.handleConnectionLoss(); }); - connection.createChannel((channelError, channel) => { + connection.createChannel((channelError: Error, channel: amqp.Channel) => { if (channelError) { this.logger.error({ local: 'RabbitmqController.createChannel', @@ -83,7 +83,7 @@ export class RabbitmqController extends EventController implements EventControll } // Channel event handlers - channel.on('error', (err) => { + channel.on('error', (err: Error) => { this.logger.error({ local: 'RabbitmqController.channelError', message: 'RabbitMQ channel error', @@ -136,8 +136,7 @@ export class RabbitmqController extends EventController implements EventControll return; // Already attempting to reconnect } - this.amqpChannel = null; - this.amqpConnection = null; + this.cleanup(); this.scheduleReconnect(); } @@ -406,4 +405,25 @@ export class RabbitmqController extends EventController implements EventControll } } } -} \ No newline at end of file + + public async cleanup(): Promise { + try { + if (this.amqpChannel) { + await this.amqpChannel.close(); + this.amqpChannel = null; + } + if (this.amqpConnection) { + await this.amqpConnection.close(); + this.amqpConnection = null; + } + } catch (error) { + this.logger.warn({ + local: 'RabbitmqController.cleanup', + message: 'Error during cleanup', + error: error.message || error, + }); + this.amqpChannel = null; + this.amqpConnection = null; + } + } +} From 57b19d85d575bf4bc44018058a320b04c0cacf33 Mon Sep 17 00:00:00 2001 From: nestordavalos Date: Thu, 28 Aug 2025 00:17:15 -0300 Subject: [PATCH 030/129] feat(whatsapp): Convert outgoing images to JPEG before sending All images sent via the Baileys integration are now pre-processed and converted to JPEG format using the `sharp` library. This ensures better compatibility and prevents potential issues with unsupported formats. - Images from URLs are now downloaded via axios before processing, which allows for the use of a proxy. - The default filename and mimetype are updated to `image.jpg` and `image/jpeg` to reflect the conversion. --- .../whatsapp/whatsapp.baileys.service.ts | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index c036a281..c70ab6f6 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -2448,9 +2448,43 @@ export class BaileysStartupService extends ChannelStartupService { try { const type = mediaMessage.mediatype === 'ptv' ? 'video' : mediaMessage.mediatype; + let mediaInput: any; + if (mediaMessage.mediatype === 'image') { + let imageBuffer: Buffer; + if (isURL(mediaMessage.media)) { + let config: any = { responseType: 'arraybuffer' }; + + if (this.localProxy?.enabled) { + config = { + ...config, + httpsAgent: makeProxyAgent({ + host: this.localProxy.host, + port: this.localProxy.port, + protocol: this.localProxy.protocol, + username: this.localProxy.username, + password: this.localProxy.password, + }), + }; + } + + const response = await axios.get(mediaMessage.media, config); + imageBuffer = Buffer.from(response.data, 'binary'); + } else { + imageBuffer = Buffer.from(mediaMessage.media, 'base64'); + } + + mediaInput = await sharp(imageBuffer).jpeg().toBuffer(); + mediaMessage.fileName ??= 'image.jpg'; + mediaMessage.mimetype = 'image/jpeg'; + } else { + mediaInput = isURL(mediaMessage.media) + ? { url: mediaMessage.media } + : Buffer.from(mediaMessage.media, 'base64'); + } + const prepareMedia = await prepareWAMessageMedia( { - [type]: isURL(mediaMessage.media) ? { url: mediaMessage.media } : Buffer.from(mediaMessage.media, 'base64'), + [type]: mediaInput, } as any, { upload: this.client.waUploadToServer }, ); @@ -2464,7 +2498,7 @@ export class BaileysStartupService extends ChannelStartupService { } if (mediaMessage.mediatype === 'image' && !mediaMessage.fileName) { - mediaMessage.fileName = 'image.png'; + mediaMessage.fileName = 'image.jpg'; } if (mediaMessage.mediatype === 'video' && !mediaMessage.fileName) { From 00ba227e153b4559739122ef7ce0e294f43e7b7e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 1 Sep 2025 10:43:03 -0300 Subject: [PATCH 031/129] chore: update baileys dependency to version 6.7.19 --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e81cc53..fd6942a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4986,8 +4986,8 @@ } }, "node_modules/baileys": { - "version": "6.7.18", - "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#b7876da2e5d8d4d4b391e215b48b668517b86f3e", + "version": "6.7.19", + "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#9e04cce8d3eeb16025283a57849cc83aa26c6dd1", "hasInstallScript": true, "license": "MIT", "dependencies": { From cca929e7fc8f2b916dc0a4a9f2f4d677598fb450 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Mon, 1 Sep 2025 19:18:55 -0300 Subject: [PATCH 032/129] feat/add global SQS mode with single-queue-per-event and payload size control --- .env.example | 30 +++ .../integrations/event/sqs/sqs.controller.ts | 204 +++++++++++------- src/config/env.config.ts | 66 ++++++ 3 files changed, 221 insertions(+), 79 deletions(-) diff --git a/.env.example b/.env.example index 679d15f6..3a863279 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ +SERVER_NAME=evolution SERVER_TYPE=http SERVER_PORT=8080 # Server URL - Set your application url @@ -96,6 +97,35 @@ SQS_SECRET_ACCESS_KEY= SQS_ACCOUNT_ID= SQS_REGION= +SQS_GLOBAL_ENABLED=false +SQS_GLOBAL_APPLICATION_STARTUP=false +SQS_GLOBAL_CALL=false +SQS_GLOBAL_CHATS_DELETE=false +SQS_GLOBAL_CHATS_SET=false +SQS_GLOBAL_CHATS_UPDATE=false +SQS_GLOBAL_CHATS_UPSERT=false +SQS_GLOBAL_CONNECTION_UPDATE=false +SQS_GLOBAL_CONTACTS_SET=false +SQS_GLOBAL_CONTACTS_UPDATE=false +SQS_GLOBAL_CONTACTS_UPSERT=false +SQS_GLOBAL_GROUP_PARTICIPANTS_UPDATE=false +SQS_GLOBAL_GROUP_UPDATE=false +SQS_GLOBAL_GROUPS_UPSERT=false +SQS_GLOBAL_LABELS_ASSOCIATION=false +SQS_GLOBAL_LABELS_EDIT=false +SQS_GLOBAL_LOGOUT_INSTANCE=false +SQS_GLOBAL_MESSAGES_DELETE=false +SQS_GLOBAL_MESSAGES_EDITED=false +SQS_GLOBAL_MESSAGES_SET=false +SQS_GLOBAL_MESSAGES_UPDATE=false +SQS_GLOBAL_MESSAGES_UPSERT=false +SQS_GLOBAL_PRESENCE_UPDATE=false +SQS_GLOBAL_QRCODE_UPDATED=false +SQS_GLOBAL_REMOVE_INSTANCE=false +SQS_GLOBAL_SEND_MESSAGE=false +SQS_GLOBAL_TYPEBOT_CHANGE_STATUS=false +SQS_GLOBAL_TYPEBOT_START=false + # Websocket - Environment variables WEBSOCKET_ENABLED=false WEBSOCKET_GLOBAL_EVENTS=false diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index 05bf618b..d570d33c 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -1,7 +1,8 @@ +import * as s3Service from '@api/integrations/storage/s3/libs/minio.server'; import { PrismaRepository } from '@api/repository/repository.service'; import { WAMonitoringService } from '@api/services/monitor.service'; import { CreateQueueCommand, DeleteQueueCommand, ListQueuesCommand, SQS } from '@aws-sdk/client-sqs'; -import { configService, Log, Sqs } from '@config/env.config'; +import { configService, HttpServer, Log, S3, Sqs } from '@config/env.config'; import { Logger } from '@config/logger.config'; import { EmitData, EventController, EventControllerInterface } from '../event.controller'; @@ -15,27 +16,29 @@ export class SqsController extends EventController implements EventControllerInt super(prismaRepository, waMonitor, configService.get('SQS')?.ENABLED, 'sqs'); } - public init(): void { + public async init(): Promise { if (!this.status) { return; } - new Promise((resolve) => { - const awsConfig = configService.get('SQS'); + const awsConfig = configService.get('SQS'); - this.sqs = new SQS({ - credentials: { - accessKeyId: awsConfig.ACCESS_KEY_ID, - secretAccessKey: awsConfig.SECRET_ACCESS_KEY, - }, + this.sqs = new SQS({ + credentials: { + accessKeyId: awsConfig.ACCESS_KEY_ID, + secretAccessKey: awsConfig.SECRET_ACCESS_KEY, + }, - region: awsConfig.REGION, - }); - - this.logger.info('SQS initialized'); - - resolve(); + region: awsConfig.REGION, }); + + this.logger.info('SQS initialized'); + + const sqsConfig = configService.get('SQS'); + if (this.sqs && sqsConfig.GLOBAL_ENABLED) { + const sqsEvents = Object.keys(sqsConfig.EVENTS).filter((e) => sqsConfig.EVENTS[e]); + await this.saveQueues(sqsConfig.GLOBAL_PREFIX_NAME, sqsEvents, true); + } } private set channel(sqs: SQS) { @@ -47,7 +50,7 @@ export class SqsController extends EventController implements EventControllerInt } override async set(instanceName: string, data: EventDto): Promise { - if (!this.status) { + if (!this.status || configService.get('SQS').GLOBAL_ENABLED) { return; } @@ -75,6 +78,7 @@ export class SqsController extends EventController implements EventControllerInt instanceId: this.monitor.waInstances[instanceName].instanceId, }, }; + console.log('*** payload: ', payload); return this.prisma[this.name].upsert(payload); } @@ -98,66 +102,104 @@ export class SqsController extends EventController implements EventControllerInt return; } - const instanceSqs = await this.get(instanceName); - const sqsLocal = instanceSqs?.events; - const we = event.replace(/[.-]/gm, '_').toUpperCase(); + if (this.sqs) { + const sqsConfig = configService.get('SQS'); - if (instanceSqs?.enabled) { - if (this.sqs) { - if (Array.isArray(sqsLocal) && sqsLocal.includes(we)) { - const eventFormatted = `${event.replace('.', '_').toLowerCase()}`; - const queueName = `${instanceName}_${eventFormatted}.fifo`; - const sqsConfig = configService.get('SQS'); - const sqsUrl = `https://sqs.${sqsConfig.REGION}.amazonaws.com/${sqsConfig.ACCOUNT_ID}/${queueName}`; + const we = event.replace(/[.-]/gm, '_').toUpperCase(); - const message = { - event, - instance: instanceName, - data, - server_url: serverUrl, - date_time: dateTime, - sender, - apikey: apiKey, - }; - - const params = { - MessageBody: JSON.stringify(message), - MessageGroupId: 'evolution', - MessageDeduplicationId: `${instanceName}_${eventFormatted}_${Date.now()}`, - QueueUrl: sqsUrl, - }; - - this.sqs.sendMessage(params, (err) => { - if (err) { - this.logger.error({ - local: `${origin}.sendData-SQS`, - message: err?.message, - hostName: err?.hostname, - code: err?.code, - stack: err?.stack, - name: err?.name, - url: queueName, - server_url: serverUrl, - }); - } else { - if (configService.get('LOG').LEVEL.includes('WEBHOOKS')) { - const logData = { - local: `${origin}.sendData-SQS`, - ...message, - }; - - this.logger.log(logData); - } - } - }); + let sqsEvents = []; + if (sqsConfig.GLOBAL_ENABLED) { + sqsEvents = Object.keys(sqsConfig.EVENTS).filter((e) => sqsConfig.EVENTS[e]); + } else { + const instanceSqs = await this.get(instanceName); + if (instanceSqs?.enabled && Array.isArray(instanceSqs?.events)) { + sqsEvents = instanceSqs?.events; } } + + if (Array.isArray(sqsEvents) && sqsEvents.includes(we)) { + const eventFormatted = `${event.replace('.', '_').toLowerCase()}`; + const prefixName = sqsConfig.GLOBAL_ENABLED ? sqsConfig.GLOBAL_PREFIX_NAME : instanceName; + const queueName = `${prefixName}_${eventFormatted}.fifo`; + + const sqsUrl = `https://sqs.${sqsConfig.REGION}.amazonaws.com/${sqsConfig.ACCOUNT_ID}/${queueName}`; + + const message = { + event, + instance: instanceName, + dataType: 'json', + data, + server: configService.get('SERVER').NAME, + server_url: serverUrl, + date_time: dateTime, + sender, + apikey: apiKey, + }; + + const jsonStr = JSON.stringify(message); + const size = Buffer.byteLength(jsonStr, 'utf8'); + if (size > sqsConfig.MAX_PAYLOAD_SIZE) { + if (!configService.get('S3').ENABLE) { + this.logger.error( + `${instanceName} - ${eventFormatted} - SQS ignored: payload (${size} bytes) exceeds SQS size limit (${sqsConfig.MAX_PAYLOAD_SIZE} bytes) and S3 storage is not enabled.`, + ); + return; + } + + const buffer = Buffer.from(jsonStr, 'utf8'); + const fullName = `messages/${instanceName}_${eventFormatted}_${Date.now()}.json`; + + await s3Service.uploadFile(fullName, buffer, size, { + 'Content-Type': 'application/json', + 'Cache-Control': 'no-store', + }); + + const fileUrl = await s3Service.getObjectUrl(fullName); + + message.data = { fileUrl }; + message.dataType = 's3'; + } + + const isGlobalEnabled = configService.get('SQS').GLOBAL_ENABLED; + const params = { + MessageBody: JSON.stringify(message), + MessageGroupId: 'evolution', + QueueUrl: sqsUrl, + ...(!isGlobalEnabled && { + MessageDeduplicationId: `${instanceName}_${eventFormatted}_${Date.now()}`, + }), + }; + + this.sqs.sendMessage(params, (err) => { + if (err) { + this.logger.error({ + local: `${origin}.sendData-SQS`, + params: JSON.stringify(message), + sqsUrl: sqsUrl, + message: err?.message, + hostName: err?.hostname, + code: err?.code, + stack: err?.stack, + name: err?.name, + url: queueName, + server_url: serverUrl, + }); + } else if (configService.get('LOG').LEVEL.includes('WEBHOOKS')) { + const logData = { + local: `${origin}.sendData-SQS`, + ...message, + }; + + this.logger.log(logData); + } + }); + } } } - private async saveQueues(instanceName: string, events: string[], enable: boolean) { + private async saveQueues(prefixName: string, events: string[], enable: boolean) { if (enable) { - const eventsFinded = await this.listQueuesByInstance(instanceName); + const eventsFinded = await this.listQueues(prefixName); console.log('eventsFinded', eventsFinded); for (const event of events) { @@ -168,15 +210,17 @@ export class SqsController extends EventController implements EventControllerInt continue; } - const queueName = `${instanceName}_${normalizedEvent}.fifo`; - + const queueName = `${prefixName}_${normalizedEvent}.fifo`; try { + const isGlobalEnabled = configService.get('SQS').GLOBAL_ENABLED; const createCommand = new CreateQueueCommand({ QueueName: queueName, Attributes: { FifoQueue: 'true', + ...(isGlobalEnabled && { ContentBasedDeduplication: 'true' }), }, }); + const data = await this.sqs.send(createCommand); this.logger.info(`Queue ${queueName} criada: ${data.QueueUrl}`); } catch (err: any) { @@ -186,12 +230,14 @@ export class SqsController extends EventController implements EventControllerInt } } - private async listQueuesByInstance(instanceName: string) { + private async listQueues(prefixName: string) { let existingQueues: string[] = []; + try { const listCommand = new ListQueuesCommand({ - QueueNamePrefix: `${instanceName}_`, + QueueNamePrefix: `${prefixName}_`, }); + const listData = await this.sqs.send(listCommand); if (listData.QueueUrls && listData.QueueUrls.length > 0) { // Extrai o nome da fila a partir da URL @@ -201,7 +247,7 @@ export class SqsController extends EventController implements EventControllerInt }); } } catch (error: any) { - this.logger.error(`Erro ao listar filas para a instância ${instanceName}: ${error.message}`); + this.logger.error(`Erro ao listar filas para ${prefixName}: ${error.message}`); return; } @@ -209,8 +255,8 @@ export class SqsController extends EventController implements EventControllerInt return existingQueues .map((queueName) => { // Espera-se que o nome seja `${instanceName}_${event}.fifo` - if (queueName.startsWith(`${instanceName}_`) && queueName.endsWith('.fifo')) { - return queueName.substring(instanceName.length + 1, queueName.length - 5).toLowerCase(); + if (queueName.startsWith(`${prefixName}_`) && queueName.endsWith('.fifo')) { + return queueName.substring(prefixName.length + 1, queueName.length - 5).toLowerCase(); } return ''; }) @@ -218,15 +264,15 @@ export class SqsController extends EventController implements EventControllerInt } // Para uma futura feature de exclusão forçada das queues - private async removeQueuesByInstance(instanceName: string) { + private async removeQueuesByInstance(prefixName: string) { try { const listCommand = new ListQueuesCommand({ - QueueNamePrefix: `${instanceName}_`, + QueueNamePrefix: `${prefixName}_`, }); const listData = await this.sqs.send(listCommand); if (!listData.QueueUrls || listData.QueueUrls.length === 0) { - this.logger.info(`No queues found for instance ${instanceName}`); + this.logger.info(`No queues found for ${prefixName}`); return; } @@ -240,7 +286,7 @@ export class SqsController extends EventController implements EventControllerInt } } } catch (err: any) { - this.logger.error(`Error listing queues for instance ${instanceName}: ${err.message}`); + this.logger.error(`Error listing queues for ${prefixName}: ${err.message}`); } } } diff --git a/src/config/env.config.ts b/src/config/env.config.ts index c59acd38..dcf2a0ea 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -4,6 +4,7 @@ import dotenv from 'dotenv'; dotenv.config(); export type HttpServer = { + NAME: string; TYPE: 'http' | 'https'; PORT: number; URL: string; @@ -113,10 +114,42 @@ export type Nats = { export type Sqs = { ENABLED: boolean; + GLOBAL_ENABLED: boolean; + GLOBAL_PREFIX_NAME: string; ACCESS_KEY_ID: string; SECRET_ACCESS_KEY: string; ACCOUNT_ID: string; REGION: string; + MAX_PAYLOAD_SIZE: number; + EVENTS: { + APPLICATION_STARTUP: boolean; + CALL: boolean; + CHATS_DELETE: boolean; + CHATS_SET: boolean; + CHATS_UPDATE: boolean; + CHATS_UPSERT: boolean; + CONNECTION_UPDATE: boolean; + CONTACTS_SET: boolean; + CONTACTS_UPDATE: boolean; + CONTACTS_UPSERT: boolean; + GROUP_PARTICIPANTS_UPDATE: boolean; + GROUP_UPDATE: boolean; + GROUPS_UPSERT: boolean; + LABELS_ASSOCIATION: boolean; + LABELS_EDIT: boolean; + LOGOUT_INSTANCE: boolean; + MESSAGES_DELETE: boolean; + MESSAGES_EDITED: boolean; + MESSAGES_SET: boolean; + MESSAGES_UPDATE: boolean; + MESSAGES_UPSERT: boolean; + PRESENCE_UPDATE: boolean; + QRCODE_UPDATED: boolean; + REMOVE_INSTANCE: boolean; + SEND_MESSAGE: boolean; + TYPEBOT_CHANGE_STATUS: boolean; + TYPEBOT_START: boolean; + }; }; export type Websocket = { @@ -344,6 +377,7 @@ export class ConfigService { private envProcess(): Env { return { SERVER: { + NAME: process.env?.SERVER_NAME || 'evolution', TYPE: (process.env.SERVER_TYPE as 'http' | 'https') || 'http', PORT: Number.parseInt(process.env.SERVER_PORT) || 8080, URL: process.env.SERVER_URL, @@ -465,10 +499,42 @@ export class ConfigService { }, SQS: { ENABLED: process.env?.SQS_ENABLED === 'true', + GLOBAL_ENABLED: process.env?.SQS_GLOBAL_ENABLED === 'true', + GLOBAL_PREFIX_NAME: process.env?.SQS_GLOBAL_PREFIX_NAME || 'global', ACCESS_KEY_ID: process.env.SQS_ACCESS_KEY_ID || '', SECRET_ACCESS_KEY: process.env.SQS_SECRET_ACCESS_KEY || '', ACCOUNT_ID: process.env.SQS_ACCOUNT_ID || '', REGION: process.env.SQS_REGION || '', + MAX_PAYLOAD_SIZE: Number.parseInt(process.env.SQS_MAX_PAYLOAD_SIZE ?? '1048576'), + EVENTS: { + APPLICATION_STARTUP: process.env?.SQS_GLOBAL_APPLICATION_STARTUP === 'true', + CALL: process.env?.SQS_GLOBAL_CALL === 'true', + CHATS_DELETE: process.env?.SQS_GLOBAL_CHATS_DELETE === 'true', + CHATS_SET: process.env?.SQS_GLOBAL_CHATS_SET === 'true', + CHATS_UPDATE: process.env?.SQS_GLOBAL_CHATS_UPDATE === 'true', + CHATS_UPSERT: process.env?.SQS_GLOBAL_CHATS_UPSERT === 'true', + CONNECTION_UPDATE: process.env?.SQS_GLOBAL_CONNECTION_UPDATE === 'true', + CONTACTS_SET: process.env?.SQS_GLOBAL_CONTACTS_SET === 'true', + CONTACTS_UPDATE: process.env?.SQS_GLOBAL_CONTACTS_UPDATE === 'true', + CONTACTS_UPSERT: process.env?.SQS_GLOBAL_CONTACTS_UPSERT === 'true', + GROUP_PARTICIPANTS_UPDATE: process.env?.SQS_GLOBAL_GROUP_PARTICIPANTS_UPDATE === 'true', + GROUP_UPDATE: process.env?.SQS_GLOBAL_GROUP_UPDATE === 'true', + GROUPS_UPSERT: process.env?.SQS_GLOBAL_GROUPS_UPSERT === 'true', + LABELS_ASSOCIATION: process.env?.SQS_GLOBAL_LABELS_ASSOCIATION === 'true', + LABELS_EDIT: process.env?.SQS_GLOBAL_LABELS_EDIT === 'true', + LOGOUT_INSTANCE: process.env?.SQS_GLOBAL_LOGOUT_INSTANCE === 'true', + MESSAGES_DELETE: process.env?.SQS_GLOBAL_MESSAGES_DELETE === 'true', + MESSAGES_EDITED: process.env?.SQS_GLOBAL_MESSAGES_EDITED === 'true', + MESSAGES_SET: process.env?.SQS_GLOBAL_MESSAGES_SET === 'true', + MESSAGES_UPDATE: process.env?.SQS_GLOBAL_MESSAGES_UPDATE === 'true', + MESSAGES_UPSERT: process.env?.SQS_GLOBAL_MESSAGES_UPSERT === 'true', + PRESENCE_UPDATE: process.env?.SQS_GLOBAL_PRESENCE_UPDATE === 'true', + QRCODE_UPDATED: process.env?.SQS_GLOBAL_QRCODE_UPDATED === 'true', + REMOVE_INSTANCE: process.env?.SQS_GLOBAL_REMOVE_INSTANCE === 'true', + SEND_MESSAGE: process.env?.SQS_GLOBAL_SEND_MESSAGE === 'true', + TYPEBOT_CHANGE_STATUS: process.env?.SQS_GLOBAL_TYPEBOT_CHANGE_STATUS === 'true', + TYPEBOT_START: process.env?.SQS_GLOBAL_TYPEBOT_START === 'true' + }, }, WEBSOCKET: { ENABLED: process.env?.WEBSOCKET_ENABLED === 'true', From 293f655274e63a066dc8a6b136fd0e9760ef26b8 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Mon, 1 Sep 2025 19:41:56 -0300 Subject: [PATCH 033/129] feat/validate video type before uploading to S3 --- .../channel/meta/whatsapp.business.service.ts | 9 ++++-- .../whatsapp/whatsapp.baileys.service.ts | 32 +++++++++++++------ src/config/env.config.ts | 2 ++ src/utils/getConversationMessage.ts | 22 +++++++------ 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index d3c35bee..39edeb09 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -459,6 +459,10 @@ export class BusinessStartupService extends ChannelStartupService { mediaType = 'video'; } + if (mediaType == 'video' && !this.configService.get('S3').SAVE_VIDEO) { + throw new Error('Video upload is disabled.'); + } + const mimetype = result.data?.mime_type || result.headers['content-type']; const contentDisposition = result.headers['content-disposition']; @@ -1205,9 +1209,8 @@ export class BusinessStartupService extends ChannelStartupService { const token = this.token; const headers = { Authorization: `Bearer ${token}` }; - const url = `${this.configService.get('WA_BUSINESS').URL}/${ - this.configService.get('WA_BUSINESS').VERSION - }/${this.number}/media`; + const url = `${this.configService.get('WA_BUSINESS').URL}/${this.configService.get('WA_BUSINESS').VERSION + }/${this.number}/media`; const res = await axios.post(url, formData, { headers }); return res.data.id; diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 758a5bf9..edd3afcc 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -368,7 +368,7 @@ export class BaileysStartupService extends ChannelStartupService { qrcodeTerminal.generate(qr, { small: true }, (qrcode) => this.logger.log( `\n{ instance: ${this.instance.name} pairingCode: ${this.instance.qrcode.pairingCode}, qrcodeCount: ${this.instance.qrcode.count} }\n` + - qrcode, + qrcode, ), ); @@ -961,16 +961,16 @@ export class BaileysStartupService extends ChannelStartupService { const messagesRepository: Set = new Set( chatwootImport.getRepositoryMessagesCache(instance) ?? - ( - await this.prismaRepository.message.findMany({ - select: { key: true }, - where: { instanceId: this.instanceId }, - }) - ).map((message) => { - const key = message.key as { id: string }; + ( + await this.prismaRepository.message.findMany({ + select: { key: true }, + where: { instanceId: this.instanceId }, + }) + ).map((message) => { + const key = message.key as { id: string }; - return key.id; - }), + return key.id; + }), ); if (chatwootImport.getRepositoryMessagesCache(instance) === null) { @@ -1188,6 +1188,8 @@ export class BaileysStartupService extends ChannelStartupService { received?.message?.ptvMessage || received?.message?.audioMessage; + const isVideo = received?.message?.videoMessage; + if (this.localSettings.readMessages && received.key.id !== 'status@broadcast') { await this.client.readMessages([received.key]); } @@ -1258,6 +1260,10 @@ export class BaileysStartupService extends ChannelStartupService { if (isMedia) { if (this.configService.get('S3').ENABLE) { try { + if (isVideo && !this.configService.get('S3').SAVE_VIDEO) { + throw new Error('Video upload is disabled.'); + } + const message: any = received; // Verificação adicional para garantir que há conteúdo de mídia real @@ -2143,6 +2149,8 @@ export class BaileysStartupService extends ChannelStartupService { messageSent?.message?.ptvMessage || messageSent?.message?.audioMessage; + const isVideo = messageSent?.message?.videoMessage; + if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled && !isIntegration) { this.chatwootService.eventWhatsapp( Events.SEND_MESSAGE, @@ -2167,6 +2175,10 @@ export class BaileysStartupService extends ChannelStartupService { if (isMedia && this.configService.get('S3').ENABLE) { try { + if (isVideo && !this.configService.get('S3').SAVE_VIDEO) { + throw new Error('Video upload is disabled.'); + } + const message: any = messageRaw; // Verificação adicional para garantir que há conteúdo de mídia real diff --git a/src/config/env.config.ts b/src/config/env.config.ts index c59acd38..9ef80dc1 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -282,6 +282,7 @@ export type S3 = { USE_SSL?: boolean; REGION?: string; SKIP_POLICY?: boolean; + SAVE_VIDEO: boolean; }; export type CacheConf = { REDIS: CacheConfRedis; LOCAL: CacheConfLocal }; @@ -653,6 +654,7 @@ export class ConfigService { USE_SSL: process.env?.S3_USE_SSL === 'true', REGION: process.env?.S3_REGION, SKIP_POLICY: process.env?.S3_SKIP_POLICY === 'true', + SAVE_VIDEO: process.env?.S3_SAVE_VIDEO === 'true', }, AUTHENTICATION: { API_KEY: { diff --git a/src/utils/getConversationMessage.ts b/src/utils/getConversationMessage.ts index a7650968..a34695e7 100644 --- a/src/utils/getConversationMessage.ts +++ b/src/utils/getConversationMessage.ts @@ -3,7 +3,13 @@ import { configService, S3 } from '@config/env.config'; const getTypeMessage = (msg: any) => { let mediaId: string; - if (configService.get('S3').ENABLE) mediaId = msg.message?.mediaUrl; + if ( + configService.get('S3').ENABLE && + (configService.get('S3').SAVE_VIDEO || + (msg?.message?.videoMessage === undefined && + msg?.message?.viewOnceMessageV2?.message?.videoMessage === undefined)) + ) + mediaId = msg.message?.mediaUrl; else mediaId = msg.key?.id; const types = { @@ -32,16 +38,14 @@ const getTypeMessage = (msg: any) => { ? `videoMessage|${mediaId}${msg?.message?.videoMessage?.caption ? `|${msg?.message?.videoMessage?.caption}` : ''}` : undefined, documentMessage: msg?.message?.documentMessage - ? `documentMessage|${mediaId}${ - msg?.message?.documentMessage?.caption ? `|${msg?.message?.documentMessage?.caption}` : '' - }` + ? `documentMessage|${mediaId}${msg?.message?.documentMessage?.caption ? `|${msg?.message?.documentMessage?.caption}` : '' + }` : undefined, documentWithCaptionMessage: msg?.message?.documentWithCaptionMessage?.message?.documentMessage - ? `documentWithCaptionMessage|${mediaId}${ - msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption - ? `|${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption}` - : '' - }` + ? `documentWithCaptionMessage|${mediaId}${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption + ? `|${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption}` + : '' + }` : undefined, externalAdReplyBody: msg?.contextInfo?.externalAdReply?.body ? `externalAdReplyBody|${msg.contextInfo.externalAdReply.body}` From e48e878b4f56b9dd562edaded30739d032e3edf4 Mon Sep 17 00:00:00 2001 From: nolramaf <30306355+nolramaf@users.noreply.github.com> Date: Mon, 1 Sep 2025 19:49:55 -0300 Subject: [PATCH 034/129] Update src/api/integrations/channel/meta/whatsapp.business.service.ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .../integrations/channel/meta/whatsapp.business.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index 39edeb09..0b76b87a 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -460,7 +460,11 @@ export class BusinessStartupService extends ChannelStartupService { } if (mediaType == 'video' && !this.configService.get('S3').SAVE_VIDEO) { - throw new Error('Video upload is disabled.'); + this.logger?.info?.('Video upload attempted but is disabled by configuration.'); + return { + success: false, + message: 'Video upload is currently disabled. Please contact support if you need this feature enabled.', + }; } const mimetype = result.data?.mime_type || result.headers['content-type']; From 9beb38d807a6487ea5ce7ef96ab4ad2f4f7d478a Mon Sep 17 00:00:00 2001 From: nolramaf <30306355+nolramaf@users.noreply.github.com> Date: Mon, 1 Sep 2025 19:50:01 -0300 Subject: [PATCH 035/129] Update src/config/env.config.ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- src/config/env.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 9ef80dc1..2ceaa6b3 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -282,7 +282,7 @@ export type S3 = { USE_SSL?: boolean; REGION?: string; SKIP_POLICY?: boolean; - SAVE_VIDEO: boolean; + SAVE_VIDEO?: boolean; }; export type CacheConf = { REDIS: CacheConfRedis; LOCAL: CacheConfLocal }; From 9ab6f9ad765ad5ab5506949fc056fa863f5fec13 Mon Sep 17 00:00:00 2001 From: nolramaf <30306355+nolramaf@users.noreply.github.com> Date: Mon, 1 Sep 2025 19:50:08 -0300 Subject: [PATCH 036/129] Update src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index edd3afcc..0dc2471f 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1261,7 +1261,9 @@ export class BaileysStartupService extends ChannelStartupService { if (this.configService.get('S3').ENABLE) { try { if (isVideo && !this.configService.get('S3').SAVE_VIDEO) { - throw new Error('Video upload is disabled.'); + this.logger.warn('Video upload is disabled. Skipping video upload.'); + // Skip video upload by returning early from this block + return; } const message: any = received; From b8953f1431c18d0d6686c74b3bf6dd9f3f47333c Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 2 Sep 2025 10:53:00 -0300 Subject: [PATCH 037/129] chore: update CHANGELOG for version 2.3.2 - Added support for socks proxy. - Included key id in webhook payload for n8n service. - Enhanced RabbitMQ controller with improved connection management and shutdown procedures. - Converted outgoing images to JPEG format before sending with Chatwoot. - Updated baileys dependency to version 6.7.19. --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 383282ce..b8f25542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,17 @@ -# 2.3.1 (develop) +# 2.3.2 (2025-09-02) + +### Features + +* Add support to socks proxy + +### Fixed + +* Added key id into webhook payload in n8n service +* Enhance RabbitMQ controller with improved connection management and shutdown procedures +* Convert outgoing images to JPEG before sending with Chatwoot +* Update baileys dependency to version 6.7.19 + +# 2.3.1 (2025-07-29) ### Feature From 2513f961787644b8332e8e2afdd82c4580662872 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 2 Sep 2025 13:33:34 -0300 Subject: [PATCH 038/129] chore: bump version to 2.3.2 in package.json and package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd6942a6..70cfbaf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "evolution-api", - "version": "2.3.1", + "version": "2.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "evolution-api", - "version": "2.3.1", + "version": "2.3.2", "license": "Apache-2.0", "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", diff --git a/package.json b/package.json index 107cca49..e91d1ea7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "2.3.1", + "version": "2.3.2", "description": "Rest api for communication with WhatsApp", "main": "./dist/main.js", "type": "commonjs", From 23cd6d2fd8361de6dea8ceefcc5f69cb59fe8557 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Tue, 2 Sep 2025 17:44:44 -0300 Subject: [PATCH 039/129] feat/force to save all evolution events in a single SQS queue --- .env.example | 1 + .../integrations/event/sqs/sqs.controller.ts | 18 ++++++++++++++---- src/config/env.config.ts | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 3a863279..882486f2 100644 --- a/.env.example +++ b/.env.example @@ -98,6 +98,7 @@ SQS_ACCOUNT_ID= SQS_REGION= SQS_GLOBAL_ENABLED=false +SQS_GLOBAL_FORCE_SINGLE_QUEUE=false SQS_GLOBAL_APPLICATION_STARTUP=false SQS_GLOBAL_CALL=false SQS_GLOBAL_CHATS_DELETE=false diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index d570d33c..5454d64f 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -118,8 +118,11 @@ export class SqsController extends EventController implements EventControllerInt } if (Array.isArray(sqsEvents) && sqsEvents.includes(we)) { - const eventFormatted = `${event.replace('.', '_').toLowerCase()}`; const prefixName = sqsConfig.GLOBAL_ENABLED ? sqsConfig.GLOBAL_PREFIX_NAME : instanceName; + const eventFormatted = + sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE + ? 'singlequeue' + : `${event.replace('.', '_').toLowerCase()}`; const queueName = `${prefixName}_${eventFormatted}.fifo`; const sqsUrl = `https://sqs.${sqsConfig.REGION}.amazonaws.com/${sqsConfig.ACCOUNT_ID}/${queueName}`; @@ -199,12 +202,15 @@ export class SqsController extends EventController implements EventControllerInt private async saveQueues(prefixName: string, events: string[], enable: boolean) { if (enable) { + const sqsConfig = configService.get('SQS'); const eventsFinded = await this.listQueues(prefixName); console.log('eventsFinded', eventsFinded); for (const event of events) { - const normalizedEvent = event.toLowerCase(); - + const normalizedEvent = + sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE + ? 'singlequeue' + : event.toLowerCase(); if (eventsFinded.includes(normalizedEvent)) { this.logger.info(`A queue para o evento "${normalizedEvent}" já existe. Ignorando criação.`); continue; @@ -212,7 +218,7 @@ export class SqsController extends EventController implements EventControllerInt const queueName = `${prefixName}_${normalizedEvent}.fifo`; try { - const isGlobalEnabled = configService.get('SQS').GLOBAL_ENABLED; + const isGlobalEnabled = sqsConfig.GLOBAL_ENABLED; const createCommand = new CreateQueueCommand({ QueueName: queueName, Attributes: { @@ -226,6 +232,10 @@ export class SqsController extends EventController implements EventControllerInt } catch (err: any) { this.logger.error(`Erro ao criar queue ${queueName}: ${err.message}`); } + + if (sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE) { + break; + } } } } diff --git a/src/config/env.config.ts b/src/config/env.config.ts index dcf2a0ea..809803d4 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -115,6 +115,7 @@ export type Nats = { export type Sqs = { ENABLED: boolean; GLOBAL_ENABLED: boolean; + GLOBAL_FORCE_SINGLE_QUEUE: boolean; GLOBAL_PREFIX_NAME: string; ACCESS_KEY_ID: string; SECRET_ACCESS_KEY: string; @@ -500,6 +501,7 @@ export class ConfigService { SQS: { ENABLED: process.env?.SQS_ENABLED === 'true', GLOBAL_ENABLED: process.env?.SQS_GLOBAL_ENABLED === 'true', + GLOBAL_FORCE_SINGLE_QUEUE: process.env?.SQS_GLOBAL_FORCE_SINGLE_QUEUE === 'true', GLOBAL_PREFIX_NAME: process.env?.SQS_GLOBAL_PREFIX_NAME || 'global', ACCESS_KEY_ID: process.env.SQS_ACCESS_KEY_ID || '', SECRET_ACCESS_KEY: process.env.SQS_SECRET_ACCESS_KEY || '', From 17120e91a4699e884c507b227630fc808b731da7 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Wed, 3 Sep 2025 05:57:18 -0300 Subject: [PATCH 040/129] feat/force MessageGroupId --- src/api/integrations/event/sqs/sqs.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index 5454d64f..49ffa64f 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -118,13 +118,13 @@ export class SqsController extends EventController implements EventControllerInt } if (Array.isArray(sqsEvents) && sqsEvents.includes(we)) { + const serverName = sqsConfig.GLOBAL_ENABLED ? configService.get('SERVER').NAME : 'evolution'; const prefixName = sqsConfig.GLOBAL_ENABLED ? sqsConfig.GLOBAL_PREFIX_NAME : instanceName; const eventFormatted = sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE ? 'singlequeue' : `${event.replace('.', '_').toLowerCase()}`; const queueName = `${prefixName}_${eventFormatted}.fifo`; - const sqsUrl = `https://sqs.${sqsConfig.REGION}.amazonaws.com/${sqsConfig.ACCOUNT_ID}/${queueName}`; const message = { @@ -132,7 +132,7 @@ export class SqsController extends EventController implements EventControllerInt instance: instanceName, dataType: 'json', data, - server: configService.get('SERVER').NAME, + server: serverName, server_url: serverUrl, date_time: dateTime, sender, @@ -166,7 +166,7 @@ export class SqsController extends EventController implements EventControllerInt const isGlobalEnabled = configService.get('SQS').GLOBAL_ENABLED; const params = { MessageBody: JSON.stringify(message), - MessageGroupId: 'evolution', + MessageGroupId: serverName, QueueUrl: sqsUrl, ...(!isGlobalEnabled && { MessageDeduplicationId: `${instanceName}_${eventFormatted}_${Date.now()}`, From edb4fa3b3e7b77de8b8bf60a175022b280467f23 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Wed, 3 Sep 2025 06:21:24 -0300 Subject: [PATCH 041/129] feat/force MessageGroupId --- src/api/integrations/event/sqs/sqs.controller.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index 49ffa64f..c92b849a 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -103,6 +103,7 @@ export class SqsController extends EventController implements EventControllerInt } if (this.sqs) { + const serverConfig = configService.get('SERVER'); const sqsConfig = configService.get('SQS'); const we = event.replace(/[.-]/gm, '_').toUpperCase(); @@ -118,7 +119,6 @@ export class SqsController extends EventController implements EventControllerInt } if (Array.isArray(sqsEvents) && sqsEvents.includes(we)) { - const serverName = sqsConfig.GLOBAL_ENABLED ? configService.get('SERVER').NAME : 'evolution'; const prefixName = sqsConfig.GLOBAL_ENABLED ? sqsConfig.GLOBAL_PREFIX_NAME : instanceName; const eventFormatted = sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE @@ -132,7 +132,7 @@ export class SqsController extends EventController implements EventControllerInt instance: instanceName, dataType: 'json', data, - server: serverName, + server: serverConfig.NAME, server_url: serverUrl, date_time: dateTime, sender, @@ -163,10 +163,11 @@ export class SqsController extends EventController implements EventControllerInt message.dataType = 's3'; } - const isGlobalEnabled = configService.get('SQS').GLOBAL_ENABLED; + const messageGroupId = sqsConfig.GLOBAL_ENABLED ? `${serverConfig.NAME}-${instanceName}` : 'evolution'; + const isGlobalEnabled = sqsConfig.GLOBAL_ENABLED; const params = { MessageBody: JSON.stringify(message), - MessageGroupId: serverName, + MessageGroupId: messageGroupId, QueueUrl: sqsUrl, ...(!isGlobalEnabled && { MessageDeduplicationId: `${instanceName}_${eventFormatted}_${Date.now()}`, @@ -208,9 +209,7 @@ export class SqsController extends EventController implements EventControllerInt for (const event of events) { const normalizedEvent = - sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE - ? 'singlequeue' - : event.toLowerCase(); + sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE ? 'singlequeue' : event.toLowerCase(); if (eventsFinded.includes(normalizedEvent)) { this.logger.info(`A queue para o evento "${normalizedEvent}" já existe. Ignorando criação.`); continue; From 43cc6d3608180ececbf1910d1e06bed1e22ed43f Mon Sep 17 00:00:00 2001 From: Andres Pache Date: Wed, 3 Sep 2025 12:16:00 -0300 Subject: [PATCH 042/129] check cronId before executing syncChatwootLostMessages --- .../channel/whatsapp/whatsapp.baileys.service.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index c70ab6f6..32ae48fa 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4357,7 +4357,18 @@ export class BaileysStartupService extends ChannelStartupService { const prepare = (message: any) => this.prepareMessage(message); this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare); + // Generate ID for this cron task and store in cache + const cronId = cuid(); + const cronKey = `chatwoot:syncLostMessages`; + await this.chatwootService.getCache()?.hSet(cronKey, this.instance.name, cronId); + const task = cron.schedule('0,30 * * * *', async () => { + // Check ID before executing (only if cache is available) + const cache = this.chatwootService.getCache(); + if (cache) { + const storedId = await cache.hGet(cronKey, this.instance.name); + if (storedId && storedId !== cronId) return; + } this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare); }); task.start(); From 02b81beb7ab017fa2d37d3406eb707d7644989b4 Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Wed, 3 Sep 2025 16:08:15 -0300 Subject: [PATCH 043/129] feat: implement linkPreview support for Evolution Bot - Add linkPreview extraction from webhook/n8n response - Implement linkPreview parameter in textMessage calls - Add debug logging for linkPreview functionality - Support for disabling link previews when linkPreview: false - Add comprehensive documentation for linkPreview feature Usage: - Return { "message": "text", "linkPreview": false } from webhook to disable preview - Return { "message": "text", "linkPreview": true } from webhook to enable preview - Omit linkPreview for default WhatsApp behavior --- evolution-bot-documentation.md | 203 ++++++++++++++++++ evolution-bot-linkpreview-example.md | 147 +++++++++++++ send-text-api-documentation.md | 0 .../services/evolutionBot.service.ts | 29 ++- 4 files changed, 377 insertions(+), 2 deletions(-) create mode 100644 evolution-bot-documentation.md create mode 100644 evolution-bot-linkpreview-example.md create mode 100644 send-text-api-documentation.md diff --git a/evolution-bot-documentation.md b/evolution-bot-documentation.md new file mode 100644 index 00000000..2c65d8f9 --- /dev/null +++ b/evolution-bot-documentation.md @@ -0,0 +1,203 @@ +# Evolution Bot + +O Evolution Bot é uma integração de chatbot universal que permite a utilização de qualquer URL de API ou automação para criar interações automatizadas. Ao utilizar o Evolution Bot, sua API deve retornar a resposta na forma de um JSON contendo o campo `message`, que será enviado de volta ao usuário. Este sistema oferece flexibilidade para construir chatbots que se integram perfeitamente com suas APIs personalizadas. + +## 1. Criação de Bots no Evolution Bot + +Você pode configurar bots no Evolution Bot utilizando triggers para iniciar as interações. A configuração do bot pode ser feita através do endpoint `/evolutionBot/create/{{instance}}`. + +### Endpoint para Criação de Bots + +#### Endpoint + +``` +POST {{baseUrl}}/evolutionBot/create/{{instance}} +``` + +#### Corpo da Requisição + +Aqui está um exemplo de corpo JSON para configurar um bot no Evolution Bot: + +```json +{ + "enabled": true, + "apiUrl": "http://api.site.com/v1", + "apiKey": "app-123456", // optional + // opções + "triggerType": "keyword", /* all ou keyword */ + "triggerOperator": "equals", /* contains, equals, startsWith, endsWith, regex, none */ + "triggerValue": "teste", + "expire": 0, + "keywordFinish": "#SAIR", + "delayMessage": 1000, + "unknownMessage": "Mensagem não reconhecida", + "listeningFromMe": false, + "stopBotFromMe": false, + "keepOpen": false, + "debounceTime": 0, + "ignoreJids": [] +} +``` + +### Explicação dos Parâmetros + +- `enabled`: Ativa (`true`) ou desativa (`false`) o bot. +- `apiUrl`: URL da API que será chamada pelo bot (sem a `/` no final). +- `apiKey`: Chave da API fornecida pela sua aplicação (opcional). + +**Opções:** +- `triggerType`: Tipo de trigger para iniciar o bot (`all` ou `keyword`). +- `triggerOperator`: Operador utilizado para avaliar o trigger (`contains`, `equals`, `startsWith`, `endsWith`, `regex`, `none`). +- `triggerValue`: Valor utilizado no trigger (por exemplo, uma palavra-chave ou regex). +- `expire`: Tempo em minutos após o qual o bot expira, reiniciando se a sessão expirou. +- `keywordFinish`: Palavra-chave que encerra a sessão do bot. +- `delayMessage`: Delay (em milissegundos) para simular a digitação antes de enviar uma mensagem. +- `unknownMessage`: Mensagem enviada quando a entrada do usuário não é reconhecida. +- `listeningFromMe`: Define se o bot deve escutar as mensagens enviadas pelo próprio usuário (`true` ou `false`). +- `stopBotFromMe`: Define se o bot deve parar quando o próprio usuário envia uma mensagem (`true` ou `false`). +- `keepOpen`: Mantém a sessão aberta, evitando que o bot seja reiniciado para o mesmo contato. +- `debounceTime`: Tempo (em segundos) para juntar várias mensagens em uma só. +- `ignoreJids`: Lista de JIDs de contatos que não ativarão o bot. + +### Exemplo de Retorno da API + +A resposta da sua API deve estar no formato JSON e conter a mensagem a ser enviada ao usuário no campo `message`: + +```json +{ + "message": "Sua resposta aqui", + "linkPreview": false +} +``` + +#### Opções Avançadas de Resposta + +Sua API pode retornar campos adicionais para controlar como a mensagem é enviada: + +- **`message`** (string, obrigatório): O texto da mensagem a ser enviada +- **`linkPreview`** (boolean, opcional): + - `true`: Habilita preview de links na mensagem (padrão) + - `false`: Desabilita preview de links ⚠️ **Recomendado quando a mensagem contém emails ou URLs** + +#### Exemplo com linkPreview desabilitado: + +```json +{ + "message": "Seu email de confirmação: user@example.com\n\nAcesse: https://site.com/confirmar", + "linkPreview": false +} +``` + +**💡 Dica:** Use `linkPreview: false` quando: +- A mensagem contém emails +- Há múltiplas URLs +- O preview tornaria a mensagem confusa + +## 2. Configurações Padrão do Evolution Bot + +Você pode definir configurações padrão que serão aplicadas caso os parâmetros não sejam passados durante a criação do bot. + +### Endpoint para Configurações Padrão + +#### Endpoint + +``` +POST {{baseUrl}}/evolutionBot/settings/{{instance}} +``` + +#### Corpo da Requisição + +Aqui está um exemplo de configuração padrão: + +```json +{ + "expire": 20, + "keywordFinish": "#SAIR", + "delayMessage": 1000, + "unknownMessage": "Mensagem não reconhecida", + "listeningFromMe": false, + "stopBotFromMe": false, + "keepOpen": false, + "debounceTime": 0, + "ignoreJids": [], + "evolutionBotIdFallback": "clyja4oys0a3uqpy7k3bd7swe" +} +``` + +### Explicação dos Parâmetros + +- `expire`: Tempo em minutos após o qual o bot expira. +- `keywordFinish`: Palavra-chave que encerra a sessão do bot. +- `delayMessage`: Delay para simular a digitação antes de enviar uma mensagem. +- `unknownMessage`: Mensagem enviada quando a entrada do usuário não é reconhecida. +- `listeningFromMe`: Define se o bot deve escutar as mensagens enviadas pelo próprio usuário. +- `stopBotFromMe`: Define se o bot deve parar quando o próprio usuário envia uma mensagem. +- `keepOpen`: Mantém a sessão aberta, evitando que o bot seja reiniciado para o mesmo contato. +- `debounceTime`: Tempo para juntar várias mensagens em uma só. +- `ignoreJids`: Lista de JIDs de contatos que não ativarão o bot. +- `evolutionBotIdFallback`: ID do bot de fallback que será utilizado caso nenhum trigger seja ativado. + +## 3. Gerenciamento de Sessões do Evolution Bot + +Você pode gerenciar as sessões do bot, alterando o status entre aberta, pausada ou fechada para cada contato específico. + +### Endpoint para Gerenciamento de Sessões + +#### Endpoint + +``` +POST {{baseUrl}}/evolutionBot/changeStatus/{{instance}} +``` + +#### Corpo da Requisição + +Aqui está um exemplo de como gerenciar o status da sessão: + +```json +{ + "remoteJid": "5511912345678@s.whatsapp.net", + "status": "closed" +} +``` + +### Explicação dos Parâmetros + +- `remoteJid`: JID (identificador) do contato no WhatsApp. +- `status`: Status da sessão (`opened`, `paused`, `closed`). + +## 4. Variáveis Automáticas e Especiais no Evolution Bot + +Quando uma sessão do Evolution Bot é iniciada, algumas variáveis predefinidas são automaticamente enviadas: + +```javascript +inputs: { + remoteJid: "JID do contato", + pushName: "Nome do contato", + instanceName: "Nome da instância", + serverUrl: "URL do servidor da API", + apiKey: "Chave de API da Evolution" +}; +``` + +### Explicação das Variáveis Automáticas + +- `remoteJid`: JID do contato com quem o bot está interagindo. +- `pushName`: Nome do contato no WhatsApp. +- `instanceName`: Nome da instância que está executando o bot. +- `serverUrl`: URL do servidor onde a Evolution API está hospedada. +- `apiKey`: Chave de API usada para autenticar as requisições. + +### Considerações Finais + +O Evolution Bot oferece uma plataforma flexível para integração de chatbots com suas APIs personalizadas, permitindo automação avançada e interações personalizadas no WhatsApp. Com o suporte para triggers, gerenciamento de sessões e configuração de variáveis automáticas, você pode construir uma experiência de chatbot robusta e eficaz para seus usuários. + +## Links Relacionados + +- [Chatwoot](https://doc.evolution-api.com/v2/pt/integrations/chatwoot) +- [Typebot](https://doc.evolution-api.com/v2/pt/integrations/typebot) +- [Website](https://evolution-api.com/) +- [GitHub](https://github.com/EvolutionAPI/evolution-api) + +--- + +*Documentação extraída de: https://doc.evolution-api.com/v2/pt/integrations/evolution-bot* diff --git a/evolution-bot-linkpreview-example.md b/evolution-bot-linkpreview-example.md new file mode 100644 index 00000000..9db76581 --- /dev/null +++ b/evolution-bot-linkpreview-example.md @@ -0,0 +1,147 @@ +# Evolution Bot - Exemplo Prático com LinkPreview + +Este exemplo mostra como implementar uma API simples que utiliza o Evolution Bot com controle de link preview. + +## 1. Exemplo de API em Node.js/Express + +```javascript +const express = require('express'); +const app = express(); +app.use(express.json()); + +app.post('/webhook/evolutionbot', (req, res) => { + const { query, inputs } = req.body; + const userMessage = query.toLowerCase(); + + // Exemplo 1: Mensagem com email (sem preview) + if (userMessage.includes('email')) { + return res.json({ + message: `Seu email de confirmação foi enviado para: ${inputs.pushName}@exemplo.com\n\nVerifique sua caixa de entrada.`, + linkPreview: false // ❌ Desabilita preview para evitar poluição visual + }); + } + + // Exemplo 2: Mensagem com link promocional (com preview) + if (userMessage.includes('promoção')) { + return res.json({ + message: `🎉 Promoção especial disponível!\n\nAcesse: https://loja.exemplo.com/promocao`, + linkPreview: true // ✅ Habilita preview para mostrar a página + }); + } + + // Exemplo 3: Mensagem com múltiplos links (sem preview) + if (userMessage.includes('links')) { + return res.json({ + message: `📋 Links importantes:\n\n• Site: https://site.com\n• Suporte: https://help.site.com\n• Contato: contato@site.com`, + linkPreview: false // ❌ Múltiplos links ficariam confusos com preview + }); + } + + // Exemplo 4: Resposta padrão + return res.json({ + message: "Olá! Como posso ajudar você hoje?" + // linkPreview não especificado = true (padrão) + }); +}); + +app.listen(3000, () => { + console.log('API do Evolution Bot rodando na porta 3000'); +}); +``` + +## 2. Configuração do Evolution Bot + +```json +{ + "enabled": true, + "apiUrl": "http://sua-api.com/webhook/evolutionbot", + "apiKey": "sua-chave-opcional", + "triggerType": "all", + "delayMessage": 1000, + "unknownMessage": "Desculpe, não entendi. Digite 'ajuda' para ver as opções." +} +``` + +## 3. Exemplos de Uso + +### ❌ Problema: Mensagem com preview desnecessário +```json +{ + "message": "Confirme seu pedido acessando: https://loja.com/pedido/123 ou entre em contato: vendas@loja.com" + // Sem linkPreview = true (padrão) - Vai mostrar preview da URL e do email +} +``` + +**Resultado:** Mensagem poluída visualmente no WhatsApp. + +### ✅ Solução: Desabilitar preview quando necessário +```json +{ + "message": "Confirme seu pedido acessando: https://loja.com/pedido/123 ou entre em contato: vendas@loja.com", + "linkPreview": false +} +``` + +**Resultado:** Mensagem limpa e fácil de ler. + +## 4. Casos de Uso Recomendados + +### Use `linkPreview: false` quando: +- ✉️ Mensagem contém emails +- 🔗 Múltiplas URLs na mesma mensagem +- 📝 URLs são apenas referências/instruções +- 🏷️ Mensagens curtas onde o preview é maior que o texto + +### Use `linkPreview: true` (ou omita) quando: +- 📰 Compartilhamento de artigos/notícias +- 🛒 Links promocionais/produtos +- 🌐 Preview ajuda a dar contexto +- 📱 Único link principal na mensagem + +## 5. Exemplo de Implementação em PHP + +```php + "Seu email de confirmação: " . $inputs['pushName'] . "@exemplo.com", + 'linkPreview' => false + ]); +} elseif (strpos($query, 'site') !== false) { + echo json_encode([ + 'message' => "Visite nosso site: https://exemplo.com", + 'linkPreview' => true + ]); +} else { + echo json_encode([ + 'message' => "Como posso ajudar?" + ]); +} +?> +``` + +## 6. Teste da Implementação + +Para testar sua implementação: + +1. Configure o Evolution Bot com sua `apiUrl` +2. Envie mensagens de teste via WhatsApp +3. Verifique se os previews aparecem/desaparecem conforme esperado +4. Ajuste a lógica da sua API conforme necessário + +## 7. Dicas Importantes + +- 🔧 **Sempre teste** as mensagens no WhatsApp real para ver o resultado visual +- ⚡ **Performance**: `linkPreview: false` pode carregar mensagens mais rápido +- 📊 **Analytics**: Monitore quais tipos de mensagem têm melhor engajamento +- 🎯 **UX**: Priorize a legibilidade da mensagem sobre a funcionalidade de preview + +--- + +*Este exemplo mostra como implementar o controle de link preview no Evolution Bot de forma prática e eficiente.* diff --git a/send-text-api-documentation.md b/send-text-api-documentation.md new file mode 100644 index 00000000..e69de29b diff --git a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts index 081c2ffc..f6bcf8f1 100644 --- a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts +++ b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts @@ -106,26 +106,51 @@ export class EvolutionBotService extends BaseChatbotService Date: Wed, 3 Sep 2025 19:59:24 -0300 Subject: [PATCH 044/129] chore: remove documentation .md files - Remove evolution-bot-documentation.md - Remove evolution-bot-linkpreview-example.md - Remove send-text-api-documentation.md - Keep only the core linkPreview implementation --- evolution-bot-documentation.md | 203 --------------------------- evolution-bot-linkpreview-example.md | 147 ------------------- send-text-api-documentation.md | 0 3 files changed, 350 deletions(-) delete mode 100644 evolution-bot-documentation.md delete mode 100644 evolution-bot-linkpreview-example.md delete mode 100644 send-text-api-documentation.md diff --git a/evolution-bot-documentation.md b/evolution-bot-documentation.md deleted file mode 100644 index 2c65d8f9..00000000 --- a/evolution-bot-documentation.md +++ /dev/null @@ -1,203 +0,0 @@ -# Evolution Bot - -O Evolution Bot é uma integração de chatbot universal que permite a utilização de qualquer URL de API ou automação para criar interações automatizadas. Ao utilizar o Evolution Bot, sua API deve retornar a resposta na forma de um JSON contendo o campo `message`, que será enviado de volta ao usuário. Este sistema oferece flexibilidade para construir chatbots que se integram perfeitamente com suas APIs personalizadas. - -## 1. Criação de Bots no Evolution Bot - -Você pode configurar bots no Evolution Bot utilizando triggers para iniciar as interações. A configuração do bot pode ser feita através do endpoint `/evolutionBot/create/{{instance}}`. - -### Endpoint para Criação de Bots - -#### Endpoint - -``` -POST {{baseUrl}}/evolutionBot/create/{{instance}} -``` - -#### Corpo da Requisição - -Aqui está um exemplo de corpo JSON para configurar um bot no Evolution Bot: - -```json -{ - "enabled": true, - "apiUrl": "http://api.site.com/v1", - "apiKey": "app-123456", // optional - // opções - "triggerType": "keyword", /* all ou keyword */ - "triggerOperator": "equals", /* contains, equals, startsWith, endsWith, regex, none */ - "triggerValue": "teste", - "expire": 0, - "keywordFinish": "#SAIR", - "delayMessage": 1000, - "unknownMessage": "Mensagem não reconhecida", - "listeningFromMe": false, - "stopBotFromMe": false, - "keepOpen": false, - "debounceTime": 0, - "ignoreJids": [] -} -``` - -### Explicação dos Parâmetros - -- `enabled`: Ativa (`true`) ou desativa (`false`) o bot. -- `apiUrl`: URL da API que será chamada pelo bot (sem a `/` no final). -- `apiKey`: Chave da API fornecida pela sua aplicação (opcional). - -**Opções:** -- `triggerType`: Tipo de trigger para iniciar o bot (`all` ou `keyword`). -- `triggerOperator`: Operador utilizado para avaliar o trigger (`contains`, `equals`, `startsWith`, `endsWith`, `regex`, `none`). -- `triggerValue`: Valor utilizado no trigger (por exemplo, uma palavra-chave ou regex). -- `expire`: Tempo em minutos após o qual o bot expira, reiniciando se a sessão expirou. -- `keywordFinish`: Palavra-chave que encerra a sessão do bot. -- `delayMessage`: Delay (em milissegundos) para simular a digitação antes de enviar uma mensagem. -- `unknownMessage`: Mensagem enviada quando a entrada do usuário não é reconhecida. -- `listeningFromMe`: Define se o bot deve escutar as mensagens enviadas pelo próprio usuário (`true` ou `false`). -- `stopBotFromMe`: Define se o bot deve parar quando o próprio usuário envia uma mensagem (`true` ou `false`). -- `keepOpen`: Mantém a sessão aberta, evitando que o bot seja reiniciado para o mesmo contato. -- `debounceTime`: Tempo (em segundos) para juntar várias mensagens em uma só. -- `ignoreJids`: Lista de JIDs de contatos que não ativarão o bot. - -### Exemplo de Retorno da API - -A resposta da sua API deve estar no formato JSON e conter a mensagem a ser enviada ao usuário no campo `message`: - -```json -{ - "message": "Sua resposta aqui", - "linkPreview": false -} -``` - -#### Opções Avançadas de Resposta - -Sua API pode retornar campos adicionais para controlar como a mensagem é enviada: - -- **`message`** (string, obrigatório): O texto da mensagem a ser enviada -- **`linkPreview`** (boolean, opcional): - - `true`: Habilita preview de links na mensagem (padrão) - - `false`: Desabilita preview de links ⚠️ **Recomendado quando a mensagem contém emails ou URLs** - -#### Exemplo com linkPreview desabilitado: - -```json -{ - "message": "Seu email de confirmação: user@example.com\n\nAcesse: https://site.com/confirmar", - "linkPreview": false -} -``` - -**💡 Dica:** Use `linkPreview: false` quando: -- A mensagem contém emails -- Há múltiplas URLs -- O preview tornaria a mensagem confusa - -## 2. Configurações Padrão do Evolution Bot - -Você pode definir configurações padrão que serão aplicadas caso os parâmetros não sejam passados durante a criação do bot. - -### Endpoint para Configurações Padrão - -#### Endpoint - -``` -POST {{baseUrl}}/evolutionBot/settings/{{instance}} -``` - -#### Corpo da Requisição - -Aqui está um exemplo de configuração padrão: - -```json -{ - "expire": 20, - "keywordFinish": "#SAIR", - "delayMessage": 1000, - "unknownMessage": "Mensagem não reconhecida", - "listeningFromMe": false, - "stopBotFromMe": false, - "keepOpen": false, - "debounceTime": 0, - "ignoreJids": [], - "evolutionBotIdFallback": "clyja4oys0a3uqpy7k3bd7swe" -} -``` - -### Explicação dos Parâmetros - -- `expire`: Tempo em minutos após o qual o bot expira. -- `keywordFinish`: Palavra-chave que encerra a sessão do bot. -- `delayMessage`: Delay para simular a digitação antes de enviar uma mensagem. -- `unknownMessage`: Mensagem enviada quando a entrada do usuário não é reconhecida. -- `listeningFromMe`: Define se o bot deve escutar as mensagens enviadas pelo próprio usuário. -- `stopBotFromMe`: Define se o bot deve parar quando o próprio usuário envia uma mensagem. -- `keepOpen`: Mantém a sessão aberta, evitando que o bot seja reiniciado para o mesmo contato. -- `debounceTime`: Tempo para juntar várias mensagens em uma só. -- `ignoreJids`: Lista de JIDs de contatos que não ativarão o bot. -- `evolutionBotIdFallback`: ID do bot de fallback que será utilizado caso nenhum trigger seja ativado. - -## 3. Gerenciamento de Sessões do Evolution Bot - -Você pode gerenciar as sessões do bot, alterando o status entre aberta, pausada ou fechada para cada contato específico. - -### Endpoint para Gerenciamento de Sessões - -#### Endpoint - -``` -POST {{baseUrl}}/evolutionBot/changeStatus/{{instance}} -``` - -#### Corpo da Requisição - -Aqui está um exemplo de como gerenciar o status da sessão: - -```json -{ - "remoteJid": "5511912345678@s.whatsapp.net", - "status": "closed" -} -``` - -### Explicação dos Parâmetros - -- `remoteJid`: JID (identificador) do contato no WhatsApp. -- `status`: Status da sessão (`opened`, `paused`, `closed`). - -## 4. Variáveis Automáticas e Especiais no Evolution Bot - -Quando uma sessão do Evolution Bot é iniciada, algumas variáveis predefinidas são automaticamente enviadas: - -```javascript -inputs: { - remoteJid: "JID do contato", - pushName: "Nome do contato", - instanceName: "Nome da instância", - serverUrl: "URL do servidor da API", - apiKey: "Chave de API da Evolution" -}; -``` - -### Explicação das Variáveis Automáticas - -- `remoteJid`: JID do contato com quem o bot está interagindo. -- `pushName`: Nome do contato no WhatsApp. -- `instanceName`: Nome da instância que está executando o bot. -- `serverUrl`: URL do servidor onde a Evolution API está hospedada. -- `apiKey`: Chave de API usada para autenticar as requisições. - -### Considerações Finais - -O Evolution Bot oferece uma plataforma flexível para integração de chatbots com suas APIs personalizadas, permitindo automação avançada e interações personalizadas no WhatsApp. Com o suporte para triggers, gerenciamento de sessões e configuração de variáveis automáticas, você pode construir uma experiência de chatbot robusta e eficaz para seus usuários. - -## Links Relacionados - -- [Chatwoot](https://doc.evolution-api.com/v2/pt/integrations/chatwoot) -- [Typebot](https://doc.evolution-api.com/v2/pt/integrations/typebot) -- [Website](https://evolution-api.com/) -- [GitHub](https://github.com/EvolutionAPI/evolution-api) - ---- - -*Documentação extraída de: https://doc.evolution-api.com/v2/pt/integrations/evolution-bot* diff --git a/evolution-bot-linkpreview-example.md b/evolution-bot-linkpreview-example.md deleted file mode 100644 index 9db76581..00000000 --- a/evolution-bot-linkpreview-example.md +++ /dev/null @@ -1,147 +0,0 @@ -# Evolution Bot - Exemplo Prático com LinkPreview - -Este exemplo mostra como implementar uma API simples que utiliza o Evolution Bot com controle de link preview. - -## 1. Exemplo de API em Node.js/Express - -```javascript -const express = require('express'); -const app = express(); -app.use(express.json()); - -app.post('/webhook/evolutionbot', (req, res) => { - const { query, inputs } = req.body; - const userMessage = query.toLowerCase(); - - // Exemplo 1: Mensagem com email (sem preview) - if (userMessage.includes('email')) { - return res.json({ - message: `Seu email de confirmação foi enviado para: ${inputs.pushName}@exemplo.com\n\nVerifique sua caixa de entrada.`, - linkPreview: false // ❌ Desabilita preview para evitar poluição visual - }); - } - - // Exemplo 2: Mensagem com link promocional (com preview) - if (userMessage.includes('promoção')) { - return res.json({ - message: `🎉 Promoção especial disponível!\n\nAcesse: https://loja.exemplo.com/promocao`, - linkPreview: true // ✅ Habilita preview para mostrar a página - }); - } - - // Exemplo 3: Mensagem com múltiplos links (sem preview) - if (userMessage.includes('links')) { - return res.json({ - message: `📋 Links importantes:\n\n• Site: https://site.com\n• Suporte: https://help.site.com\n• Contato: contato@site.com`, - linkPreview: false // ❌ Múltiplos links ficariam confusos com preview - }); - } - - // Exemplo 4: Resposta padrão - return res.json({ - message: "Olá! Como posso ajudar você hoje?" - // linkPreview não especificado = true (padrão) - }); -}); - -app.listen(3000, () => { - console.log('API do Evolution Bot rodando na porta 3000'); -}); -``` - -## 2. Configuração do Evolution Bot - -```json -{ - "enabled": true, - "apiUrl": "http://sua-api.com/webhook/evolutionbot", - "apiKey": "sua-chave-opcional", - "triggerType": "all", - "delayMessage": 1000, - "unknownMessage": "Desculpe, não entendi. Digite 'ajuda' para ver as opções." -} -``` - -## 3. Exemplos de Uso - -### ❌ Problema: Mensagem com preview desnecessário -```json -{ - "message": "Confirme seu pedido acessando: https://loja.com/pedido/123 ou entre em contato: vendas@loja.com" - // Sem linkPreview = true (padrão) - Vai mostrar preview da URL e do email -} -``` - -**Resultado:** Mensagem poluída visualmente no WhatsApp. - -### ✅ Solução: Desabilitar preview quando necessário -```json -{ - "message": "Confirme seu pedido acessando: https://loja.com/pedido/123 ou entre em contato: vendas@loja.com", - "linkPreview": false -} -``` - -**Resultado:** Mensagem limpa e fácil de ler. - -## 4. Casos de Uso Recomendados - -### Use `linkPreview: false` quando: -- ✉️ Mensagem contém emails -- 🔗 Múltiplas URLs na mesma mensagem -- 📝 URLs são apenas referências/instruções -- 🏷️ Mensagens curtas onde o preview é maior que o texto - -### Use `linkPreview: true` (ou omita) quando: -- 📰 Compartilhamento de artigos/notícias -- 🛒 Links promocionais/produtos -- 🌐 Preview ajuda a dar contexto -- 📱 Único link principal na mensagem - -## 5. Exemplo de Implementação em PHP - -```php - "Seu email de confirmação: " . $inputs['pushName'] . "@exemplo.com", - 'linkPreview' => false - ]); -} elseif (strpos($query, 'site') !== false) { - echo json_encode([ - 'message' => "Visite nosso site: https://exemplo.com", - 'linkPreview' => true - ]); -} else { - echo json_encode([ - 'message' => "Como posso ajudar?" - ]); -} -?> -``` - -## 6. Teste da Implementação - -Para testar sua implementação: - -1. Configure o Evolution Bot com sua `apiUrl` -2. Envie mensagens de teste via WhatsApp -3. Verifique se os previews aparecem/desaparecem conforme esperado -4. Ajuste a lógica da sua API conforme necessário - -## 7. Dicas Importantes - -- 🔧 **Sempre teste** as mensagens no WhatsApp real para ver o resultado visual -- ⚡ **Performance**: `linkPreview: false` pode carregar mensagens mais rápido -- 📊 **Analytics**: Monitore quais tipos de mensagem têm melhor engajamento -- 🎯 **UX**: Priorize a legibilidade da mensagem sobre a funcionalidade de preview - ---- - -*Este exemplo mostra como implementar o controle de link preview no Evolution Bot de forma prática e eficiente.* diff --git a/send-text-api-documentation.md b/send-text-api-documentation.md deleted file mode 100644 index e69de29b..00000000 From 025b183ebf8cf6fa7a0a8cb243d2567da7694ce1 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Thu, 4 Sep 2025 03:18:35 -0300 Subject: [PATCH 045/129] feat/change variable GROUP_UPDATE to GROUPS_UPDATE --- .env.example | 2 +- src/config/env.config.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 882486f2..18dfff77 100644 --- a/.env.example +++ b/.env.example @@ -110,7 +110,7 @@ SQS_GLOBAL_CONTACTS_SET=false SQS_GLOBAL_CONTACTS_UPDATE=false SQS_GLOBAL_CONTACTS_UPSERT=false SQS_GLOBAL_GROUP_PARTICIPANTS_UPDATE=false -SQS_GLOBAL_GROUP_UPDATE=false +SQS_GLOBAL_GROUPS_UPDATE=false SQS_GLOBAL_GROUPS_UPSERT=false SQS_GLOBAL_LABELS_ASSOCIATION=false SQS_GLOBAL_LABELS_EDIT=false diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 809803d4..204461af 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -134,7 +134,7 @@ export type Sqs = { CONTACTS_UPDATE: boolean; CONTACTS_UPSERT: boolean; GROUP_PARTICIPANTS_UPDATE: boolean; - GROUP_UPDATE: boolean; + GROUPS_UPDATE: boolean; GROUPS_UPSERT: boolean; LABELS_ASSOCIATION: boolean; LABELS_EDIT: boolean; @@ -520,7 +520,7 @@ export class ConfigService { CONTACTS_UPDATE: process.env?.SQS_GLOBAL_CONTACTS_UPDATE === 'true', CONTACTS_UPSERT: process.env?.SQS_GLOBAL_CONTACTS_UPSERT === 'true', GROUP_PARTICIPANTS_UPDATE: process.env?.SQS_GLOBAL_GROUP_PARTICIPANTS_UPDATE === 'true', - GROUP_UPDATE: process.env?.SQS_GLOBAL_GROUP_UPDATE === 'true', + GROUPS_UPDATE: process.env?.SQS_GLOBAL_GROUPS_UPDATE === 'true', GROUPS_UPSERT: process.env?.SQS_GLOBAL_GROUPS_UPSERT === 'true', LABELS_ASSOCIATION: process.env?.SQS_GLOBAL_LABELS_ASSOCIATION === 'true', LABELS_EDIT: process.env?.SQS_GLOBAL_LABELS_EDIT === 'true', From 613d486fc243e323cc89c4f8ce903e5544a90de2 Mon Sep 17 00:00:00 2001 From: Andres Pache Date: Wed, 3 Sep 2025 18:35:30 -0300 Subject: [PATCH 046/129] stop tasks with missmatch cronId --- .../channel/whatsapp/whatsapp.baileys.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 32ae48fa..5b0d5750 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4367,7 +4367,11 @@ export class BaileysStartupService extends ChannelStartupService { const cache = this.chatwootService.getCache(); if (cache) { const storedId = await cache.hGet(cronKey, this.instance.name); - if (storedId && storedId !== cronId) return; + if (storedId && storedId !== cronId) { + this.logger.info(`Stopping syncChatwootLostMessages cron - ID mismatch: ${cronId} vs ${storedId}`); + task.stop(); + return; + } } this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare); }); From 1be58c8487ec669d0a1eec3168edad04469674ba Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Thu, 4 Sep 2025 12:19:51 -0300 Subject: [PATCH 047/129] refactor: improve linkPreview implementation based on PR feedback - Default linkPreview to true when not specified for backward compatibility - Validate linkPreview is boolean before passing to textMessage - Consolidate debug logs and remove sensitive data from logging - Sanitize API keys in debug output ([REDACTED]) - Reduce log verbosity while maintaining debugging capability - Ensure robust fallback behavior for malformed responses Addresses PR feedback regarding: - Backward compatibility preservation - Security considerations in logging - Input validation and error handling --- .../services/evolutionBot.service.ts | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts index f6bcf8f1..2a2cbeea 100644 --- a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts +++ b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts @@ -106,49 +106,57 @@ export class EvolutionBotService extends BaseChatbotService Date: Thu, 4 Sep 2025 14:35:56 -0300 Subject: [PATCH 048/129] style: clean up code formatting for linkPreview implementation - Remove unnecessary trailing whitespace - Use shorthand property syntax for linkPreview parameter - Apply ESLint formatting standards - Maintain code consistency and readability --- .../chatbot/evolutionBot/services/evolutionBot.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts index 2a2cbeea..b82e8fe1 100644 --- a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts +++ b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts @@ -130,7 +130,7 @@ export class EvolutionBotService extends BaseChatbotService Date: Fri, 5 Sep 2025 07:18:07 -0300 Subject: [PATCH 049/129] feat/change variable messageGroupId --- src/api/integrations/event/sqs/sqs.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index c92b849a..84955513 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -163,7 +163,7 @@ export class SqsController extends EventController implements EventControllerInt message.dataType = 's3'; } - const messageGroupId = sqsConfig.GLOBAL_ENABLED ? `${serverConfig.NAME}-${instanceName}` : 'evolution'; + const messageGroupId = sqsConfig.GLOBAL_ENABLED ? `${serverConfig.NAME}-${eventFormatted}-${instanceName}` : 'evolution'; const isGlobalEnabled = sqsConfig.GLOBAL_ENABLED; const params = { MessageBody: JSON.stringify(message), From 10a2c001abd3cfac97ae6f6cae332d8544139e72 Mon Sep 17 00:00:00 2001 From: ricael Date: Mon, 8 Sep 2025 08:48:49 -0300 Subject: [PATCH 050/129] feat: implement standardized error handling for WhatsApp API responses --- src/api/routes/business.router.ts | 49 +++++++++++++++++++--------- src/api/routes/template.router.ts | 49 +++++++++++++++++++--------- src/api/services/template.service.ts | 26 ++++++++++++--- src/utils/errorResponse.ts | 47 ++++++++++++++++++++++++++ 4 files changed, 136 insertions(+), 35 deletions(-) create mode 100644 src/utils/errorResponse.ts diff --git a/src/api/routes/business.router.ts b/src/api/routes/business.router.ts index 1e510a4f..8a56bba4 100644 --- a/src/api/routes/business.router.ts +++ b/src/api/routes/business.router.ts @@ -3,6 +3,7 @@ import { NumberDto } from '@api/dto/chat.dto'; import { businessController } from '@api/server.module'; import { catalogSchema, collectionsSchema } from '@validate/validate.schema'; import { RequestHandler, Router } from 'express'; +import { createMetaErrorResponse } from '@utils/errorResponse'; import { HttpStatus } from './index.router'; @@ -11,27 +12,45 @@ export class BusinessRouter extends RouterBroker { super(); this.router .post(this.routerPath('getCatalog'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: catalogSchema, - ClassRef: NumberDto, - execute: (instance, data) => businessController.fetchCatalog(instance, data), - }); + try { + const response = await this.dataValidate({ + request: req, + schema: catalogSchema, + ClassRef: NumberDto, + execute: (instance, data) => businessController.fetchCatalog(instance, data), + }); - return res.status(HttpStatus.OK).json(response); + return res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Business catalog error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'business_catalog'); + return res.status(errorResponse.status).json(errorResponse); + } }) .post(this.routerPath('getCollections'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: collectionsSchema, - ClassRef: NumberDto, - execute: (instance, data) => businessController.fetchCollections(instance, data), - }); + try { + const response = await this.dataValidate({ + request: req, + schema: collectionsSchema, + ClassRef: NumberDto, + execute: (instance, data) => businessController.fetchCollections(instance, data), + }); - return res.status(HttpStatus.OK).json(response); + return res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Business collections error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'business_collections'); + return res.status(errorResponse.status).json(errorResponse); + } }); } public readonly router: Router = Router(); -} +} \ No newline at end of file diff --git a/src/api/routes/template.router.ts b/src/api/routes/template.router.ts index b77b7d83..9a956e94 100644 --- a/src/api/routes/template.router.ts +++ b/src/api/routes/template.router.ts @@ -5,6 +5,7 @@ import { templateController } from '@api/server.module'; import { ConfigService } from '@config/env.config'; import { instanceSchema, templateSchema } from '@validate/validate.schema'; import { RequestHandler, Router } from 'express'; +import { createMetaErrorResponse } from '@utils/errorResponse'; import { HttpStatus } from './index.router'; @@ -16,26 +17,44 @@ export class TemplateRouter extends RouterBroker { super(); this.router .post(this.routerPath('create'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: templateSchema, - ClassRef: TemplateDto, - execute: (instance, data) => templateController.createTemplate(instance, data), - }); + try { + const response = await this.dataValidate({ + request: req, + schema: templateSchema, + ClassRef: TemplateDto, + execute: (instance, data) => templateController.createTemplate(instance, data), + }); - res.status(HttpStatus.CREATED).json(response); + res.status(HttpStatus.CREATED).json(response); + } catch (error) { + // Log error for debugging + console.error('Template creation error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'template_creation'); + res.status(errorResponse.status).json(errorResponse); + } }) .get(this.routerPath('find'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: instanceSchema, - ClassRef: InstanceDto, - execute: (instance) => templateController.findTemplate(instance), - }); + try { + const response = await this.dataValidate({ + request: req, + schema: instanceSchema, + ClassRef: InstanceDto, + execute: (instance) => templateController.findTemplate(instance), + }); - res.status(HttpStatus.OK).json(response); + res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Template find error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'template_find'); + res.status(errorResponse.status).json(errorResponse); + } }); } public readonly router: Router = Router(); -} +} \ No newline at end of file diff --git a/src/api/services/template.service.ts b/src/api/services/template.service.ts index 949f71c7..8cbdc486 100644 --- a/src/api/services/template.service.ts +++ b/src/api/services/template.service.ts @@ -60,6 +60,13 @@ export class TemplateService { const response = await this.requestTemplate(postData, 'POST'); if (!response || response.error) { + // If there's an error from WhatsApp API, throw it with the real error data + if (response && response.error) { + // Create an error object that includes the template field for Meta errors + const metaError = new Error(response.error.message || 'WhatsApp API Error'); + (metaError as any).template = response.error; + throw metaError; + } throw new Error('Error to create template'); } @@ -75,8 +82,9 @@ export class TemplateService { return template; } catch (error) { - this.logger.error(error); - throw new Error('Error to create template'); + this.logger.error('Error in create template: ' + error); + // Propagate the real error instead of "engolindo" it + throw error; } } @@ -86,6 +94,7 @@ export class TemplateService { const version = this.configService.get('WA_BUSINESS').VERSION; urlServer = `${urlServer}/${version}/${this.businessId}/message_templates`; const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${this.token}` }; + if (method === 'GET') { const result = await axios.get(urlServer, { headers }); return result.data; @@ -94,8 +103,15 @@ export class TemplateService { return result.data; } } catch (e) { - this.logger.error(e.response.data); - return e.response.data.error; + this.logger.error('WhatsApp API request error: ' + (e.response?.data || e.message)); + + // Return the complete error response from WhatsApp API + if (e.response?.data) { + return e.response.data; + } + + // If no response data, throw connection error + throw new Error(`Connection error: ${e.message}`); } } -} +} \ No newline at end of file diff --git a/src/utils/errorResponse.ts b/src/utils/errorResponse.ts new file mode 100644 index 00000000..66b61e40 --- /dev/null +++ b/src/utils/errorResponse.ts @@ -0,0 +1,47 @@ +import { HttpStatus } from '@api/routes/index.router'; + +export interface MetaErrorResponse { + status: number; + error: string; + message: string; + details: { + whatsapp_error: string; + whatsapp_code: string | number; + error_user_title: string; + error_user_msg: string; + error_type: string; + error_subcode: number | null; + fbtrace_id: string | null; + context: string; + type: string; + }; + timestamp: string; +} + +/** + * Creates standardized error response for Meta/WhatsApp API errors + */ +export function createMetaErrorResponse(error: any, context: string): MetaErrorResponse { + // Extract Meta/WhatsApp specific error fields + const metaError = error.template || error; + const errorUserTitle = metaError.error_user_title || metaError.message || 'Unknown error'; + const errorUserMsg = metaError.error_user_msg || metaError.message || 'Unknown error'; + + return { + status: HttpStatus.BAD_REQUEST, + error: 'Bad Request', + message: errorUserTitle, + details: { + whatsapp_error: errorUserMsg, + whatsapp_code: metaError.code || 'UNKNOWN_ERROR', + error_user_title: errorUserTitle, + error_user_msg: errorUserMsg, + error_type: metaError.type || 'UNKNOWN', + error_subcode: metaError.error_subcode || null, + fbtrace_id: metaError.fbtrace_id || null, + context, + type: 'whatsapp_api_error' + }, + timestamp: new Date().toISOString() + }; +} \ No newline at end of file From 79438c94459601c873b3a3684a61fd8e70516a9c Mon Sep 17 00:00:00 2001 From: ricael Date: Mon, 8 Sep 2025 09:11:45 -0300 Subject: [PATCH 051/129] refactor: lint fix --- src/api/routes/business.router.ts | 8 ++++---- src/api/routes/template.router.ts | 8 ++++---- src/api/services/template.service.ts | 8 ++++---- src/utils/errorResponse.ts | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/api/routes/business.router.ts b/src/api/routes/business.router.ts index 8a56bba4..faca7b33 100644 --- a/src/api/routes/business.router.ts +++ b/src/api/routes/business.router.ts @@ -1,9 +1,9 @@ import { RouterBroker } from '@api/abstract/abstract.router'; import { NumberDto } from '@api/dto/chat.dto'; import { businessController } from '@api/server.module'; +import { createMetaErrorResponse } from '@utils/errorResponse'; import { catalogSchema, collectionsSchema } from '@validate/validate.schema'; import { RequestHandler, Router } from 'express'; -import { createMetaErrorResponse } from '@utils/errorResponse'; import { HttpStatus } from './index.router'; @@ -24,7 +24,7 @@ export class BusinessRouter extends RouterBroker { } catch (error) { // Log error for debugging console.error('Business catalog error:', error); - + // Use utility function to create standardized error response const errorResponse = createMetaErrorResponse(error, 'business_catalog'); return res.status(errorResponse.status).json(errorResponse); @@ -44,7 +44,7 @@ export class BusinessRouter extends RouterBroker { } catch (error) { // Log error for debugging console.error('Business collections error:', error); - + // Use utility function to create standardized error response const errorResponse = createMetaErrorResponse(error, 'business_collections'); return res.status(errorResponse.status).json(errorResponse); @@ -53,4 +53,4 @@ export class BusinessRouter extends RouterBroker { } public readonly router: Router = Router(); -} \ No newline at end of file +} diff --git a/src/api/routes/template.router.ts b/src/api/routes/template.router.ts index 9a956e94..39d7b128 100644 --- a/src/api/routes/template.router.ts +++ b/src/api/routes/template.router.ts @@ -3,9 +3,9 @@ import { InstanceDto } from '@api/dto/instance.dto'; import { TemplateDto } from '@api/dto/template.dto'; import { templateController } from '@api/server.module'; import { ConfigService } from '@config/env.config'; +import { createMetaErrorResponse } from '@utils/errorResponse'; import { instanceSchema, templateSchema } from '@validate/validate.schema'; import { RequestHandler, Router } from 'express'; -import { createMetaErrorResponse } from '@utils/errorResponse'; import { HttpStatus } from './index.router'; @@ -29,7 +29,7 @@ export class TemplateRouter extends RouterBroker { } catch (error) { // Log error for debugging console.error('Template creation error:', error); - + // Use utility function to create standardized error response const errorResponse = createMetaErrorResponse(error, 'template_creation'); res.status(errorResponse.status).json(errorResponse); @@ -48,7 +48,7 @@ export class TemplateRouter extends RouterBroker { } catch (error) { // Log error for debugging console.error('Template find error:', error); - + // Use utility function to create standardized error response const errorResponse = createMetaErrorResponse(error, 'template_find'); res.status(errorResponse.status).json(errorResponse); @@ -57,4 +57,4 @@ export class TemplateRouter extends RouterBroker { } public readonly router: Router = Router(); -} \ No newline at end of file +} diff --git a/src/api/services/template.service.ts b/src/api/services/template.service.ts index 8cbdc486..8cc12831 100644 --- a/src/api/services/template.service.ts +++ b/src/api/services/template.service.ts @@ -94,7 +94,7 @@ export class TemplateService { const version = this.configService.get('WA_BUSINESS').VERSION; urlServer = `${urlServer}/${version}/${this.businessId}/message_templates`; const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${this.token}` }; - + if (method === 'GET') { const result = await axios.get(urlServer, { headers }); return result.data; @@ -104,14 +104,14 @@ export class TemplateService { } } catch (e) { this.logger.error('WhatsApp API request error: ' + (e.response?.data || e.message)); - + // Return the complete error response from WhatsApp API if (e.response?.data) { return e.response.data; } - + // If no response data, throw connection error throw new Error(`Connection error: ${e.message}`); } } -} \ No newline at end of file +} diff --git a/src/utils/errorResponse.ts b/src/utils/errorResponse.ts index 66b61e40..ee36ed22 100644 --- a/src/utils/errorResponse.ts +++ b/src/utils/errorResponse.ts @@ -26,7 +26,7 @@ export function createMetaErrorResponse(error: any, context: string): MetaErrorR const metaError = error.template || error; const errorUserTitle = metaError.error_user_title || metaError.message || 'Unknown error'; const errorUserMsg = metaError.error_user_msg || metaError.message || 'Unknown error'; - + return { status: HttpStatus.BAD_REQUEST, error: 'Bad Request', @@ -40,8 +40,8 @@ export function createMetaErrorResponse(error: any, context: string): MetaErrorR error_subcode: metaError.error_subcode || null, fbtrace_id: metaError.fbtrace_id || null, context, - type: 'whatsapp_api_error' + type: 'whatsapp_api_error', }, - timestamp: new Date().toISOString() + timestamp: new Date().toISOString(), }; -} \ No newline at end of file +} From 16c0a8033f5a78de62626a12dba6429ec9e2016f Mon Sep 17 00:00:00 2001 From: ricael Date: Mon, 8 Sep 2025 14:36:09 -0300 Subject: [PATCH 052/129] add stringify --- src/api/services/template.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/services/template.service.ts b/src/api/services/template.service.ts index 8cc12831..d129f602 100644 --- a/src/api/services/template.service.ts +++ b/src/api/services/template.service.ts @@ -103,7 +103,7 @@ export class TemplateService { return result.data; } } catch (e) { - this.logger.error('WhatsApp API request error: ' + (e.response?.data || e.message)); + this.logger.error('WhatsApp API request error: ' + ( e.response?.data ? JSON.stringify(e.response?.data) : e.message)); // Return the complete error response from WhatsApp API if (e.response?.data) { From 3989ff928bc996f0556273daa221e937c48f278e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 8 Sep 2025 14:44:28 -0300 Subject: [PATCH 053/129] chore: update CHANGELOG for version 2.3.3 and update baileys dependency to latest commit --- CHANGELOG.md | 6 ++++++ package-lock.json | 12 +++++++++++- package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8f25542..2da6ea6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.3.3 (develop) + +### Testing + +* Baileys Updates: Support LIDs in Baileys ([Commit 20693a5](https://github.com/WhiskeySockets/Baileys/commit/20693a59d0973fbf57b28de1b90c55484ce27f8e)) + # 2.3.2 (2025-09-02) ### Features diff --git a/package-lock.json b/package-lock.json index 70cfbaf6..c39c999b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4987,7 +4987,7 @@ }, "node_modules/baileys": { "version": "6.7.19", - "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#9e04cce8d3eeb16025283a57849cc83aa26c6dd1", + "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#20693a59d0973fbf57b28de1b90c55484ce27f8e", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -4996,6 +4996,7 @@ "async-mutex": "^0.5.0", "axios": "^1.6.0", "libsignal": "git+https://github.com/whiskeysockets/libsignal-node", + "lru-cache": "^11.1.0", "music-metadata": "^11.7.0", "pino": "^9.6", "protobufjs": "^7.2.4", @@ -5035,6 +5036,15 @@ "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" }, + "node_modules/baileys/node_modules/lru-cache": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", + "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/baileys/node_modules/pino": { "version": "9.7.0", "resolved": "https://registry.npmjs.org/pino/-/pino-9.7.0.tgz", diff --git a/package.json b/package.json index e91d1ea7..f73ca388 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "2.3.2", + "version": "2.3.3", "description": "Rest api for communication with WhatsApp", "main": "./dist/main.js", "type": "commonjs", From 3ecf288daf913f112fae5c1beef073997bed0760 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 8 Sep 2025 14:45:29 -0300 Subject: [PATCH 054/129] Revert "Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE)" --- .../chatwoot/services/chatwoot.service.ts | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index badaba13..c53a9ea4 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -567,13 +567,6 @@ export class ChatwootService { } public async createConversation(instance: InstanceDto, body: any) { - if (!body?.key) { - this.logger.warn( - `body.key is null or undefined in createConversation. Full body object: ${JSON.stringify(body)}`, - ); - return null; - } - const isLid = body.key.previousRemoteJid?.includes('@lid') && body.key.senderPn; const remoteJid = body.key.remoteJid; const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; @@ -1900,12 +1893,6 @@ export class ChatwootService { public async eventWhatsapp(event: string, instance: InstanceDto, body: any) { try { - // Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE) - if (body?.type && body.type !== 'message' && body.type !== 'conversation') { - this.logger.verbose(`Ignoring non-message event type: ${body.type}`); - return; - } - const waInstance = this.waMonitor.waInstances[instance.instanceName]; if (!waInstance) { @@ -1951,11 +1938,6 @@ export class ChatwootService { } if (event === 'messages.upsert' || event === 'send.message') { - if (!body?.key) { - this.logger.warn(`body.key is null or undefined. Full body object: ${JSON.stringify(body)}`); - return; - } - if (body.key.remoteJid === 'status@broadcast') { return; } @@ -2278,23 +2260,10 @@ export class ChatwootService { } if (event === 'messages.edit' || event === 'send.message.update') { - // Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE) - if (body?.type && body.type !== 'message') { - this.logger.verbose(`Ignoring non-message event type: ${body.type}`); - return; - } - - if (!body?.key?.id) { - this.logger.warn( - `body.key.id is null or undefined in messages.edit. Full body object: ${JSON.stringify(body)}`, - ); - return; - } - const editedText = `${ body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text }\n\n_\`${i18next.t('cw.message.edited')}.\`_`; - const message = await this.getMessageByKeyId(instance, body.key.id); + const message = await this.getMessageByKeyId(instance, body?.key?.id); const key = message.key as { id: string; fromMe: boolean; From 05fcdd9ffc3a661b6dba75dfc5e823100fe7348d Mon Sep 17 00:00:00 2001 From: ricael Date: Mon, 8 Sep 2025 14:45:33 -0300 Subject: [PATCH 055/129] =?UTF-8?q?refactor:=20melhora=20na=20formata?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20log=20de=20erro=20da=20API=20do=20WhatsApp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/services/template.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/services/template.service.ts b/src/api/services/template.service.ts index d129f602..8c36feab 100644 --- a/src/api/services/template.service.ts +++ b/src/api/services/template.service.ts @@ -103,7 +103,9 @@ export class TemplateService { return result.data; } } catch (e) { - this.logger.error('WhatsApp API request error: ' + ( e.response?.data ? JSON.stringify(e.response?.data) : e.message)); + this.logger.error( + 'WhatsApp API request error: ' + (e.response?.data ? JSON.stringify(e.response?.data) : e.message), + ); // Return the complete error response from WhatsApp API if (e.response?.data) { From e864b185615c1635aa29b5923055575c2fd76aa1 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 8 Sep 2025 15:33:54 -0300 Subject: [PATCH 056/129] chore: update .gitignore to include 'Baileys' directory --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 1cecfa98..634c6cb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# Repo +Baileys # compiled output /dist /node_modules From 8830f476e898fc3d86a6678d44369a1b61a1f244 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 8 Sep 2025 15:48:38 -0300 Subject: [PATCH 057/129] chore: bump version to 2.3.3 in package-lock.json and update remoteJid handling in Baileys service --- package-lock.json | 4 ++-- .../whatsapp/whatsapp.baileys.service.ts | 18 +++++++++--------- src/utils/use-multi-file-auth-state-prisma.ts | 2 +- ...use-multi-file-auth-state-provider-files.ts | 2 +- .../use-multi-file-auth-state-redis-db.ts | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index c39c999b..af71999a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "evolution-api", - "version": "2.3.2", + "version": "2.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "evolution-api", - "version": "2.3.2", + "version": "2.3.3", "license": "Apache-2.0", "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index c70ab6f6..e66df08e 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -110,7 +110,7 @@ import makeWASocket, { isJidBroadcast, isJidGroup, isJidNewsletter, - isJidUser, + isPnUser, makeCacheableSignalKeyStore, MessageUpsertType, MessageUserReceiptUpdate, @@ -982,8 +982,8 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - if (m.key.remoteJid?.includes('@lid') && m.key.senderPn) { - m.key.remoteJid = m.key.senderPn; + if (m.key.remoteJid?.includes('@lid') && m.key.remoteJidAlt) { + m.key.remoteJid = m.key.remoteJidAlt; } if (Long.isLong(m?.messageTimestamp)) { @@ -1048,9 +1048,9 @@ export class BaileysStartupService extends ChannelStartupService { ) => { try { for (const received of messages) { - if (received.key.remoteJid?.includes('@lid') && received.key.senderPn) { + if (received.key.remoteJid?.includes('@lid') && received.key.remoteJidAlt) { (received.key as { previousRemoteJid?: string | null }).previousRemoteJid = received.key.remoteJid; - received.key.remoteJid = received.key.senderPn; + received.key.remoteJid = received.key.remoteJidAlt; } if ( received?.messageStubParameters?.some?.((param) => @@ -1407,8 +1407,8 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - if (key.remoteJid?.includes('@lid') && key.senderPn) { - key.remoteJid = key.senderPn; + if (key.remoteJid?.includes('@lid') && key.remoteJidAlt) { + key.remoteJid = key.remoteJidAlt; } const updateKey = `${this.instance.id}_${key.id}_${update.status}`; @@ -1910,7 +1910,7 @@ export class BaileysStartupService extends ChannelStartupService { quoted, }); const id = await this.client.relayMessage(sender, message, { messageId }); - m.key = { id: id, remoteJid: sender, participant: isJidUser(sender) ? sender : undefined, fromMe: true }; + m.key = { id: id, remoteJid: sender, participant: isPnUser(sender) ? sender : undefined, fromMe: true }; for (const [key, value] of Object.entries(m)) { if (!value || (isArray(value) && value.length) === 0) { delete m[key]; @@ -3367,7 +3367,7 @@ export class BaileysStartupService extends ChannelStartupService { try { const keys: proto.IMessageKey[] = []; data.readMessages.forEach((read) => { - if (isJidGroup(read.remoteJid) || isJidUser(read.remoteJid)) { + if (isJidGroup(read.remoteJid) || isPnUser(read.remoteJid)) { keys.push({ remoteJid: read.remoteJid, fromMe: read.fromMe, id: read.id }); } }); diff --git a/src/utils/use-multi-file-auth-state-prisma.ts b/src/utils/use-multi-file-auth-state-prisma.ts index e16dc8b0..84d38fe4 100644 --- a/src/utils/use-multi-file-auth-state-prisma.ts +++ b/src/utils/use-multi-file-auth-state-prisma.ts @@ -153,7 +153,7 @@ export default async function useMultiFileAuthStatePrisma( ids.map(async (id) => { let value = await readData(`${type}-${id}`); if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.fromObject(value); + value = proto.Message.AppStateSyncKeyData.create(value); } data[id] = value; diff --git a/src/utils/use-multi-file-auth-state-provider-files.ts b/src/utils/use-multi-file-auth-state-provider-files.ts index 4dfa2fb2..6a15d654 100644 --- a/src/utils/use-multi-file-auth-state-provider-files.ts +++ b/src/utils/use-multi-file-auth-state-provider-files.ts @@ -100,7 +100,7 @@ export class AuthStateProvider { ids.map(async (id) => { let value = await readData(`${type}-${id}`); if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.fromObject(value); + value = proto.Message.AppStateSyncKeyData.create(value); } data[id] = value; diff --git a/src/utils/use-multi-file-auth-state-redis-db.ts b/src/utils/use-multi-file-auth-state-redis-db.ts index 837f8092..2f10c671 100644 --- a/src/utils/use-multi-file-auth-state-redis-db.ts +++ b/src/utils/use-multi-file-auth-state-redis-db.ts @@ -50,7 +50,7 @@ export async function useMultiFileAuthStateRedisDb( ids.map(async (id) => { let value = await readData(`${type}-${id}`); if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.fromObject(value); + value = proto.Message.AppStateSyncKeyData.create(value); } data[id] = value; From 6da79f03133ac112e075dcb794eb6b83d01c5c7e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 8 Sep 2025 19:53:52 -0300 Subject: [PATCH 058/129] chore: update CHANGELOG for Baileys v7.0.0-rc.2 and implement message content sanitization in Baileys service --- CHANGELOG.md | 2 +- package-lock.json | 4 +-- .../whatsapp/whatsapp.baileys.service.ts | 32 +++++++++++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da6ea6c..00151ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Testing -* Baileys Updates: Support LIDs in Baileys ([Commit 20693a5](https://github.com/WhiskeySockets/Baileys/commit/20693a59d0973fbf57b28de1b90c55484ce27f8e)) +* Baileys Updates: v7.0.0-rc.2 ([Link](https://github.com/WhiskeySockets/Baileys/releases/tag/v7.0.0-rc.2)) # 2.3.2 (2025-09-02) diff --git a/package-lock.json b/package-lock.json index af71999a..e9c87a39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4986,8 +4986,8 @@ } }, "node_modules/baileys": { - "version": "6.7.19", - "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#20693a59d0973fbf57b28de1b90c55484ce27f8e", + "version": "7.0.0-rc.2", + "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#7970a6e9af73971a5fb0636aec4255504ac1f161", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index e66df08e..be3f28df 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4299,6 +4299,32 @@ export class BaileysStartupService extends ChannelStartupService { throw new Error('Method not available in the Baileys service'); } + private sanitizeMessageContent(messageContent: any): any { + if (!messageContent) return messageContent; + + // Deep clone to avoid modifying original + const sanitized = JSON.parse(JSON.stringify(messageContent, (key, value) => { + // Convert Long objects to numbers + if (Long.isLong(value)) { + return value.toNumber(); + } + + // Convert Uint8Array to regular arrays or remove them + if (value instanceof Uint8Array) { + return Array.from(value); + } + + // Remove functions and other non-serializable objects + if (typeof value === 'function') { + return undefined; + } + + return value; + })); + + return sanitized; + } + private prepareMessage(message: proto.IWebMessageInfo): any { const contentType = getContentType(message.message); const contentMsg = message?.message[contentType] as any; @@ -4311,10 +4337,12 @@ export class BaileysStartupService extends ChannelStartupService { ? 'Você' : message?.participant || (message.key?.participant ? message.key.participant.split('@')[0] : null)), status: status[message.status], - message: { ...message.message }, + message: this.sanitizeMessageContent({ ...message.message }), contextInfo: contentMsg?.contextInfo, messageType: contentType || 'unknown', - messageTimestamp: message.messageTimestamp as number, + messageTimestamp: Long.isLong(message.messageTimestamp) + ? (message.messageTimestamp as Long).toNumber() + : (message.messageTimestamp as number), instanceId: this.instanceId, source: getDevice(message.key.id), }; From 0116bc4c9fb7c3107dba168426a6817c09014ca3 Mon Sep 17 00:00:00 2001 From: Josias Maceda Date: Tue, 9 Sep 2025 11:49:13 -0300 Subject: [PATCH 059/129] fix: integrate Typebot status change events for webhook in chatbot controller and service --- .../chatbot/base-chatbot.controller.ts | 27 ++++++++- .../typebot/services/typebot.service.ts | 55 ++++++++++++++++++- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/src/api/integrations/chatbot/base-chatbot.controller.ts b/src/api/integrations/chatbot/base-chatbot.controller.ts index 3a472cd8..d6abfd8d 100644 --- a/src/api/integrations/chatbot/base-chatbot.controller.ts +++ b/src/api/integrations/chatbot/base-chatbot.controller.ts @@ -9,6 +9,7 @@ import { getConversationMessage } from '@utils/getConversationMessage'; import { BaseChatbotDto } from './base-chatbot.dto'; import { ChatbotController, ChatbotControllerInterface, EmitData } from './chatbot.controller'; +import { Events } from '@api/types/wa.types'; // Common settings interface for all chatbot integrations export interface ChatbotSettings { @@ -58,7 +59,7 @@ export abstract class BaseChatbotController { - private openaiService: OpenaiService; - + private openaiService: OpenaiService; + constructor( waMonitor: WAMonitoringService, configService: ConfigService, @@ -19,7 +20,7 @@ export class TypebotService extends BaseChatbotService { openaiService: OpenaiService, ) { super(waMonitor, prismaRepository, 'TypebotService', configService); - this.openaiService = openaiService; + this.openaiService = openaiService; } /** @@ -151,6 +152,14 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: data.remoteJid, + status: 'opened', + session, + }; + this.waMonitor.waInstances[instance.name].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return { ...request.data, session }; } catch (error) { this.logger.error(error); @@ -399,12 +408,14 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + let statusChange = 'closed'; if (!settings?.keepOpen) { await prismaRepository.integrationSession.deleteMany({ where: { id: session.id, }, }); + statusChange = 'delete'; } else { await prismaRepository.integrationSession.update({ where: { @@ -415,6 +426,14 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: session.remoteJid, + status: statusChange, + session, + }; + instance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + } } @@ -639,6 +658,7 @@ export class TypebotService extends BaseChatbotService { } if (keywordFinish && content.toLowerCase() === keywordFinish.toLowerCase()) { + let statusChange = 'closed'; if (keepOpen) { await this.prismaRepository.integrationSession.update({ where: { @@ -649,6 +669,7 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + statusChange = 'delete'; await this.prismaRepository.integrationSession.deleteMany({ where: { botId: findTypebot.id, @@ -656,6 +677,14 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: remoteJid, + status: statusChange, + session, + }; + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return; } @@ -788,6 +817,7 @@ export class TypebotService extends BaseChatbotService { } if (keywordFinish && content.toLowerCase() === keywordFinish.toLowerCase()) { + let statusChange = 'closed'; if (keepOpen) { await this.prismaRepository.integrationSession.update({ where: { @@ -798,6 +828,7 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + statusChange = 'delete'; await this.prismaRepository.integrationSession.deleteMany({ where: { botId: findTypebot.id, @@ -805,6 +836,13 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: remoteJid, + status: statusChange, + session, + }; + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); return; } @@ -881,6 +919,7 @@ export class TypebotService extends BaseChatbotService { } if (keywordFinish && content.toLowerCase() === keywordFinish.toLowerCase()) { + let statusChange = 'closed'; if (keepOpen) { await this.prismaRepository.integrationSession.update({ where: { @@ -891,6 +930,7 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + statusChange = 'delete'; await this.prismaRepository.integrationSession.deleteMany({ where: { botId: findTypebot.id, @@ -898,6 +938,15 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: remoteJid, + status: statusChange, + session, + }; + + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return; } From 21502b996d3278358effb8ad84c4c21142e98847 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 9 Sep 2025 12:50:46 -0300 Subject: [PATCH 060/129] fix: enhance message content sanitization in Baileys service and improve message retrieval logic in Chatwoot service --- .../whatsapp/whatsapp.baileys.service.ts | 65 ++++++++++++------- .../chatwoot/services/chatwoot.service.ts | 25 +++++-- 2 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index e9cb4c03..e1d2ab30 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4302,27 +4302,44 @@ export class BaileysStartupService extends ChannelStartupService { private sanitizeMessageContent(messageContent: any): any { if (!messageContent) return messageContent; - // Deep clone to avoid modifying original - const sanitized = JSON.parse(JSON.stringify(messageContent, (key, value) => { - // Convert Long objects to numbers - if (Long.isLong(value)) { - return value.toNumber(); - } - - // Convert Uint8Array to regular arrays or remove them - if (value instanceof Uint8Array) { - return Array.from(value); - } - - // Remove functions and other non-serializable objects - if (typeof value === 'function') { - return undefined; - } - - return value; - })); + // Deep clone and sanitize to avoid modifying original + return JSON.parse( + JSON.stringify(messageContent, (key, value) => { + // Convert Long objects to numbers + if (Long.isLong(value)) { + return value.toNumber(); + } - return sanitized; + // Convert Uint8Array to regular arrays + if (value instanceof Uint8Array) { + return Array.from(value); + } + + // Remove functions and other non-serializable objects + if (typeof value === 'function') { + return undefined; + } + + // Handle objects with toJSON method + if (value && typeof value === 'object' && typeof value.toJSON === 'function') { + return value.toJSON(); + } + + // Handle special objects that might not serialize properly + if (value && typeof value === 'object') { + // Check if it's a plain object or has prototype issues + try { + JSON.stringify(value); + return value; + } catch (e) { + // If it can't be stringified, return a safe representation + return '[Non-serializable object]'; + } + } + + return value; + }), + ); } private prepareMessage(message: proto.IWebMessageInfo): any { @@ -4330,7 +4347,7 @@ export class BaileysStartupService extends ChannelStartupService { const contentMsg = message?.message[contentType] as any; const messageRaw = { - key: message.key, + key: message.key, // Save key exactly as it comes from Baileys pushName: message.pushName || (message.key.fromMe @@ -4338,10 +4355,10 @@ export class BaileysStartupService extends ChannelStartupService { : message?.participant || (message.key?.participant ? message.key.participant.split('@')[0] : null)), status: status[message.status], message: this.sanitizeMessageContent({ ...message.message }), - contextInfo: contentMsg?.contextInfo, + contextInfo: this.sanitizeMessageContent(contentMsg?.contextInfo), messageType: contentType || 'unknown', - messageTimestamp: Long.isLong(message.messageTimestamp) - ? (message.messageTimestamp as Long).toNumber() + messageTimestamp: Long.isLong(message.messageTimestamp) + ? (message.messageTimestamp as Long).toNumber() : (message.messageTimestamp as number), instanceId: this.instanceId, source: getDevice(message.key.id), diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index c53a9ea4..ccddd0ce 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -1561,13 +1561,24 @@ export class ChatwootService { return; } + // Use the message ID directly instead of JSON path query await this.prismaRepository.message.updateMany({ where: { - key: { - path: ['id'], - equals: key.id, - }, - instanceId: instance.instanceId, + AND: [ + { instanceId: instance.instanceId }, + { + OR: [ + { id: message.id }, // Use the actual message ID if available + // Fallback to raw query if needed + { + key: { + path: ['id'], + equals: key.id, + }, + }, + ], + }, + ], }, data: { chatwootMessageId: chatwootMessageIds.messageId, @@ -1584,13 +1595,15 @@ export class ChatwootService { } private async getMessageByKeyId(instance: InstanceDto, keyId: string): Promise { + // Try to find message using a more compatible approach const messages = await this.prismaRepository.message.findFirst({ where: { + instanceId: instance.instanceId, + // Use raw query to avoid JSON path issues key: { path: ['id'], equals: keyId, }, - instanceId: instance.instanceId, }, }); From bc9724a929f1010e85925cad4bf55f058dca3498 Mon Sep 17 00:00:00 2001 From: Josias Maceda Date: Tue, 9 Sep 2025 13:54:53 -0300 Subject: [PATCH 061/129] fix: remove abort process when status is paused, allowing the chatbot return after the time expires and after being paused due to human interaction (stopBotFromMe) --- src/api/integrations/chatbot/base-chatbot.controller.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/api/integrations/chatbot/base-chatbot.controller.ts b/src/api/integrations/chatbot/base-chatbot.controller.ts index 3a472cd8..0439a6f6 100644 --- a/src/api/integrations/chatbot/base-chatbot.controller.ts +++ b/src/api/integrations/chatbot/base-chatbot.controller.ts @@ -878,13 +878,7 @@ export abstract class BaseChatbotController Date: Tue, 9 Sep 2025 14:15:16 -0300 Subject: [PATCH 062/129] fix: the lint with npm run lint --- .../chatbot/base-chatbot.controller.ts | 12 +++---- .../typebot/services/typebot.service.ts | 35 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/api/integrations/chatbot/base-chatbot.controller.ts b/src/api/integrations/chatbot/base-chatbot.controller.ts index d6abfd8d..80a9a588 100644 --- a/src/api/integrations/chatbot/base-chatbot.controller.ts +++ b/src/api/integrations/chatbot/base-chatbot.controller.ts @@ -2,6 +2,7 @@ import { IgnoreJidDto } from '@api/dto/chatbot.dto'; import { InstanceDto } from '@api/dto/instance.dto'; import { PrismaRepository } from '@api/repository/repository.service'; import { WAMonitoringService } from '@api/services/monitor.service'; +import { Events } from '@api/types/wa.types'; import { Logger } from '@config/logger.config'; import { BadRequestException } from '@exceptions'; import { TriggerOperator, TriggerType } from '@prisma/client'; @@ -9,7 +10,6 @@ import { getConversationMessage } from '@utils/getConversationMessage'; import { BaseChatbotDto } from './base-chatbot.dto'; import { ChatbotController, ChatbotControllerInterface, EmitData } from './chatbot.controller'; -import { Events } from '@api/types/wa.types'; // Common settings interface for all chatbot integrations export interface ChatbotSettings { @@ -59,7 +59,7 @@ export abstract class BaseChatbotController { - private openaiService: OpenaiService; - + private openaiService: OpenaiService; + constructor( waMonitor: WAMonitoringService, configService: ConfigService, @@ -20,7 +20,7 @@ export class TypebotService extends BaseChatbotService { openaiService: OpenaiService, ) { super(waMonitor, prismaRepository, 'TypebotService', configService); - this.openaiService = openaiService; + this.openaiService = openaiService; } /** @@ -154,11 +154,11 @@ export class TypebotService extends BaseChatbotService { } const typebotData = { - remoteJid: data.remoteJid, - status: 'opened', - session, + remoteJid: data.remoteJid, + status: 'opened', + session, }; - this.waMonitor.waInstances[instance.name].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + this.waMonitor.waInstances[instance.name].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); return { ...request.data, session }; } catch (error) { @@ -433,7 +433,6 @@ export class TypebotService extends BaseChatbotService { session, }; instance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); - } } @@ -677,13 +676,13 @@ export class TypebotService extends BaseChatbotService { }, }); } - + const typebotData = { remoteJid: remoteJid, status: statusChange, session, }; - waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); return; } @@ -836,13 +835,13 @@ export class TypebotService extends BaseChatbotService { }, }); } - + const typebotData = { - remoteJid: remoteJid, - status: statusChange, - session, - }; - waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + remoteJid: remoteJid, + status: statusChange, + session, + }; + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); return; } @@ -945,7 +944,7 @@ export class TypebotService extends BaseChatbotService { session, }; - waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); return; } From cf548eedbe29ec7c1e76aa98eb2b8cab8f5cc450 Mon Sep 17 00:00:00 2001 From: Josias Maceda Date: Tue, 9 Sep 2025 14:19:54 -0300 Subject: [PATCH 063/129] fix: lint with npm run lint --- src/api/integrations/chatbot/base-chatbot.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/chatbot/base-chatbot.controller.ts b/src/api/integrations/chatbot/base-chatbot.controller.ts index 0439a6f6..05a45beb 100644 --- a/src/api/integrations/chatbot/base-chatbot.controller.ts +++ b/src/api/integrations/chatbot/base-chatbot.controller.ts @@ -878,7 +878,7 @@ export abstract class BaseChatbotController Date: Tue, 9 Sep 2025 14:56:11 -0300 Subject: [PATCH 064/129] Customizable Websockets Security Enables the option to specify safe remote addresses using WEBSOCKET_ALLOWED_HOSTS enviroment variables. Defaults to the secure only localhost. --- .env.example | 1 + .../integrations/event/websocket/websocket.controller.ts | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 679d15f6..eaac1e5f 100644 --- a/.env.example +++ b/.env.example @@ -99,6 +99,7 @@ SQS_REGION= # Websocket - Environment variables WEBSOCKET_ENABLED=false WEBSOCKET_GLOBAL_EVENTS=false +WEBSOCKET_ALLOWED_HOSTS=127.0.0.1,::1,::ffff:127.0.0.1 # Pusher - Environment variables PUSHER_ENABLED=false diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index 3f4afd9b..046682a9 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -31,11 +31,12 @@ export class WebsocketController extends EventController implements EventControl const params = new URLSearchParams(url.search); const { remoteAddress } = req.socket; - const isLocalhost = - remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1'; + const isAllowedHost = (process.env.WEBSOCKET_ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1') + .split(',') + .map(h => h.trim()) + .includes(remoteAddress); - // Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4) - if (params.has('EIO') && isLocalhost) { + if (params.has('EIO') && isAllowedHost) { return callback(null, true); } From d67eb3202bd7a2817898619192eb0b75b8b9dd76 Mon Sep 17 00:00:00 2001 From: moothz Date: Tue, 9 Sep 2025 15:46:26 -0300 Subject: [PATCH 065/129] Fix lint --- src/api/integrations/event/websocket/websocket.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index 046682a9..728c7644 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -33,7 +33,7 @@ export class WebsocketController extends EventController implements EventControl const { remoteAddress } = req.socket; const isAllowedHost = (process.env.WEBSOCKET_ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1') .split(',') - .map(h => h.trim()) + .map((h) => h.trim()) .includes(remoteAddress); if (params.has('EIO') && isAllowedHost) { From d31d6fa554ebc1b9ca51da03d6b94433db2d2e34 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 9 Sep 2025 16:18:05 -0300 Subject: [PATCH 066/129] refactor: replace JSON path queries with raw SQL in Baileys and Chatwoot services to improve message retrieval and update logic --- .../whatsapp/whatsapp.baileys.service.ts | 63 ++++++++++--------- .../chatwoot/services/chatwoot.service.ts | 59 ++++++----------- 2 files changed, 55 insertions(+), 67 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index e1d2ab30..fffae53c 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -484,9 +484,13 @@ export class BaileysStartupService extends ChannelStartupService { private async getMessage(key: proto.IMessageKey, full = false) { try { - const webMessageInfo = (await this.prismaRepository.message.findMany({ - where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } }, - })) as unknown as proto.IWebMessageInfo[]; + // Use raw SQL to avoid JSON path issues + const webMessageInfo = (await this.prismaRepository.$queryRaw` + SELECT * FROM "Message" + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'id' = ${key.id} + `) as proto.IWebMessageInfo[]; + if (full) { return webMessageInfo[0]; } @@ -1459,9 +1463,14 @@ export class BaileysStartupService extends ChannelStartupService { let findMessage: any; const configDatabaseData = this.configService.get('DATABASE').SAVE_DATA; if (configDatabaseData.HISTORIC || configDatabaseData.NEW_MESSAGE) { - findMessage = await this.prismaRepository.message.findFirst({ - where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } }, - }); + // Use raw SQL to avoid JSON path issues + const messages = (await this.prismaRepository.$queryRaw` + SELECT * FROM "Message" + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'id' = ${key.id} + LIMIT 1 + `) as any[]; + findMessage = messages[0] || null; if (findMessage) message.messageId = findMessage.id; } @@ -4427,24 +4436,23 @@ export class BaileysStartupService extends ChannelStartupService { private async updateMessagesReadedByTimestamp(remoteJid: string, timestamp?: number): Promise { if (timestamp === undefined || timestamp === null) return 0; - const result = await this.prismaRepository.message.updateMany({ - where: { - AND: [ - { key: { path: ['remoteJid'], equals: remoteJid } }, - { key: { path: ['fromMe'], equals: false } }, - { messageTimestamp: { lte: timestamp } }, - { OR: [{ status: null }, { status: status[3] }] }, - ], - }, - data: { status: status[4] }, - }); + // Use raw SQL to avoid JSON path issues + const result = await this.prismaRepository.$executeRaw` + UPDATE "Message" + SET "status" = ${status[4]} + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'remoteJid' = ${remoteJid} + AND ("key"->>'fromMe')::boolean = false + AND "messageTimestamp" <= ${timestamp} + AND ("status" IS NULL OR "status" = ${status[3]}) + `; if (result) { - if (result.count > 0) { + if (result > 0) { this.updateChatUnreadMessages(remoteJid); } - return result.count; + return result; } return 0; @@ -4453,15 +4461,14 @@ export class BaileysStartupService extends ChannelStartupService { private async updateChatUnreadMessages(remoteJid: string): Promise { const [chat, unreadMessages] = await Promise.all([ this.prismaRepository.chat.findFirst({ where: { remoteJid } }), - this.prismaRepository.message.count({ - where: { - AND: [ - { key: { path: ['remoteJid'], equals: remoteJid } }, - { key: { path: ['fromMe'], equals: false } }, - { status: { equals: status[3] } }, - ], - }, - }), + // Use raw SQL to avoid JSON path issues + this.prismaRepository.$queryRaw` + SELECT COUNT(*)::int as count FROM "Message" + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'remoteJid' = ${remoteJid} + AND ("key"->>'fromMe')::boolean = false + AND "status" = ${status[3]} + `.then((result: any[]) => result[0]?.count || 0), ]); if (chat && chat.unreadMessages !== unreadMessages) { diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index ccddd0ce..2cf16134 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -1561,33 +1561,18 @@ export class ChatwootService { return; } - // Use the message ID directly instead of JSON path query - await this.prismaRepository.message.updateMany({ - where: { - AND: [ - { instanceId: instance.instanceId }, - { - OR: [ - { id: message.id }, // Use the actual message ID if available - // Fallback to raw query if needed - { - key: { - path: ['id'], - equals: key.id, - }, - }, - ], - }, - ], - }, - data: { - chatwootMessageId: chatwootMessageIds.messageId, - chatwootConversationId: chatwootMessageIds.conversationId, - chatwootInboxId: chatwootMessageIds.inboxId, - chatwootContactInboxSourceId: chatwootMessageIds.contactInboxSourceId, - chatwootIsRead: chatwootMessageIds.isRead, - }, - }); + // Use raw SQL to avoid JSON path issues + await this.prismaRepository.$executeRaw` + UPDATE "Message" + SET + "chatwootMessageId" = ${chatwootMessageIds.messageId}, + "chatwootConversationId" = ${chatwootMessageIds.conversationId}, + "chatwootInboxId" = ${chatwootMessageIds.inboxId}, + "chatwootContactInboxSourceId" = ${chatwootMessageIds.contactInboxSourceId}, + "chatwootIsRead" = ${chatwootMessageIds.isRead || false} + WHERE "instanceId" = ${instance.instanceId} + AND "key"->>'id' = ${key.id} + `; if (this.isImportHistoryAvailable()) { chatwootImport.updateMessageSourceID(chatwootMessageIds.messageId, key.id); @@ -1595,19 +1580,15 @@ export class ChatwootService { } private async getMessageByKeyId(instance: InstanceDto, keyId: string): Promise { - // Try to find message using a more compatible approach - const messages = await this.prismaRepository.message.findFirst({ - where: { - instanceId: instance.instanceId, - // Use raw query to avoid JSON path issues - key: { - path: ['id'], - equals: keyId, - }, - }, - }); + // Use raw SQL query to avoid JSON path issues with Prisma + const messages = await this.prismaRepository.$queryRaw` + SELECT * FROM "Message" + WHERE "instanceId" = ${instance.instanceId} + AND "key"->>'id' = ${keyId} + LIMIT 1 + `; - return messages || null; + return (messages as MessageModel[])[0] || null; } private async getReplyToIds( From 1320ec8d4fa643ba38dd2a713fa58e44b4992e4b Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 10 Sep 2025 10:56:15 -0300 Subject: [PATCH 067/129] chore: update Baileys dependency to version 7.0.0-rc.2 in package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index e9c87a39..50d63e36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4987,7 +4987,7 @@ }, "node_modules/baileys": { "version": "7.0.0-rc.2", - "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#7970a6e9af73971a5fb0636aec4255504ac1f161", + "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#88ec0c4db212f16357bb133503fbdd2368620cc4", "hasInstallScript": true, "license": "MIT", "dependencies": { From bfe7030fabcc876910bcf7d9d551e3076cf5a3f8 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 10 Sep 2025 13:07:41 -0300 Subject: [PATCH 068/129] docs: add CLAUDE.md for development guidance and project architecture overview --- CLAUDE.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..e452214b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,78 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Development Commands + +### Core Commands +- **Run development server**: `npm run dev:server` - Starts the server with hot reload using tsx watch +- **Build project**: `npm run build` - Runs TypeScript check and builds with tsup +- **Start production**: `npm run start:prod` - Runs the compiled application from dist/ +- **Lint code**: `npm run lint` - Runs ESLint with auto-fix on TypeScript files +- **Check lint**: `npm run lint:check` - Runs ESLint without auto-fix + +### Database Commands +The project uses Prisma with support for multiple database providers (PostgreSQL, MySQL, psql_bouncer). Commands automatically use the DATABASE_PROVIDER from .env: + +- **Generate Prisma client**: `npm run db:generate` +- **Deploy migrations**: `npm run db:deploy` (Unix/Mac) or `npm run db:deploy:win` (Windows) +- **Open Prisma Studio**: `npm run db:studio` +- **Create new migration**: `npm run db:migrate:dev` (Unix/Mac) or `npm run db:migrate:dev:win` (Windows) + +## Architecture Overview + +### Project Structure +Evolution API is a WhatsApp integration platform built with TypeScript and Express, supporting both Baileys (WhatsApp Web) and WhatsApp Cloud API connections. + +### Core Components + +**API Layer** (`src/api/`) +- **Controllers**: Handle HTTP requests for different resources (instance, chat, group, sendMessage, etc.) +- **Services**: Business logic layer containing auth, cache, channel, monitor, proxy services +- **Routes**: RESTful API endpoints with authentication guards +- **DTOs**: Data transfer objects for request/response validation using class-validator +- **Repository**: Database access layer using Prisma ORM + +**Integrations** (`src/api/integrations/`) +- **Chatbot**: Supports multiple chatbot platforms (Typebot, Chatwoot, Dify, OpenAI, Flowise, N8N) +- **Event**: WebSocket, RabbitMQ, Amazon SQS event systems +- **Storage**: S3/Minio file storage integration +- **Channel**: Multi-channel messaging support + +**Configuration** (`src/config/`) +- Environment configuration management +- Database provider switching (PostgreSQL/MySQL/PgBouncer) +- Multi-tenant support via DATABASE_CONNECTION_CLIENT_NAME + +### Key Design Patterns + +1. **Multi-Provider Database**: Uses `runWithProvider.js` to dynamically select database provider and migrations +2. **Module System**: Path aliases configured in tsconfig.json (@api, @cache, @config, @utils, @validate) +3. **Event-Driven**: EventEmitter2 for internal events, supports multiple external event systems +4. **Instance Management**: Each WhatsApp connection is managed as an instance with memory lifecycle (DEL_INSTANCE config) + +### Database Schema +- Supports multiple providers with provider-specific schemas in `prisma/` +- Separate migration folders for each provider (postgresql-migrations, mysql-migrations) +- psql_bouncer uses PostgreSQL migrations but with connection pooling + +### Authentication & Security +- JWT-based authentication +- API key support +- Instance-specific authentication +- Configurable CORS settings + +### Messaging Features +- WhatsApp Web (Baileys library) and WhatsApp Cloud API support +- Message queue support (RabbitMQ, SQS) +- Real-time updates via WebSocket +- Media file handling with S3/Minio storage +- Multiple chatbot integrations with trigger management + +### Environment Variables +Critical configuration in `.env`: +- SERVER_TYPE, SERVER_PORT, SERVER_URL +- DATABASE_PROVIDER and DATABASE_CONNECTION_URI +- Log levels and Baileys-specific logging +- Instance lifecycle management (DEL_INSTANCE) +- Feature toggles for data persistence (DATABASE_SAVE_*) \ No newline at end of file From 486645fb087c899053ba73ccc89787a1e699e960 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 15 Sep 2025 16:21:33 -0300 Subject: [PATCH 069/129] chore: update Baileys dependency to version 7.0.0-rc.3 and improve message key handling in WhatsApp service --- CHANGELOG.md | 2 +- package-lock.json | 4142 +++++++++++------ package.json | 4 +- .../whatsapp/whatsapp.baileys.service.ts | 88 +- .../chatwoot/services/chatwoot.service.ts | 44 +- src/api/services/monitor.service.ts | 4 +- src/utils/i18n.ts | 5 +- 7 files changed, 2855 insertions(+), 1434 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00151ffe..cedfc9dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Testing -* Baileys Updates: v7.0.0-rc.2 ([Link](https://github.com/WhiskeySockets/Baileys/releases/tag/v7.0.0-rc.2)) +* Baileys Updates: v7.0.0-rc.3 ([Link](https://github.com/WhiskeySockets/Baileys/releases/tag/v7.0.0-rc.3)) # 2.3.2 (2025-09-02) diff --git a/package-lock.json b/package-lock.json index 50d63e36..a517340d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "github:WhiskeySockets/Baileys", + "baileys": "^7.0.0-rc.3", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", @@ -85,19 +85,21 @@ "eslint-plugin-simple-import-sort": "^10.0.0", "prettier": "^3.4.2", "tsconfig-paths": "^4.2.0", - "tsx": "^4.20.3", + "tsx": "^4.20.5", "typescript": "^5.7.2" } }, "node_modules/@adiwajshing/keyed-db": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/@adiwajshing/keyed-db/-/keyed-db-0.2.4.tgz", - "integrity": "sha512-yprSnAtj80/VKuDqRcFFLDYltoNV8tChNwFfIgcf6PGD4sjzWIBgs08pRuTqGH5mk5wgL6PBRSsMCZqtZwzFEw==" + "integrity": "sha512-yprSnAtj80/VKuDqRcFFLDYltoNV8tChNwFfIgcf6PGD4sjzWIBgs08pRuTqGH5mk5wgL6PBRSsMCZqtZwzFEw==", + "license": "MIT" }, "node_modules/@aws-crypto/sha256-browser": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/supports-web-crypto": "^5.2.0", @@ -112,6 +114,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -123,6 +126,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -135,6 +139,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -147,6 +152,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", @@ -160,6 +166,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" } @@ -168,6 +175,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", @@ -178,6 +186,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -189,6 +198,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -201,6 +211,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -210,50 +221,51 @@ } }, "node_modules/@aws-sdk/client-sqs": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.840.0.tgz", - "integrity": "sha512-e14G4W8hw9uFrKh4w9CNUrIUuAd6sETOuuTQFD7FYPMoZDlNvEcStE53yr0Egw0D0poqNzedKF4aZJH5MzyB9A==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.888.0.tgz", + "integrity": "sha512-ZnNRgqRZS8iGYift9mz0V2eodBtaKok+EJ7yRc+o3rblTHkun/Evej/WQrvdEvqFBY/Av+yYU2JZXOXegMQt1Q==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/credential-provider-node": "3.840.0", - "@aws-sdk/middleware-host-header": "3.840.0", - "@aws-sdk/middleware-logger": "3.840.0", - "@aws-sdk/middleware-recursion-detection": "3.840.0", - "@aws-sdk/middleware-sdk-sqs": "3.840.0", - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/region-config-resolver": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@aws-sdk/util-user-agent-browser": "3.840.0", - "@aws-sdk/util-user-agent-node": "3.840.0", - "@smithy/config-resolver": "^4.1.4", - "@smithy/core": "^3.6.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/hash-node": "^4.0.4", - "@smithy/invalid-dependency": "^4.0.4", - "@smithy/md5-js": "^4.0.4", - "@smithy/middleware-content-length": "^4.0.4", - "@smithy/middleware-endpoint": "^4.1.13", - "@smithy/middleware-retry": "^4.1.14", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.21", - "@smithy/util-defaults-mode-node": "^4.0.21", - "@smithy/util-endpoints": "^3.0.6", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/credential-provider-node": "3.888.0", + "@aws-sdk/middleware-host-header": "3.887.0", + "@aws-sdk/middleware-logger": "3.887.0", + "@aws-sdk/middleware-recursion-detection": "3.887.0", + "@aws-sdk/middleware-sdk-sqs": "3.887.0", + "@aws-sdk/middleware-user-agent": "3.888.0", + "@aws-sdk/region-config-resolver": "3.887.0", + "@aws-sdk/types": "3.887.0", + "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-user-agent-browser": "3.887.0", + "@aws-sdk/util-user-agent-node": "3.888.0", + "@smithy/config-resolver": "^4.2.1", + "@smithy/core": "^3.11.0", + "@smithy/fetch-http-handler": "^5.2.1", + "@smithy/hash-node": "^4.1.1", + "@smithy/invalid-dependency": "^4.1.1", + "@smithy/md5-js": "^4.1.1", + "@smithy/middleware-content-length": "^4.1.1", + "@smithy/middleware-endpoint": "^4.2.1", + "@smithy/middleware-retry": "^4.2.1", + "@smithy/middleware-serde": "^4.1.1", + "@smithy/middleware-stack": "^4.1.1", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-http-handler": "^4.2.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-body-length-browser": "^4.1.0", + "@smithy/util-body-length-node": "^4.1.0", + "@smithy/util-defaults-mode-browser": "^4.1.1", + "@smithy/util-defaults-mode-node": "^4.1.1", + "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-retry": "^4.1.1", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -261,47 +273,48 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.840.0.tgz", - "integrity": "sha512-3Zp+FWN2hhmKdpS0Ragi5V2ZPsZNScE3jlbgoJjzjI/roHZqO+e3/+XFN4TlM0DsPKYJNp+1TAjmhxN6rOnfYA==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.888.0.tgz", + "integrity": "sha512-8CLy/ehGKUmekjH+VtZJ4w40PqDg3u0K7uPziq/4P8Q7LLgsy8YQoHNbuY4am7JU3HWrqLXJI9aaz1+vPGPoWA==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/middleware-host-header": "3.840.0", - "@aws-sdk/middleware-logger": "3.840.0", - "@aws-sdk/middleware-recursion-detection": "3.840.0", - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/region-config-resolver": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@aws-sdk/util-user-agent-browser": "3.840.0", - "@aws-sdk/util-user-agent-node": "3.840.0", - "@smithy/config-resolver": "^4.1.4", - "@smithy/core": "^3.6.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/hash-node": "^4.0.4", - "@smithy/invalid-dependency": "^4.0.4", - "@smithy/middleware-content-length": "^4.0.4", - "@smithy/middleware-endpoint": "^4.1.13", - "@smithy/middleware-retry": "^4.1.14", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.21", - "@smithy/util-defaults-mode-node": "^4.0.21", - "@smithy/util-endpoints": "^3.0.6", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/middleware-host-header": "3.887.0", + "@aws-sdk/middleware-logger": "3.887.0", + "@aws-sdk/middleware-recursion-detection": "3.887.0", + "@aws-sdk/middleware-user-agent": "3.888.0", + "@aws-sdk/region-config-resolver": "3.887.0", + "@aws-sdk/types": "3.887.0", + "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-user-agent-browser": "3.887.0", + "@aws-sdk/util-user-agent-node": "3.888.0", + "@smithy/config-resolver": "^4.2.1", + "@smithy/core": "^3.11.0", + "@smithy/fetch-http-handler": "^5.2.1", + "@smithy/hash-node": "^4.1.1", + "@smithy/invalid-dependency": "^4.1.1", + "@smithy/middleware-content-length": "^4.1.1", + "@smithy/middleware-endpoint": "^4.2.1", + "@smithy/middleware-retry": "^4.2.1", + "@smithy/middleware-serde": "^4.1.1", + "@smithy/middleware-stack": "^4.1.1", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-http-handler": "^4.2.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-body-length-browser": "^4.1.0", + "@smithy/util-body-length-node": "^4.1.0", + "@smithy/util-defaults-mode-browser": "^4.1.1", + "@smithy/util-defaults-mode-node": "^4.1.1", + "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-retry": "^4.1.1", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -309,24 +322,25 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.840.0.tgz", - "integrity": "sha512-x3Zgb39tF1h2XpU+yA4OAAQlW6LVEfXNlSedSYJ7HGKXqA/E9h3rWQVpYfhXXVVsLdYXdNw5KBUkoAoruoZSZA==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.888.0.tgz", + "integrity": "sha512-L3S2FZywACo4lmWv37Y4TbefuPJ1fXWyWwIJ3J4wkPYFJ47mmtUPqThlVrSbdTHkEjnZgJe5cRfxk0qCLsFh1w==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@aws-sdk/xml-builder": "3.821.0", - "@smithy/core": "^3.6.0", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/property-provider": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/signature-v4": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-utf8": "^4.0.0", - "fast-xml-parser": "4.4.1", + "@aws-sdk/types": "3.887.0", + "@aws-sdk/xml-builder": "3.887.0", + "@smithy/core": "^3.11.0", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/property-provider": "^4.0.5", + "@smithy/protocol-http": "^5.2.1", + "@smithy/signature-v4": "^5.1.3", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-body-length-browser": "^4.1.0", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-utf8": "^4.1.0", + "fast-xml-parser": "5.2.5", "tslib": "^2.6.2" }, "engines": { @@ -334,14 +348,15 @@ } }, "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.840.0.tgz", - "integrity": "sha512-EzF6VcJK7XvQ/G15AVEfJzN2mNXU8fcVpXo4bRyr1S6t2q5zx6UPH/XjDbn18xyUmOq01t+r8gG+TmHEVo18fA==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.888.0.tgz", + "integrity": "sha512-shPi4AhUKbIk7LugJWvNpeZA8va7e5bOHAEKo89S0Ac8WDZt2OaNzbh/b9l0iSL2eEyte8UgIsYGcFxOwIF1VA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -349,19 +364,20 @@ } }, "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.840.0.tgz", - "integrity": "sha512-wbnUiPGLVea6mXbUh04fu+VJmGkQvmToPeTYdHE8eRZq3NRDi3t3WltT+jArLBKD/4NppRpMjf2ju4coMCz91g==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.888.0.tgz", + "integrity": "sha512-Jvuk6nul0lE7o5qlQutcqlySBHLXOyoPtiwE6zyKbGc7RVl0//h39Lab7zMeY2drMn8xAnIopL4606Fd8JI/Hw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/property-provider": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/util-stream": "^4.2.2", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/fetch-http-handler": "^5.2.1", + "@smithy/node-http-handler": "^4.2.1", + "@smithy/property-provider": "^4.0.5", + "@smithy/protocol-http": "^5.2.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "@smithy/util-stream": "^4.3.1", "tslib": "^2.6.2" }, "engines": { @@ -369,22 +385,23 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.840.0.tgz", - "integrity": "sha512-7F290BsWydShHb+7InXd+IjJc3mlEIm9I0R57F/Pjl1xZB69MdkhVGCnuETWoBt4g53ktJd6NEjzm/iAhFXFmw==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.888.0.tgz", + "integrity": "sha512-M82ItvS5yq+tO6ZOV1ruaVs2xOne+v8HW85GFCXnz8pecrzYdgxh6IsVqEbbWruryG/mUGkWMbkBZoEsy4MgyA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/credential-provider-env": "3.840.0", - "@aws-sdk/credential-provider-http": "3.840.0", - "@aws-sdk/credential-provider-process": "3.840.0", - "@aws-sdk/credential-provider-sso": "3.840.0", - "@aws-sdk/credential-provider-web-identity": "3.840.0", - "@aws-sdk/nested-clients": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/credential-provider-imds": "^4.0.6", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/credential-provider-env": "3.888.0", + "@aws-sdk/credential-provider-http": "3.888.0", + "@aws-sdk/credential-provider-process": "3.888.0", + "@aws-sdk/credential-provider-sso": "3.888.0", + "@aws-sdk/credential-provider-web-identity": "3.888.0", + "@aws-sdk/nested-clients": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/credential-provider-imds": "^4.0.7", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -392,21 +409,22 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.840.0.tgz", - "integrity": "sha512-KufP8JnxA31wxklLm63evUPSFApGcH8X86z3mv9SRbpCm5ycgWIGVCTXpTOdgq6rPZrwT9pftzv2/b4mV/9clg==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.888.0.tgz", + "integrity": "sha512-KCrQh1dCDC8Y+Ap3SZa6S81kHk+p+yAaOQ5jC3dak4zhHW3RCrsGR/jYdemTOgbEGcA6ye51UbhWfrrlMmeJSA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.840.0", - "@aws-sdk/credential-provider-http": "3.840.0", - "@aws-sdk/credential-provider-ini": "3.840.0", - "@aws-sdk/credential-provider-process": "3.840.0", - "@aws-sdk/credential-provider-sso": "3.840.0", - "@aws-sdk/credential-provider-web-identity": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/credential-provider-imds": "^4.0.6", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/credential-provider-env": "3.888.0", + "@aws-sdk/credential-provider-http": "3.888.0", + "@aws-sdk/credential-provider-ini": "3.888.0", + "@aws-sdk/credential-provider-process": "3.888.0", + "@aws-sdk/credential-provider-sso": "3.888.0", + "@aws-sdk/credential-provider-web-identity": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/credential-provider-imds": "^4.0.7", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -414,15 +432,16 @@ } }, "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.840.0.tgz", - "integrity": "sha512-HkDQWHy8tCI4A0Ps2NVtuVYMv9cB4y/IuD/TdOsqeRIAT12h8jDb98BwQPNLAImAOwOWzZJ8Cu0xtSpX7CQhMw==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.888.0.tgz", + "integrity": "sha512-+aX6piSukPQ8DUS4JAH344GePg8/+Q1t0+kvSHAZHhYvtQ/1Zek3ySOJWH2TuzTPCafY4nmWLcQcqvU1w9+4Lw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -430,17 +449,18 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.840.0.tgz", - "integrity": "sha512-2qgdtdd6R0Z1y0KL8gzzwFUGmhBHSUx4zy85L2XV1CXhpRNwV71SVWJqLDVV5RVWVf9mg50Pm3AWrUC0xb0pcA==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.888.0.tgz", + "integrity": "sha512-b1ZJji7LJ6E/j1PhFTyvp51in2iCOQ3VP6mj5H6f5OUnqn7efm41iNMoinKr87n0IKZw7qput5ggXVxEdPhouA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.840.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/token-providers": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/client-sso": "3.888.0", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/token-providers": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -448,15 +468,16 @@ } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.840.0.tgz", - "integrity": "sha512-dpEeVXG8uNZSmVXReE4WP0lwoioX2gstk4RnUgrdUE3YaPq8A+hJiVAyc3h+cjDeIqfbsQbZm9qFetKC2LF9dQ==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.888.0.tgz", + "integrity": "sha512-7P0QNtsDzMZdmBAaY/vY1BsZHwTGvEz3bsn2bm5VSKFAeMmZqsHK1QeYdNsFjLtegnVh+wodxMq50jqLv3LFlA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/nested-clients": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/nested-clients": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -464,13 +485,14 @@ } }, "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.840.0.tgz", - "integrity": "sha512-ub+hXJAbAje94+Ya6c6eL7sYujoE8D4Bumu1NUI8TXjUhVVn0HzVWQjpRLshdLsUp1AW7XyeJaxyajRaJQ8+Xg==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.887.0.tgz", + "integrity": "sha512-ulzqXv6NNqdu/kr0sgBYupWmahISHY+azpJidtK6ZwQIC+vBUk9NdZeqQpy7KVhIk2xd4+5Oq9rxapPwPI21CA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.887.0", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -478,12 +500,13 @@ } }, "node_modules/@aws-sdk/middleware-logger": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.840.0.tgz", - "integrity": "sha512-lSV8FvjpdllpGaRspywss4CtXV8M7NNNH+2/j86vMH+YCOZ6fu2T/TyFd/tHwZ92vDfHctWkRbQxg0bagqwovA==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.887.0.tgz", + "integrity": "sha512-YbbgLI6jKp2qSoAcHnXrQ5jcuc5EYAmGLVFgMVdk8dfCfJLfGGSaOLxF4CXC7QYhO50s+mPPkhBYejCik02Kug==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.887.0", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -491,13 +514,15 @@ } }, "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.840.0.tgz", - "integrity": "sha512-Gu7lGDyfddyhIkj1Z1JtrY5NHb5+x/CRiB87GjaSrKxkDaydtX2CU977JIABtt69l9wLbcGDIQ+W0uJ5xPof7g==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.887.0.tgz", + "integrity": "sha512-tjrUXFtQnFLo+qwMveq5faxP5MQakoLArXtqieHphSqZTXm21wDJM73hgT4/PQQGTwgYjDKqnqsE1hvk0hcfDw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.887.0", + "@aws/lambda-invoke-store": "^0.0.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -505,15 +530,16 @@ } }, "node_modules/@aws-sdk/middleware-sdk-sqs": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.840.0.tgz", - "integrity": "sha512-NJVSWkidhfKvU8CTqK17mJnP2IPuJxgbjbSHm3gmvamuewTM291cdgU/xM8eKhHfiF8Us8P7rji3ZhoOzz797w==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.887.0.tgz", + "integrity": "sha512-5zkGO/ADEjGJ1zJBCS4Zs2aLPAMLu+W7pk5AgeLpCQp8LqIYOmPH6X9IhNGIq/urytUK7JoFX985MfEzDOvFTg==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.887.0", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -521,16 +547,17 @@ } }, "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.840.0.tgz", - "integrity": "sha512-hiiMf7BP5ZkAFAvWRcK67Mw/g55ar7OCrvrynC92hunx/xhMkrgSLM0EXIZ1oTn3uql9kH/qqGF0nqsK6K555A==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.888.0.tgz", + "integrity": "sha512-ZkcUkoys8AdrNNG7ATjqw2WiXqrhTvT+r4CIK3KhOqIGPHX0p0DQWzqjaIl7ZhSUToKoZ4Ud7MjF795yUr73oA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@smithy/core": "^3.6.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@aws-sdk/util-endpoints": "3.887.0", + "@smithy/core": "^3.11.0", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -538,47 +565,48 @@ } }, "node_modules/@aws-sdk/nested-clients": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.840.0.tgz", - "integrity": "sha512-LXYYo9+n4hRqnRSIMXLBb+BLz+cEmjMtTudwK1BF6Bn2RfdDv29KuyeDRrPCS3TwKl7ZKmXUmE9n5UuHAPfBpA==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.888.0.tgz", + "integrity": "sha512-py4o4RPSGt+uwGvSBzR6S6cCBjS4oTX5F8hrHFHfPCdIOMVjyOBejn820jXkCrcdpSj3Qg1yUZXxsByvxc9Lyg==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/middleware-host-header": "3.840.0", - "@aws-sdk/middleware-logger": "3.840.0", - "@aws-sdk/middleware-recursion-detection": "3.840.0", - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/region-config-resolver": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@aws-sdk/util-user-agent-browser": "3.840.0", - "@aws-sdk/util-user-agent-node": "3.840.0", - "@smithy/config-resolver": "^4.1.4", - "@smithy/core": "^3.6.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/hash-node": "^4.0.4", - "@smithy/invalid-dependency": "^4.0.4", - "@smithy/middleware-content-length": "^4.0.4", - "@smithy/middleware-endpoint": "^4.1.13", - "@smithy/middleware-retry": "^4.1.14", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.21", - "@smithy/util-defaults-mode-node": "^4.0.21", - "@smithy/util-endpoints": "^3.0.6", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/middleware-host-header": "3.887.0", + "@aws-sdk/middleware-logger": "3.887.0", + "@aws-sdk/middleware-recursion-detection": "3.887.0", + "@aws-sdk/middleware-user-agent": "3.888.0", + "@aws-sdk/region-config-resolver": "3.887.0", + "@aws-sdk/types": "3.887.0", + "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-user-agent-browser": "3.887.0", + "@aws-sdk/util-user-agent-node": "3.888.0", + "@smithy/config-resolver": "^4.2.1", + "@smithy/core": "^3.11.0", + "@smithy/fetch-http-handler": "^5.2.1", + "@smithy/hash-node": "^4.1.1", + "@smithy/invalid-dependency": "^4.1.1", + "@smithy/middleware-content-length": "^4.1.1", + "@smithy/middleware-endpoint": "^4.2.1", + "@smithy/middleware-retry": "^4.2.1", + "@smithy/middleware-serde": "^4.1.1", + "@smithy/middleware-stack": "^4.1.1", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-http-handler": "^4.2.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-body-length-browser": "^4.1.0", + "@smithy/util-body-length-node": "^4.1.0", + "@smithy/util-defaults-mode-browser": "^4.1.1", + "@smithy/util-defaults-mode-node": "^4.1.1", + "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-retry": "^4.1.1", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -586,15 +614,16 @@ } }, "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.840.0.tgz", - "integrity": "sha512-Qjnxd/yDv9KpIMWr90ZDPtRj0v75AqGC92Lm9+oHXZ8p1MjG5JE2CW0HL8JRgK9iKzgKBL7pPQRXI8FkvEVfrA==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.887.0.tgz", + "integrity": "sha512-VdSMrIqJ3yjJb/fY+YAxrH/lCVv0iL8uA+lbMNfQGtO5tB3Zx6SU9LEpUwBNX8fPK1tUpI65CNE4w42+MY/7Mg==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.887.0", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/types": "^4.5.0", "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", + "@smithy/util-middleware": "^4.1.1", "tslib": "^2.6.2" }, "engines": { @@ -602,16 +631,17 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.840.0.tgz", - "integrity": "sha512-6BuTOLTXvmgwjK7ve7aTg9JaWFdM5UoMolLVPMyh3wTv9Ufalh8oklxYHUBIxsKkBGO2WiHXytveuxH6tAgTYg==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.888.0.tgz", + "integrity": "sha512-WA3NF+3W8GEuCMG1WvkDYbB4z10G3O8xuhT7QSjhvLYWQ9CPt3w4VpVIfdqmUn131TCIbhCzD0KN/1VJTjAjyw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/nested-clients": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@aws-sdk/core": "3.888.0", + "@aws-sdk/nested-clients": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -619,11 +649,12 @@ } }, "node_modules/@aws-sdk/types": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.840.0.tgz", - "integrity": "sha512-xliuHaUFZxEx1NSXeLLZ9Dyu6+EJVQKEoD+yM+zqUo3YDZ7medKJWY6fIOKiPX/N7XbLdBYwajb15Q7IL8KkeA==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.887.0.tgz", + "integrity": "sha512-fmTEJpUhsPsovQ12vZSpVTEP/IaRoJAMBGQXlQNjtCpkBp6Iq3KQDa/HDaPINE+3xxo6XvTdtibsNOd5zJLV9A==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -631,13 +662,15 @@ } }, "node_modules/@aws-sdk/util-endpoints": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.840.0.tgz", - "integrity": "sha512-eqE9ROdg/Kk0rj3poutyRCFauPDXIf/WSvCqFiRDDVi6QOnCv/M0g2XW8/jSvkJlOyaXkNCptapIp6BeeFFGYw==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.887.0.tgz", + "integrity": "sha512-kpegvT53KT33BMeIcGLPA65CQVxLUL/C3gTz9AzlU/SDmeusBHX4nRApAicNzI/ltQ5lxZXbQn18UczzBuwF1w==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/types": "^4.3.1", - "@smithy/util-endpoints": "^3.0.6", + "@aws-sdk/types": "3.887.0", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "@smithy/util-endpoints": "^3.1.1", "tslib": "^2.6.2" }, "engines": { @@ -645,9 +678,10 @@ } }, "node_modules/@aws-sdk/util-locate-window": { - "version": "3.804.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.804.0.tgz", - "integrity": "sha512-zVoRfpmBVPodYlnMjgVjfGoEZagyRF5IPn3Uo6ZvOZp24chnW/FRstH7ESDHDDRga4z3V+ElUQHKpFDXWyBW5A==", + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.873.0.tgz", + "integrity": "sha512-xcVhZF6svjM5Rj89T1WzkjQmrTF6dpR2UvIHPMTnSZoNe6CixejPZ6f0JJ2kAhO8H+dUHwNBlsUgOTIKiK/Syg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -656,25 +690,27 @@ } }, "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.840.0.tgz", - "integrity": "sha512-JdyZM3EhhL4PqwFpttZu1afDpPJCCc3eyZOLi+srpX11LsGj6sThf47TYQN75HT1CarZ7cCdQHGzP2uy3/xHfQ==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.887.0.tgz", + "integrity": "sha512-X71UmVsYc6ZTH4KU6hA5urOzYowSXc3qvroagJNLJYU1ilgZ529lP4J9XOYfEvTXkLR1hPFSRxa43SrwgelMjA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.887.0", + "@smithy/types": "^4.5.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.840.0.tgz", - "integrity": "sha512-Fy5JUEDQU1tPm2Yw/YqRYYc27W5+QD/J4mYvQvdWjUGZLB5q3eLFMGD35Uc28ZFoGMufPr4OCxK/bRfWROBRHQ==", + "version": "3.888.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.888.0.tgz", + "integrity": "sha512-rSB3OHyuKXotIGfYEo//9sU0lXAUrTY28SUUnxzOGYuQsAt0XR5iYwBAp+RjV6x8f+Hmtbg0PdCsy1iNAXa0UQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", + "@aws-sdk/middleware-user-agent": "3.888.0", + "@aws-sdk/types": "3.887.0", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -690,51 +726,78 @@ } }, "node_modules/@aws-sdk/xml-builder": { - "version": "3.821.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.821.0.tgz", - "integrity": "sha512-DIIotRnefVL6DiaHtO6/21DhJ4JZnnIwdNbpwiAhdt/AVbttcE4yw925gsjur0OGv5BTYXQXU3YnANBYnZjuQA==", + "version": "3.887.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.887.0.tgz", + "integrity": "sha512-lMwgWK1kNgUhHGfBvO/5uLe7TKhycwOn3eRCqsKPT9aPCx/HWuTlpcQp8oW2pCRGLS7qzcxqpQulcD+bbUL7XQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, + "node_modules/@aws/lambda-invoke-store": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.0.1.tgz", + "integrity": "sha512-ORHRQ2tmvnBXc8t/X9Z8IcSbBA4xTLKuN873FopzklHMeqBst7YG0d+AX97inkvDX+NChYtSr+qGfcqGFaI8Zw==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@babel/runtime": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", - "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, + "node_modules/@borewit/text-codec": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.0.tgz", + "integrity": "sha512-X999CKBxGwX8wW+4gFibsbiNdwqmdQEXmUejIWaIqdrHBgS5ARIOOeyiQbHjP9G58xVEPcuvP6VwwH3A0OFTOA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@cacheable/node-cache": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/@cacheable/node-cache/-/node-cache-1.5.8.tgz", - "integrity": "sha512-jGemkxcOnc/quqRVfulTiX+fbFXqACd+dzf45iL7xCe6Tyu4ZUyfcjY5nPOGSim/+pV/yM7QxUFn2HICo8RHQg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@cacheable/node-cache/-/node-cache-1.7.0.tgz", + "integrity": "sha512-B8hZe8tWh2wAA2W65NEDY6L7ksbg/7mm0dkI6NmHqd0LugILh64T3CakNOHpc9MiAc8SZl1qaFQGDx099dcjww==", + "license": "MIT", "dependencies": { - "cacheable": "^1.10.1", - "hookified": "^1.10.0", - "keyv": "^5.3.4" + "cacheable": "^1.10.4", + "hookified": "^1.11.0", + "keyv": "^5.5.0" + }, + "engines": { + "node": ">=18" } }, "node_modules/@emnapi/runtime": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.4.tgz", - "integrity": "sha512-hHyapA4A3gPaDCNfiqyZUStTMqIkKRshqPIuDOXv1hcBnD4U3l8cP0T1HMCfGRxQ6V64TGCcoswChANyOAwbQg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", + "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==", + "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.6.tgz", - "integrity": "sha512-ShbM/3XxwuxjFiuVBHA+d3j5dyac0aEVVq1oluIDf71hUw0aRF59dV/efUsIwFnR6m8JNM2FjZOzmaZ8yG61kw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", + "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "aix" @@ -744,12 +807,13 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.6.tgz", - "integrity": "sha512-S8ToEOVfg++AU/bHwdksHNnyLyVM+eMVAOf6yRKFitnwnbwwPNqKr3srzFRe7nzV69RQKb5DgchIX5pt3L53xg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz", + "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -759,12 +823,13 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.6.tgz", - "integrity": "sha512-hd5zdUarsK6strW+3Wxi5qWws+rJhCCbMiC9QZyzoxfk5uHRIE8T287giQxzVpEvCwuJ9Qjg6bEjcRJcgfLqoA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", + "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -774,12 +839,13 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.6.tgz", - "integrity": "sha512-0Z7KpHSr3VBIO9A/1wcT3NTy7EB4oNC4upJ5ye3R7taCc2GUdeynSLArnon5G8scPwaU866d3H4BCrE5xLW25A==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz", + "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -789,12 +855,13 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.6.tgz", - "integrity": "sha512-FFCssz3XBavjxcFxKsGy2DYK5VSvJqa6y5HXljKzhRZ87LvEi13brPrf/wdyl/BbpbMKJNOr1Sd0jtW4Ge1pAA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", + "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -804,12 +871,13 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.6.tgz", - "integrity": "sha512-GfXs5kry/TkGM2vKqK2oyiLFygJRqKVhawu3+DOCk7OxLy/6jYkWXhlHwOoTb0WqGnWGAS7sooxbZowy+pK9Yg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", + "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -819,12 +887,13 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.6.tgz", - "integrity": "sha512-aoLF2c3OvDn2XDTRvn8hN6DRzVVpDlj2B/F66clWd/FHLiHaG3aVZjxQX2DYphA5y/evbdGvC6Us13tvyt4pWg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", + "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -834,12 +903,13 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.6.tgz", - "integrity": "sha512-2SkqTjTSo2dYi/jzFbU9Plt1vk0+nNg8YC8rOXXea+iA3hfNJWebKYPs3xnOUf9+ZWhKAaxnQNUf2X9LOpeiMQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", + "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -849,12 +919,13 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.6.tgz", - "integrity": "sha512-SZHQlzvqv4Du5PrKE2faN0qlbsaW/3QQfUUc6yO2EjFcA83xnwm91UbEEVx4ApZ9Z5oG8Bxz4qPE+HFwtVcfyw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", + "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -864,12 +935,13 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.6.tgz", - "integrity": "sha512-b967hU0gqKd9Drsh/UuAm21Khpoh6mPBSgz8mKRq4P5mVK8bpA+hQzmm/ZwGVULSNBzKdZPQBRT3+WuVavcWsQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", + "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -879,12 +951,13 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.6.tgz", - "integrity": "sha512-aHWdQ2AAltRkLPOsKdi3xv0mZ8fUGPdlKEjIEhxCPm5yKEThcUjHpWB1idN74lfXGnZ5SULQSgtr5Qos5B0bPw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", + "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -894,12 +967,13 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.6.tgz", - "integrity": "sha512-VgKCsHdXRSQ7E1+QXGdRPlQ/e08bN6WMQb27/TMfV+vPjjTImuT9PmLXupRlC90S1JeNNW5lzkAEO/McKeJ2yg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", + "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -909,12 +983,13 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.6.tgz", - "integrity": "sha512-WViNlpivRKT9/py3kCmkHnn44GkGXVdXfdc4drNmRl15zVQ2+D2uFwdlGh6IuK5AAnGTo2qPB1Djppj+t78rzw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", + "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", "cpu": [ "mips64el" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -924,12 +999,13 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.6.tgz", - "integrity": "sha512-wyYKZ9NTdmAMb5730I38lBqVu6cKl4ZfYXIs31Baf8aoOtB4xSGi3THmDYt4BTFHk7/EcVixkOV2uZfwU3Q2Jw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", + "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -939,12 +1015,13 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.6.tgz", - "integrity": "sha512-KZh7bAGGcrinEj4qzilJ4hqTY3Dg2U82c8bv+e1xqNqZCrCyc+TL9AUEn5WGKDzm3CfC5RODE/qc96OcbIe33w==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", + "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -954,12 +1031,13 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.6.tgz", - "integrity": "sha512-9N1LsTwAuE9oj6lHMyyAM+ucxGiVnEqUdp4v7IaMmrwb06ZTEVCIs3oPPplVsnjPfyjmxwHxHMF8b6vzUVAUGw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", + "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -969,12 +1047,13 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.6.tgz", - "integrity": "sha512-A6bJB41b4lKFWRKNrWoP2LHsjVzNiaurf7wyj/XtFNTsnPuxwEBWHLty+ZE0dWBKuSK1fvKgrKaNjBS7qbFKig==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", + "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -984,12 +1063,13 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.6.tgz", - "integrity": "sha512-IjA+DcwoVpjEvyxZddDqBY+uJ2Snc6duLpjmkXm/v4xuS3H+3FkLZlDm9ZsAbF9rsfP3zeA0/ArNDORZgrxR/Q==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", + "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -999,12 +1079,13 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.6.tgz", - "integrity": "sha512-dUXuZr5WenIDlMHdMkvDc1FAu4xdWixTCRgP7RQLBOkkGgwuuzaGSYcOpW4jFxzpzL1ejb8yF620UxAqnBrR9g==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", + "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -1014,12 +1095,13 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.6.tgz", - "integrity": "sha512-l8ZCvXP0tbTJ3iaqdNf3pjaOSd5ex/e6/omLIQCVBLmHTlfXW3zAxQ4fnDmPLOB1x9xrcSi/xtCWFwCZRIaEwg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", + "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -1029,12 +1111,13 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.6.tgz", - "integrity": "sha512-hKrmDa0aOFOr71KQ/19JC7az1P0GWtCN1t2ahYAf4O007DHZt/dW8ym5+CUdJhQ/qkZmI1HAF8KkJbEFtCL7gw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", + "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -1044,12 +1127,13 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.6.tgz", - "integrity": "sha512-+SqBcAWoB1fYKmpWoQP4pGtx+pUUC//RNYhFdbcSA16617cchuryuhOCRpPsjCblKukAckWsV+aQ3UKT/RMPcA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", + "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "openharmony" @@ -1059,12 +1143,13 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.6.tgz", - "integrity": "sha512-dyCGxv1/Br7MiSC42qinGL8KkG4kX0pEsdb0+TKhmJZgCUDBGmyo1/ArCjNGiOLiIAgdbWgmWgib4HoCi5t7kA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", + "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "sunos" @@ -1074,12 +1159,13 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.6.tgz", - "integrity": "sha512-42QOgcZeZOvXfsCBJF5Afw73t4veOId//XD3i+/9gSkhSV6Gk3VPlWncctI+JcOyERv85FUo7RxuxGy+z8A43Q==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", + "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1089,12 +1175,13 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.6.tgz", - "integrity": "sha512-4AWhgXmDuYN7rJI6ORB+uU9DHLq/erBbuMoAuB4VWJTu5KtCgcKYPynF0YI1VkBNuEfjNlLrFr9KZPJzrtLkrQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", + "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1104,12 +1191,13 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.6.tgz", - "integrity": "sha512-NgJPHHbEpLQgDH2MjQu90pzW/5vvXIZ7KOnPyNBm92A6WgZ/7b6fJyUBjoumLqeOQQGqY2QjQxRo97ah4Sj0cA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", + "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1121,13 +1209,15 @@ "node_modules/@eshaz/web-worker": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@eshaz/web-worker/-/web-worker-1.2.2.tgz", - "integrity": "sha512-WxXiHFmD9u/owrzempiDlBB1ZYqiLnm9s6aPc8AlFQalq2tKmqdmMr9GXOupDgzXtqnBipj8Un0gkIm7Sjf8mw==" + "integrity": "sha512-WxXiHFmD9u/owrzempiDlBB1ZYqiLnm9s6aPc8AlFQalq2tKmqdmMr9GXOupDgzXtqnBipj8Un0gkIm7Sjf8mw==", + "license": "Apache-2.0" }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -1146,6 +1236,7 @@ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -1155,6 +1246,7 @@ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1178,6 +1270,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1188,6 +1281,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1200,6 +1294,7 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, + "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -1212,6 +1307,7 @@ "arm64" ], "hasInstallScript": true, + "license": "https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/HEAD:/LICENSE.md", "optional": true, "os": [ "darwin" @@ -1225,6 +1321,7 @@ "x64" ], "hasInstallScript": true, + "license": "LGPL-2.1", "optional": true, "os": [ "darwin" @@ -1234,6 +1331,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@ffmpeg-installer/ffmpeg/-/ffmpeg-1.1.0.tgz", "integrity": "sha512-Uq4rmwkdGxIa9A6Bd/VqqYbT7zqh1GrT5/rFwCwKM70b42W5gIjWeVETq6SdcL0zXqDtY081Ws/iJWhr1+xvQg==", + "license": "LGPL-2.1", "optionalDependencies": { "@ffmpeg-installer/darwin-arm64": "4.1.5", "@ffmpeg-installer/darwin-x64": "4.1.0", @@ -1253,6 +1351,7 @@ "arm" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1266,6 +1365,7 @@ "arm64" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1279,6 +1379,7 @@ "ia32" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1292,6 +1393,7 @@ "x64" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1304,6 +1406,7 @@ "cpu": [ "ia32" ], + "license": "GPLv3", "optional": true, "os": [ "win32" @@ -1316,6 +1419,7 @@ "cpu": [ "x64" ], + "license": "GPLv3", "optional": true, "os": [ "win32" @@ -1325,6 +1429,7 @@ "version": "1.1.17", "resolved": "https://registry.npmjs.org/@figuro/chatwoot-sdk/-/chatwoot-sdk-1.1.17.tgz", "integrity": "sha512-KfrBoMLMAan3379evYqmC2gUKYWGRJb0g+1EQZ44vUcDxOGlH5riddK1OB998Knvm0TYNZBqKhhwJHqDYBUpSw==", + "license": "MIT", "dependencies": { "axios": "^0.27.2" } @@ -1333,6 +1438,7 @@ "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -1342,6 +1448,7 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-10.0.1.tgz", "integrity": "sha512-ERcCZaEjdH3OgSJlyjVk8pHIFeus91CjKP3v+MpgBNp5IvGzP2l/bRiD78nqYcKPaZdbKkK5vDBVPd2ohHBlsA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^11.0.2" } @@ -1349,7 +1456,8 @@ "node_modules/@hapi/hoek": { "version": "11.0.7", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.7.tgz", - "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==" + "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==", + "license": "BSD-3-Clause" }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", @@ -1357,6 +1465,7 @@ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, + "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -1371,6 +1480,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1381,6 +1491,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1393,6 +1504,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -1406,15 +1518,17 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.2.tgz", - "integrity": "sha512-OfXHZPppddivUJnqyKoi5YVeHRkkNE2zUFT2gbpKxp/JZCFYEYubnMg+gOp6lWfasPrTS+KPosKqdI+ELYVDtg==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.3.tgz", + "integrity": "sha512-ryFMfvxxpQRsgZJqBd4wsttYQbCxsJksrv9Lw/v798JcQ8+w84mBWuXwl+TT0WJ/WrYOLaYpwQXi3sA9nTIaIg==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" @@ -1426,16 +1540,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.1.0" + "@img/sharp-libvips-darwin-arm64": "1.2.0" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.2.tgz", - "integrity": "sha512-dYvWqmjU9VxqXmjEtjmvHnGqF8GrVjM2Epj9rJ6BUIXvk8slvNDJbhGFvIoXzkDhrJC2jUxNLz/GUjjvSzfw+g==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.3.tgz", + "integrity": "sha512-yHpJYynROAj12TA6qil58hmPmAwxKKC7reUqtGLzsOHfP7/rniNGTL8tjWX6L3CTV4+5P4ypcS7Pp+7OB+8ihA==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" @@ -1447,16 +1562,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.1.0" + "@img/sharp-libvips-darwin-x64": "1.2.0" } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.1.0.tgz", - "integrity": "sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.0.tgz", + "integrity": "sha512-sBZmpwmxqwlqG9ueWFXtockhsxefaV6O84BMOrhtg/YqbTaRdqDE7hxraVE3y6gVM4eExmfzW4a8el9ArLeEiQ==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" @@ -1466,12 +1582,13 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.1.0.tgz", - "integrity": "sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.0.tgz", + "integrity": "sha512-M64XVuL94OgiNHa5/m2YvEQI5q2cl9d/wk0qFTDVXcYzi43lxuiFTftMR1tOnFQovVXNZJ5TURSDK2pNe9Yzqg==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" @@ -1481,12 +1598,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.1.0.tgz", - "integrity": "sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.0.tgz", + "integrity": "sha512-mWd2uWvDtL/nvIzThLq3fr2nnGfyr/XMXlq8ZJ9WMR6PXijHlC3ksp0IpuhK6bougvQrchUAfzRLnbsen0Cqvw==", "cpu": [ "arm" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1496,12 +1614,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.1.0.tgz", - "integrity": "sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.0.tgz", + "integrity": "sha512-RXwd0CgG+uPRX5YYrkzKyalt2OJYRiJQ8ED/fi1tq9WQW2jsQIn0tqrlR5l5dr/rjqq6AHAxURhj2DVjyQWSOA==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1511,12 +1630,13 @@ } }, "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.1.0.tgz", - "integrity": "sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.0.tgz", + "integrity": "sha512-Xod/7KaDDHkYu2phxxfeEPXfVXFKx70EAFZ0qyUdOjCcxbjqyJOEUpDe6RIyaunGxT34Anf9ue/wuWOqBW2WcQ==", "cpu": [ "ppc64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1526,12 +1646,13 @@ } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.1.0.tgz", - "integrity": "sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.0.tgz", + "integrity": "sha512-eMKfzDxLGT8mnmPJTNMcjfO33fLiTDsrMlUVcp6b96ETbnJmd4uvZxVJSKPQfS+odwfVaGifhsB07J1LynFehw==", "cpu": [ "s390x" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1541,12 +1662,13 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.1.0.tgz", - "integrity": "sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.0.tgz", + "integrity": "sha512-ZW3FPWIc7K1sH9E3nxIGB3y3dZkpJlMnkk7z5tu1nSkBoCgw2nSRTFHI5pB/3CQaJM0pdzMF3paf9ckKMSE9Tg==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1556,12 +1678,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.1.0.tgz", - "integrity": "sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.0.tgz", + "integrity": "sha512-UG+LqQJbf5VJ8NWJ5Z3tdIe/HXjuIdo4JeVNADXBFuG7z9zjoegpzzGIyV5zQKi4zaJjnAd2+g2nna8TZvuW9Q==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1571,12 +1694,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.1.0.tgz", - "integrity": "sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.0.tgz", + "integrity": "sha512-SRYOLR7CXPgNze8akZwjoGBoN1ThNZoqpOgfnOxmWsklTGVfJiGJoC/Lod7aNMGA1jSsKWM1+HRX43OP6p9+6Q==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1586,12 +1710,13 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.2.tgz", - "integrity": "sha512-0DZzkvuEOqQUP9mo2kjjKNok5AmnOr1jB2XYjkaoNRwpAYMDzRmAqUIa1nRi58S2WswqSfPOWLNOr0FDT3H5RQ==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.3.tgz", + "integrity": "sha512-oBK9l+h6KBN0i3dC8rYntLiVfW8D8wH+NPNT3O/WBHeW0OQWCjfWksLUaPidsrDKpJgXp3G3/hkmhptAW0I3+A==", "cpu": [ "arm" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1603,16 +1728,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.1.0" + "@img/sharp-libvips-linux-arm": "1.2.0" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.2.tgz", - "integrity": "sha512-D8n8wgWmPDakc83LORcfJepdOSN6MvWNzzz2ux0MnIbOqdieRZwVYY32zxVx+IFUT8er5KPcyU3XXsn+GzG/0Q==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.3.tgz", + "integrity": "sha512-QdrKe3EvQrqwkDrtuTIjI0bu6YEJHTgEeqdzI3uWJOH6G1O8Nl1iEeVYRGdj1h5I21CqxSvQp1Yv7xeU3ZewbA==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1624,16 +1750,39 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.1.0" + "@img/sharp-libvips-linux-arm64": "1.2.0" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.3.tgz", + "integrity": "sha512-GLtbLQMCNC5nxuImPR2+RgrviwKwVql28FWZIW1zWruy6zLgA5/x2ZXk3mxj58X/tszVF69KK0Is83V8YgWhLA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.0" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.2.tgz", - "integrity": "sha512-EGZ1xwhBI7dNISwxjChqBGELCWMGDvmxZXKjQRuqMrakhO8QoMgqCrdjnAqJq/CScxfRn+Bb7suXBElKQpPDiw==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.3.tgz", + "integrity": "sha512-3gahT+A6c4cdc2edhsLHmIOXMb17ltffJlxR0aC2VPZfwKoTGZec6u5GrFgdR7ciJSsHT27BD3TIuGcuRT0KmQ==", "cpu": [ "s390x" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1645,16 +1794,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.1.0" + "@img/sharp-libvips-linux-s390x": "1.2.0" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.2.tgz", - "integrity": "sha512-sD7J+h5nFLMMmOXYH4DD9UtSNBD05tWSSdWAcEyzqW8Cn5UxXvsHAxmxSesYUsTOBmUnjtxghKDl15EvfqLFbQ==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.3.tgz", + "integrity": "sha512-8kYso8d806ypnSq3/Ly0QEw90V5ZoHh10yH0HnrzOCr6DKAPI6QVHvwleqMkVQ0m+fc7EH8ah0BB0QPuWY6zJQ==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1666,16 +1816,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.1.0" + "@img/sharp-libvips-linux-x64": "1.2.0" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.2.tgz", - "integrity": "sha512-NEE2vQ6wcxYav1/A22OOxoSOGiKnNmDzCYFOZ949xFmrWZOVII1Bp3NqVVpvj+3UeHMFyN5eP/V5hzViQ5CZNA==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.3.tgz", + "integrity": "sha512-vAjbHDlr4izEiXM1OTggpCcPg9tn4YriK5vAjowJsHwdBIdx0fYRsURkxLG2RLm9gyBq66gwtWI8Gx0/ov+JKQ==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1687,16 +1838,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.1.0" + "@img/sharp-libvips-linuxmusl-arm64": "1.2.0" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.2.tgz", - "integrity": "sha512-DOYMrDm5E6/8bm/yQLCWyuDJwUnlevR8xtF8bs+gjZ7cyUNYXiSf/E8Kp0Ss5xasIaXSHzb888V1BE4i1hFhAA==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.3.tgz", + "integrity": "sha512-gCWUn9547K5bwvOn9l5XGAEjVTTRji4aPTqLzGXHvIr6bIDZKNTA34seMPgM0WmSf+RYBH411VavCejp3PkOeQ==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1708,19 +1860,20 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.1.0" + "@img/sharp-libvips-linuxmusl-x64": "1.2.0" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.2.tgz", - "integrity": "sha512-/VI4mdlJ9zkaq53MbIG6rZY+QRN3MLbR6usYlgITEzi4Rpx5S6LFKsycOQjkOGmqTNmkIdLjEvooFKwww6OpdQ==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.3.tgz", + "integrity": "sha512-+CyRcpagHMGteySaWos8IbnXcHgfDn7pO2fiC2slJxvNq9gDipYBN42/RagzctVRKgxATmfqOSulgZv5e1RdMg==", "cpu": [ "wasm32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.4.3" + "@emnapi/runtime": "^1.4.4" }, "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -1730,12 +1883,13 @@ } }, "node_modules/@img/sharp-win32-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.2.tgz", - "integrity": "sha512-cfP/r9FdS63VA5k0xiqaNaEoGxBg9k7uE+RQGzuK9fHt7jib4zAVVseR9LsE4gJcNWgT6APKMNnCcnyOtmSEUQ==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.3.tgz", + "integrity": "sha512-MjnHPnbqMXNC2UgeLJtX4XqoVHHlZNd+nPt1kRPmj63wURegwBhZlApELdtxM2OIZDRv/DFtLcNhVbd1z8GYXQ==", "cpu": [ "arm64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1748,12 +1902,13 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.2.tgz", - "integrity": "sha512-QLjGGvAbj0X/FXl8n1WbtQ6iVBpWU7JO94u/P2M4a8CFYsvQi4GW2mRy/JqkRx0qpBzaOdKJKw8uc930EX2AHw==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.3.tgz", + "integrity": "sha512-xuCdhH44WxuXgOM714hn4amodJMZl3OEvf0GVTm0BEyMeA2to+8HEdRPShH0SLYptJY1uBw+SCFP9WVQi1Q/cw==", "cpu": [ "ia32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1766,12 +1921,13 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.2.tgz", - "integrity": "sha512-aUdT6zEYtDKCaxkofmmJDJYGCf0+pJg3eU9/oBuqvEeoB9dKI6ZLc/1iLJCTuJQDO4ptntAlkUmHgGjyuobZbw==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.3.tgz", + "integrity": "sha512-OWwz05d++TxzLEv4VnsTz5CmZ6mI6S05sfQGEMrNrQcOEERbX46332IvE7pO/EUiw7jUrrS40z/M7kPyjfl04g==", "cpu": [ "x64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1787,6 +1943,7 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -1800,9 +1957,10 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1811,9 +1969,10 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1824,12 +1983,14 @@ "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -1843,9 +2004,10 @@ } }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -1860,6 +2022,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -1876,6 +2039,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/core/-/core-1.6.0.tgz", "integrity": "sha512-EQQlKU3s9QfdJqiSrZWNTxBs3rKXgO2W+GxNXDtwchF3a4IqxDheFX1ti+Env9hdJXDiYLp2jTRjlxhPthsk8w==", + "license": "MIT", "dependencies": { "@jimp/file-ops": "1.6.0", "@jimp/types": "1.6.0", @@ -1893,6 +2057,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -1904,6 +2069,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/diff/-/diff-1.6.0.tgz", "integrity": "sha512-+yUAQ5gvRC5D1WHYxjBHZI7JBRusGGSLf8AmPRPCenTzh4PA+wZ1xv2+cYqQwTfQHU5tXYOhA0xDytfHUf1Zyw==", + "license": "MIT", "dependencies": { "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", @@ -1918,6 +2084,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/file-ops/-/file-ops-1.6.0.tgz", "integrity": "sha512-Dx/bVDmgnRe1AlniRpCKrGRm5YvGmUwbDzt+MAkgmLGf+jvBT75hmMEZ003n9HQI/aPnm/YKnXjg/hOpzNCpHQ==", + "license": "MIT", "engines": { "node": ">=18" } @@ -1926,6 +2093,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-bmp/-/js-bmp-1.6.0.tgz", "integrity": "sha512-FU6Q5PC/e3yzLyBDXupR3SnL3htU7S3KEs4e6rjDP6gNEOXRFsWs6YD3hXuXd50jd8ummy+q2WSwuGkr8wi+Gw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1940,6 +2108,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-gif/-/js-gif-1.6.0.tgz", "integrity": "sha512-N9CZPHOrJTsAUoWkWZstLPpwT5AwJ0wge+47+ix3++SdSL/H2QzyMqxbcDYNFe4MoI5MIhATfb0/dl/wmX221g==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1954,6 +2123,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-jpeg/-/js-jpeg-1.6.0.tgz", "integrity": "sha512-6vgFDqeusblf5Pok6B2DUiMXplH8RhIKAryj1yn+007SIAQ0khM1Uptxmpku/0MfbClx2r7pnJv9gWpAEJdMVA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1967,6 +2137,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-png/-/js-png-1.6.0.tgz", "integrity": "sha512-AbQHScy3hDDgMRNfG0tPjL88AV6qKAILGReIa3ATpW5QFjBKpisvUaOqhzJ7Reic1oawx3Riyv152gaPfqsBVg==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1980,6 +2151,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-tiff/-/js-tiff-1.6.0.tgz", "integrity": "sha512-zhReR8/7KO+adijj3h0ZQUOiun3mXUv79zYEAKvE0O+rP7EhgtKvWJOZfRzdZSNv0Pu1rKtgM72qgtwe2tFvyw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1993,6 +2165,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-1.6.0.tgz", "integrity": "sha512-M+uRWl1csi7qilnSK8uxK4RJMSuVeBiO1AY0+7APnfUbQNZm6hCe0CCFv1Iyw1D/Dhb8ph8fQgm5mwM0eSxgVA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", @@ -2006,6 +2179,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-1.6.0.tgz", "integrity": "sha512-zrM7iic1OTwUCb0g/rN5y+UnmdEsT3IfuCXCJJNs8SZzP0MkZ1eTvuwK9ZidCuMo4+J3xkzCidRwYXB5CyGZTw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/utils": "1.6.0" @@ -2018,6 +2192,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-1.6.0.tgz", "integrity": "sha512-xt1Gp+LtdMKAXfDp3HNaG30SPZW6AQ7dtAtTnoRKorRi+5yCJjKqXRgkewS5bvj8DEh87Ko1ydJfzqS3P2tdWw==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" @@ -2030,6 +2205,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-1.6.0.tgz", "integrity": "sha512-J5q8IVCpkBsxIXM+45XOXTrsyfblyMZg3a9eAo0P7VPH4+CrvyNQwaYatbAIamSIN1YzxmO3DkIZXzRjFSz1SA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -2045,6 +2221,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-1.6.0.tgz", "integrity": "sha512-oN/n+Vdq/Qg9bB4yOBOxtY9IPAtEfES8J1n9Ddx+XhGBYT1/QTU/JYkGaAkIGoPnyYvmLEDqMz2SGihqlpqfzQ==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-blit": "1.6.0", @@ -2061,6 +2238,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-1.6.0.tgz", "integrity": "sha512-Iow0h6yqSC269YUJ8HC3Q/MpCi2V55sMlbkkTTx4zPvd8mWZlC0ykrNDeAy9IJegrQ7v5E99rJwmQu25lygKLA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-crop": "1.6.0", @@ -2076,6 +2254,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-1.6.0.tgz", "integrity": "sha512-KqZkEhvs+21USdySCUDI+GFa393eDIzbi1smBqkUPTE+pRwSWMAf01D5OC3ZWB+xZsNla93BDS9iCkLHA8wang==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -2090,6 +2269,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-1.6.0.tgz", "integrity": "sha512-4Y10X9qwr5F+Bo5ME356XSACEF55485j5nGdiyJ9hYzjQP9nGgxNJaZ4SAOqpd+k5sFaIeD7SQ0Occ26uIng5Q==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", @@ -2103,6 +2283,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-1.6.0.tgz", "integrity": "sha512-600d1RxY0pKwgyU0tgMahLNKsqEcxGdbgXadCiVCoGd6V6glyCvkNrnnwC0n5aJ56Htkj88PToSdF88tNVZEEQ==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0" }, @@ -2114,6 +2295,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-1.6.0.tgz", "integrity": "sha512-E5QHKWSCBFtpgZarlmN3Q6+rTQxjirFqo44ohoTjzYVrDI6B6beXNnPIThJgPr0Y9GwfzgyarKvQuQuqCnnfbA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", @@ -2127,6 +2309,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-1.6.0.tgz", "integrity": "sha512-/+rJVDuBIVOgwoyVkBjUFHtP+wmW0r+r5OQ2GpatQofToPVbJw1DdYWXlwviSx7hvixTWLKVgRWQ5Dw862emDg==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" @@ -2139,6 +2322,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-hash/-/plugin-hash-1.6.0.tgz", "integrity": "sha512-wWzl0kTpDJgYVbZdajTf+4NBSKvmI3bRI8q6EH9CVeIHps9VWVsUvEyb7rpbcwVLWYuzDtP2R0lTT6WeBNQH9Q==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/js-bmp": "1.6.0", @@ -2159,6 +2343,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-1.6.0.tgz", "integrity": "sha512-Cwy7ExSJMZszvkad8NV8o/Z92X2kFUFM8mcDAhNVxU0Q6tA0op2UKRJY51eoK8r6eds/qak3FQkXakvNabdLnA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" @@ -2171,6 +2356,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-1.6.0.tgz", "integrity": "sha512-zarTIJi8fjoGMSI/M3Xh5yY9T65p03XJmPsuNet19K/Q7mwRU6EV2pfj+28++2PV2NJ+htDF5uecAlnGyxFN2A==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/js-jpeg": "1.6.0", @@ -2191,6 +2377,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-quantize/-/plugin-quantize-1.6.0.tgz", "integrity": "sha512-EmzZ/s9StYQwbpG6rUGBCisc3f64JIhSH+ncTJd+iFGtGo0YvSeMdAd+zqgiHpfZoOL54dNavZNjF4otK+mvlg==", + "license": "MIT", "dependencies": { "image-q": "^4.0.0", "zod": "^3.23.8" @@ -2203,6 +2390,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-1.6.0.tgz", "integrity": "sha512-uSUD1mqXN9i1SGSz5ov3keRZ7S9L32/mAQG08wUwZiEi5FpbV0K8A8l1zkazAIZi9IJzLlTauRNU41Mi8IF9fA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -2216,6 +2404,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-1.6.0.tgz", "integrity": "sha512-JagdjBLnUZGSG4xjCLkIpQOZZ3Mjbg8aGCCi4G69qR+OjNpOeGI7N2EQlfK/WE8BEHOW5vdjSyglNqcYbQBWRw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-crop": "1.6.0", @@ -2232,6 +2421,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-1.6.0.tgz", "integrity": "sha512-M59m5dzLoHOVWdM41O8z9SyySzcDn43xHseOH0HavjsfQsT56GGCC4QzU1banJidbUrePhzoEdS42uFE8Fei8w==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-color": "1.6.0", @@ -2248,6 +2438,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/types/-/types-1.6.0.tgz", "integrity": "sha512-7UfRsiKo5GZTAATxm2qQ7jqmUXP0DxTArztllTcYdyw6Xi5oT4RaoXynVtCD4UyLK5gJgkZJcwonoijrhYFKfg==", + "license": "MIT", "dependencies": { "zod": "^3.23.8" }, @@ -2259,6 +2450,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-1.6.0.tgz", "integrity": "sha512-gqFTGEosKbOkYF/WFj26jMHOI5OH2jeP1MmC/zbK6BF6VJBf8rIC5898dPfSzZEbSA0wbbV5slbntWVc5PKLFA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "tinycolor2": "^1.6.0" @@ -2268,48 +2460,51 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz", - "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/gen-mapping/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.29", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz", - "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", - "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==" + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } }, "node_modules/@keyv/serialize": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.0.3.tgz", - "integrity": "sha512-qnEovoOp5Np2JDGonIDL6Ayihw0RhnRh6vxPuHo4RDn1UOzwEo4AeIfpL6UGIrsceWrCMiVPgwRjbHu4vYFc3g==", - "dependencies": { - "buffer": "^6.0.3" - } + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==", + "license": "MIT" }, "node_modules/@noble/hashes": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -2322,6 +2517,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2335,6 +2531,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -2344,6 +2541,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2356,6 +2554,7 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", "engines": { "node": ">=8.0.0" } @@ -2364,6 +2563,7 @@ "version": "0.57.2", "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.2.tgz", "integrity": "sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.3.0" }, @@ -2375,6 +2575,7 @@ "version": "1.30.1", "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.1.tgz", "integrity": "sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==", + "license": "Apache-2.0", "engines": { "node": ">=14" }, @@ -2386,6 +2587,7 @@ "version": "1.30.1", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.30.1.tgz", "integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.28.0" }, @@ -2400,6 +2602,7 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", + "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2408,6 +2611,7 @@ "version": "0.57.2", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.2.tgz", "integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.57.2", "@types/shimmer": "^1.2.0", @@ -2427,6 +2631,7 @@ "version": "0.46.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.46.1.tgz", "integrity": "sha512-AyXVnlCf/xV3K/rNumzKxZqsULyITJH6OVLiW6730JPRqWA7Zc9bvYoVNpN6iOpTU8CasH34SU/ksVJmObFibQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.1", @@ -2443,6 +2648,7 @@ "version": "0.43.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.43.0.tgz", "integrity": "sha512-Q57JGpH6T4dkYHo9tKXONgLtxzsh1ZEW5M9A/OwKrZFyEpLqWgjhcZ3hIuVvDlhb426iDF1f9FPToV/mi5rpeA==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2460,6 +2666,7 @@ "version": "0.16.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.16.0.tgz", "integrity": "sha512-88+qCHZC02up8PwKHk0UQKLLqGGURzS3hFQBZC7PnGwReuoKjHXS1o29H58S+QkXJpkTr2GACbx8j6mUoGjNPA==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0" }, @@ -2474,6 +2681,7 @@ "version": "0.47.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.47.0.tgz", "integrity": "sha512-XFWVx6k0XlU8lu6cBlCa29ONtVt6ADEjmxtyAyeF2+rifk8uBJbk1La0yIVfI0DoKURGbaEDTNelaXG9l/lNNQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2490,6 +2698,7 @@ "version": "0.44.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.44.1.tgz", "integrity": "sha512-RoVeMGKcNttNfXMSl6W4fsYoCAYP1vi6ZAWIGhBY+o7R9Y0afA7f9JJL0j8LHbyb0P0QhSYk+6O56OwI2k4iRQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2506,6 +2715,7 @@ "version": "0.19.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.19.0.tgz", "integrity": "sha512-JGwmHhBkRT2G/BYNV1aGI+bBjJu4fJUD/5/Jat0EWZa2ftrLV3YE8z84Fiij/wK32oMZ88eS8DI4ecLGZhpqsQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0" @@ -2521,6 +2731,7 @@ "version": "0.43.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.43.0.tgz", "integrity": "sha512-at8GceTtNxD1NfFKGAuwtqM41ot/TpcLh+YsGe4dhf7gvv1HW/ZWdq6nfRtS6UjIvZJOokViqLPJ3GVtZItAnQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0" }, @@ -2535,6 +2746,7 @@ "version": "0.47.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.47.0.tgz", "integrity": "sha512-Cc8SMf+nLqp0fi8oAnooNEfwZWFnzMiBHCGmDFYqmgjPylyLmi83b+NiTns/rKGwlErpW0AGPt0sMpkbNlzn8w==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0" }, @@ -2549,6 +2761,7 @@ "version": "0.45.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.45.1.tgz", "integrity": "sha512-VH6mU3YqAKTePPfUPwfq4/xr049774qWtfTuJqVHoVspCLiT3bW+fCQ1toZxt6cxRPYASoYaBsMA3CWo8B8rcw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2565,6 +2778,7 @@ "version": "0.57.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.57.1.tgz", "integrity": "sha512-ThLmzAQDs7b/tdKI3BV2+yawuF09jF111OFsovqT1Qj3D8vjwKBwhi/rDE5xethwn4tSXtZcJ9hBsVAlWFQZ7g==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/instrumentation": "0.57.1", @@ -2583,6 +2797,7 @@ "version": "0.57.1", "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.1.tgz", "integrity": "sha512-I4PHczeujhQAQv6ZBzqHYEUiggZL4IdSMixtVD3EYqbdrjujE7kRfI5QohjlPoJm8BvenoW5YaTMWRrbpot6tg==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.3.0" }, @@ -2594,6 +2809,7 @@ "version": "0.57.1", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.1.tgz", "integrity": "sha512-SgHEKXoVxOjc20ZYusPG3Fh+RLIZTSa4x8QtD3NfgAUDyqdFFS9W1F2ZVbZkqDCdyMcQG02Ok4duUGLHJXHgbA==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.57.1", "@types/shimmer": "^1.2.0", @@ -2613,6 +2829,7 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", + "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2621,6 +2838,7 @@ "version": "0.47.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.47.0.tgz", "integrity": "sha512-4HqP9IBC8e7pW9p90P3q4ox0XlbLGme65YTrA3UTLvqvo4Z6b0puqZQP203YFu8m9rE/luLfaG7/xrwwqMUpJw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/redis-common": "^0.36.2", @@ -2637,6 +2855,7 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.7.0.tgz", "integrity": "sha512-LB+3xiNzc034zHfCtgs4ITWhq6Xvdo8bsq7amR058jZlf2aXXDrN9SV4si4z2ya9QX4tz6r4eZJwDkXOp14/AQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0" @@ -2652,6 +2871,7 @@ "version": "0.44.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.44.0.tgz", "integrity": "sha512-SlT0+bLA0Lg3VthGje+bSZatlGHw/vwgQywx0R/5u9QC59FddTQSPJeWNw29M6f8ScORMeUOOTwihlQAn4GkJQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0" @@ -2667,6 +2887,7 @@ "version": "0.47.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.47.0.tgz", "integrity": "sha512-HFdvqf2+w8sWOuwtEXayGzdZ2vWpCKEQv5F7+2DSA74Te/Cv4rvb2E5So5/lh+ok4/RAIPuvCbCb/SHQFzMmbw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2683,6 +2904,7 @@ "version": "0.44.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.44.0.tgz", "integrity": "sha512-Tn7emHAlvYDFik3vGU0mdwvWJDwtITtkJ+5eT2cUquct6nIs+H8M47sqMJkCpyPe5QIBJoTOHxmc6mj9lz6zDw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0" }, @@ -2697,6 +2919,7 @@ "version": "0.51.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.51.0.tgz", "integrity": "sha512-cMKASxCX4aFxesoj3WK8uoQ0YUrRvnfxaO72QWI2xLu5ZtgX/QvdGBlU3Ehdond5eb74c2s1cqRQUIptBnKz1g==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0" @@ -2712,6 +2935,7 @@ "version": "0.46.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.46.0.tgz", "integrity": "sha512-mtVv6UeaaSaWTeZtLo4cx4P5/ING2obSqfWGItIFSunQBrYROfhuVe7wdIrFUs2RH1tn2YYpAJyMaRe/bnTTIQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2728,6 +2952,7 @@ "version": "0.45.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.45.0.tgz", "integrity": "sha512-tWWyymgwYcTwZ4t8/rLDfPYbOTF3oYB8SxnYMtIQ1zEf5uDm90Ku3i6U/vhaMyfHNlIHvDhvJh+qx5Nc4Z3Acg==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0", @@ -2744,6 +2969,7 @@ "version": "0.45.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.45.0.tgz", "integrity": "sha512-qLslv/EPuLj0IXFvcE3b0EqhWI8LKmrgRPIa4gUd8DllbBpqJAvLNJSv3cC6vWwovpbSI3bagNO/3Q2SuXv2xA==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0", @@ -2760,6 +2986,7 @@ "version": "0.44.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.44.0.tgz", "integrity": "sha512-t16pQ7A4WYu1yyQJZhRKIfUNvl5PAaF2pEteLvgJb/BWdd1oNuU1rOYt4S825kMy+0q4ngiX281Ss9qiwHfxFQ==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0" @@ -2775,6 +3002,7 @@ "version": "0.50.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.50.0.tgz", "integrity": "sha512-TtLxDdYZmBhFswm8UIsrDjh/HFBeDXd4BLmE8h2MxirNHewLJ0VS9UUddKKEverb5Sm2qFVjqRjcU+8Iw4FJ3w==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.26.0", "@opentelemetry/instrumentation": "^0.57.0", @@ -2794,6 +3022,7 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2802,6 +3031,7 @@ "version": "0.46.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.46.0.tgz", "integrity": "sha512-aTUWbzbFMFeRODn3720TZO0tsh/49T8H3h8vVnVKJ+yE36AeW38Uj/8zykQ/9nO8Vrtjr5yKuX3uMiG/W8FKNw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/redis-common": "^0.36.2", @@ -2818,6 +3048,7 @@ "version": "0.18.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.18.0.tgz", "integrity": "sha512-9zhjDpUDOtD+coeADnYEJQ0IeLVCj7w/hqzIutdp5NqS1VqTAanaEfsEcSypyvYv5DX3YOsTUoF+nr2wDXPETA==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/instrumentation": "^0.57.0", "@opentelemetry/semantic-conventions": "^1.27.0", @@ -2834,6 +3065,7 @@ "version": "0.10.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.10.0.tgz", "integrity": "sha512-vm+V255NGw9gaSsPD6CP0oGo8L55BffBc8KnxqsMuc6XiAD1L8SFNzsW0RHhxJFqy9CJaJh+YiJ5EHXuZ5rZBw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.57.0" @@ -2849,6 +3081,7 @@ "version": "0.36.2", "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", + "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2857,6 +3090,7 @@ "version": "1.30.1", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.30.1.tgz", "integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/semantic-conventions": "1.28.0" @@ -2872,6 +3106,7 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", + "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2880,6 +3115,7 @@ "version": "1.30.1", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.1.tgz", "integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/resources": "1.30.1", @@ -2896,14 +3132,16 @@ "version": "1.28.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", + "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.34.0.tgz", - "integrity": "sha512-aKcOkyrorBGlajjRdVoJWHTxfxO1vCNHLJVlSDaRHDIdjU+pX8IYQPvPDkYiujKLbRnWU+1TBwEt0QRgSm4SGA==", + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.37.0.tgz", + "integrity": "sha512-JD6DerIKdJGmRp4jQyX5FlrQjA4tjOw1cvfsPAZXfOOEErMUHjPcPSICS+6WnM0nB0efSFARh0KAZss+bvExOA==", + "license": "Apache-2.0", "engines": { "node": ">=14" } @@ -2912,6 +3150,7 @@ "version": "0.40.1", "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^1.1.0" }, @@ -2926,6 +3165,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "license": "MIT", "dependencies": { "@noble/hashes": "^1.1.5" } @@ -2934,16 +3174,18 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", "optional": true, "engines": { "node": ">=14" } }, "node_modules/@pkgr/core": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.7.tgz", - "integrity": "sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -2952,10 +3194,11 @@ } }, "node_modules/@prisma/client": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.11.1.tgz", - "integrity": "sha512-5CLFh8QP6KxRm83pJ84jaVCeSVPQr8k0L2SEtOJHwdkS57/VQDcI/wQpGmdyOZi+D9gdNabdo8tj1Uk+w+upsQ==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.1.tgz", + "integrity": "sha512-QaBCOY29lLAxEFFJgBPyW3WInCW52fJeQTmWx/h6YsP5u0bwuqP51aP0uhqFvhK9DaZPwvai/M4tSDYLVE9vRg==", "hasInstallScript": true, + "license": "Apache-2.0", "engines": { "node": ">=18.18" }, @@ -2973,57 +3216,67 @@ } }, "node_modules/@prisma/config": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.11.1.tgz", - "integrity": "sha512-z6rCTQN741wxDq82cpdzx2uVykpnQIXalLhrWQSR0jlBVOxCIkz3HZnd8ern3uYTcWKfB3IpVAF7K2FU8t/8AQ==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.16.1.tgz", + "integrity": "sha512-sz3uxRPNL62QrJ0EYiujCFkIGZ3hg+9hgC1Ae1HjoYuj0BxCqHua4JNijYvYCrh9LlofZDZcRBX3tHBfLvAngA==", + "license": "Apache-2.0", "dependencies": { - "jiti": "2.4.2" + "c12": "3.1.0", + "deepmerge-ts": "7.1.5", + "effect": "3.16.12", + "empathic": "2.0.0" } }, "node_modules/@prisma/debug": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.11.1.tgz", - "integrity": "sha512-lWRb/YSWu8l4Yum1UXfGLtqFzZkVS2ygkWYpgkbgMHn9XJlMITIgeMvJyX5GepChzhmxuSuiq/MY/kGFweOpGw==" + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.16.1.tgz", + "integrity": "sha512-RWv/VisW5vJE4cDRTuAHeVedtGoItXTnhuLHsSlJ9202QKz60uiXWywBlVcqXVq8bFeIZoCoWH+R1duZJPwqLw==", + "license": "Apache-2.0" }, "node_modules/@prisma/engines": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.11.1.tgz", - "integrity": "sha512-6eKEcV6V8W2eZAUwX2xTktxqPM4vnx3sxz3SDtpZwjHKpC6lhOtc4vtAtFUuf5+eEqBk+dbJ9Dcaj6uQU+FNNg==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.16.1.tgz", + "integrity": "sha512-EOnEM5HlosPudBqbI+jipmaW/vQEaF0bKBo4gVkGabasINHR6RpC6h44fKZEqx4GD8CvH+einD2+b49DQrwrAg==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.11.1", - "@prisma/engines-version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", - "@prisma/fetch-engine": "6.11.1", - "@prisma/get-platform": "6.11.1" + "@prisma/debug": "6.16.1", + "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", + "@prisma/fetch-engine": "6.16.1", + "@prisma/get-platform": "6.16.1" } }, "node_modules/@prisma/engines-version": { - "version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9.tgz", - "integrity": "sha512-swFJTOOg4tHyOM1zB/pHb3MeH0i6t7jFKn5l+ZsB23d9AQACuIRo9MouvuKGvnDogzkcjbWnXi/NvOZ0+n5Jfw==" + "version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43.tgz", + "integrity": "sha512-ThvlDaKIVrnrv97ujNFDYiQbeMQpLa0O86HFA2mNoip4mtFqM7U5GSz2ie1i2xByZtvPztJlNRgPsXGeM/kqAA==", + "license": "Apache-2.0" }, "node_modules/@prisma/fetch-engine": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.11.1.tgz", - "integrity": "sha512-NBYzmkXTkj9+LxNPRSndaAeALOL1Gr3tjvgRYNqruIPlZ6/ixLeuE/5boYOewant58tnaYFZ5Ne0jFBPfGXHpQ==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.16.1.tgz", + "integrity": "sha512-fl/PKQ8da5YTayw86WD3O9OmKJEM43gD3vANy2hS5S1CnfW2oPXk+Q03+gUWqcKK306QqhjjIHRFuTZ31WaosQ==", + "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.11.1", - "@prisma/engines-version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", - "@prisma/get-platform": "6.11.1" + "@prisma/debug": "6.16.1", + "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", + "@prisma/get-platform": "6.16.1" } }, "node_modules/@prisma/get-platform": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.11.1.tgz", - "integrity": "sha512-b2Z8oV2gwvdCkFemBTFd0x4lsL4O2jLSx8lB7D+XqoFALOQZPa7eAPE1NU0Mj1V8gPHRxIsHnyUNtw2i92psUw==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.16.1.tgz", + "integrity": "sha512-kUfg4vagBG7dnaGRcGd1c0ytQFcDj2SUABiuveIpL3bthFdTLI6PJeLEia6Q8Dgh+WhPdo0N2q0Fzjk63XTyaA==", + "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.11.1" + "@prisma/debug": "6.16.1" } }, "node_modules/@prisma/instrumentation": { "version": "5.22.0", "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-5.22.0.tgz", "integrity": "sha512-LxccF392NN37ISGxIurUljZSh1YWnphO34V5a0+T7FVQG2u9bhAXRTJpgmQ3483woVhkraQZFF7cbRrpbw/F4Q==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.8", "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0", @@ -3034,6 +3287,7 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.0.0" }, @@ -3045,6 +3299,7 @@ "version": "0.53.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.53.0", "@types/shimmer": "^1.2.0", @@ -3063,27 +3318,32 @@ "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -3092,32 +3352,38 @@ "node_modules/@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" }, "node_modules/@redis/bloom": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3126,6 +3392,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.1.tgz", "integrity": "sha512-/KCsg3xSlR+nCK8/8ZYSknYxvXHwubJrU82F3Lm1Fp6789VQ0/3RJKfsmRXjqfaTA++23CvC3hqmqe/2GEt6Kw==", + "license": "MIT", "dependencies": { "cluster-key-slot": "1.1.2", "generic-pool": "3.9.0", @@ -3139,6 +3406,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3147,6 +3415,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3155,6 +3424,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3163,245 +3433,279 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.2.tgz", - "integrity": "sha512-g0dF8P1e2QYPOj1gu7s/3LVP6kze9A7m6x0BZ9iTdXK8N5c2V7cpBKHV3/9A4Zd8xxavdhK0t4PnqjkqVmUc9Q==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.2.tgz", + "integrity": "sha512-uLN8NAiFVIRKX9ZQha8wy6UUs06UNSZ32xj6giK/rmMXAgKahwExvK6SsmgU5/brh4w/nSgj8e0k3c1HBQpa0A==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.44.2.tgz", - "integrity": "sha512-Yt5MKrOosSbSaAK5Y4J+vSiID57sOvpBNBR6K7xAaQvk3MkcNVV0f9fE20T+41WYN8hDn6SGFlFrKudtx4EoxA==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.2.tgz", + "integrity": "sha512-oEouqQk2/zxxj22PNcGSskya+3kV0ZKH+nQxuCCOGJ4oTXBdNTbv+f/E3c74cNLeMO1S5wVWacSws10TTSB77g==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.44.2.tgz", - "integrity": "sha512-EsnFot9ZieM35YNA26nhbLTJBHD0jTwWpPwmRVDzjylQT6gkar+zenfb8mHxWpRrbn+WytRRjE0WKsfaxBkVUA==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.2.tgz", + "integrity": "sha512-OZuTVTpj3CDSIxmPgGH8en/XtirV5nfljHZ3wrNwvgkT5DQLhIKAeuFSiwtbMto6oVexV0k1F1zqURPKf5rI1Q==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.44.2.tgz", - "integrity": "sha512-dv/t1t1RkCvJdWWxQ2lWOO+b7cMsVw5YFaS04oHpZRWehI1h0fV1gF4wgGCTyQHHjJDfbNpwOi6PXEafRBBezw==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.2.tgz", + "integrity": "sha512-Wa/Wn8RFkIkr1vy1k1PB//VYhLnlnn5eaJkfTQKivirOvzu5uVd2It01ukeQstMursuz7S1bU+8WW+1UPXpa8A==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.44.2.tgz", - "integrity": "sha512-W4tt4BLorKND4qeHElxDoim0+BsprFTwb+vriVQnFFtT/P6v/xO5I99xvYnVzKWrK6j7Hb0yp3x7V5LUbaeOMg==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.2.tgz", + "integrity": "sha512-QkzxvH3kYN9J1w7D1A+yIMdI1pPekD+pWx7G5rXgnIlQ1TVYVC6hLl7SOV9pi5q9uIDF9AuIGkuzcbF7+fAhow==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.44.2.tgz", - "integrity": "sha512-tdT1PHopokkuBVyHjvYehnIe20fxibxFCEhQP/96MDSOcyjM/shlTkZZLOufV3qO6/FQOSiJTBebhVc12JyPTA==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.2.tgz", + "integrity": "sha512-dkYXB0c2XAS3a3jmyDkX4Jk0m7gWLFzq1C3qUnJJ38AyxIF5G/dyS4N9B30nvFseCfgtCEdbYFhk0ChoCGxPog==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.44.2.tgz", - "integrity": "sha512-+xmiDGGaSfIIOXMzkhJ++Oa0Gwvl9oXUeIiwarsdRXSe27HUIvjbSIpPxvnNsRebsNdUo7uAiQVgBD1hVriwSQ==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.2.tgz", + "integrity": "sha512-9VlPY/BN3AgbukfVHAB8zNFWB/lKEuvzRo1NKev0Po8sYFKx0i+AQlCYftgEjcL43F2h9Ui1ZSdVBc4En/sP2w==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.44.2.tgz", - "integrity": "sha512-bDHvhzOfORk3wt8yxIra8N4k/N0MnKInCW5OGZaeDYa/hMrdPaJzo7CSkjKZqX4JFUWjUGm88lI6QJLCM7lDrA==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.2.tgz", + "integrity": "sha512-+GdKWOvsifaYNlIVf07QYan1J5F141+vGm5/Y8b9uCZnG/nxoGqgCmR24mv0koIWWuqvFYnbURRqw1lv7IBINw==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.44.2.tgz", - "integrity": "sha512-NMsDEsDiYghTbeZWEGnNi4F0hSbGnsuOG+VnNvxkKg0IGDvFh7UVpM/14mnMwxRxUf9AdAVJgHPvKXf6FpMB7A==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.2.tgz", + "integrity": "sha512-df0Eou14ojtUdLQdPFnymEQteENwSJAdLf5KCDrmZNsy1c3YaCNaJvYsEUHnrg+/DLBH612/R0xd3dD03uz2dg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.44.2.tgz", - "integrity": "sha512-lb5bxXnxXglVq+7imxykIp5xMq+idehfl+wOgiiix0191av84OqbjUED+PRC5OA8eFJYj5xAGcpAZ0pF2MnW+A==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.2.tgz", + "integrity": "sha512-iPeouV0UIDtz8j1YFR4OJ/zf7evjauqv7jQ/EFs0ClIyL+by++hiaDAfFipjOgyz6y6xbDvJuiU4HwpVMpRFDQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, - "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.44.2.tgz", - "integrity": "sha512-Yl5Rdpf9pIc4GW1PmkUGHdMtbx0fBLE1//SxDmuf3X0dUC57+zMepow2LK0V21661cjXdTn8hO2tXDdAWAqE5g==", + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.50.2.tgz", + "integrity": "sha512-OL6KaNvBopLlj5fTa5D5bau4W82f+1TyTZRr2BdnfsrnQnmdxh4okMxR2DcDkJuh4KeoQZVuvHvzuD/lyLn2Kw==", "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.44.2.tgz", - "integrity": "sha512-03vUDH+w55s680YYryyr78jsO1RWU9ocRMaeV2vMniJJW/6HhoTBwyyiiTPVHNWLnhsnwcQ0oH3S9JSBEKuyqw==", + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.2.tgz", + "integrity": "sha512-I21VJl1w6z/K5OTRl6aS9DDsqezEZ/yKpbqlvfHbW0CEF5IL8ATBMuUx6/mp683rKTK8thjs/0BaNrZLXetLag==", "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.44.2.tgz", - "integrity": "sha512-iYtAqBg5eEMG4dEfVlkqo05xMOk6y/JXIToRca2bAWuqjrJYJlx/I7+Z+4hSrsWU8GdJDFPL4ktV3dy4yBSrzg==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.2.tgz", + "integrity": "sha512-Hq6aQJT/qFFHrYMjS20nV+9SKrXL2lvFBENZoKfoTH2kKDOJqff5OSJr4x72ZaG/uUn+XmBnGhfr4lwMRrmqCQ==", "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.44.2.tgz", - "integrity": "sha512-e6vEbgaaqz2yEHqtkPXa28fFuBGmUJ0N2dOJK8YUfijejInt9gfCSA7YDdJ4nYlv67JfP3+PSWFX4IVw/xRIPg==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.2.tgz", + "integrity": "sha512-82rBSEXRv5qtKyr0xZ/YMF531oj2AIpLZkeNYxmKNN6I2sVE9PGegN99tYDLK2fYHJITL1P2Lgb4ZXnv0PjQvw==", "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.44.2.tgz", - "integrity": "sha512-evFOtkmVdY3udE+0QKrV5wBx7bKI0iHz5yEVx5WqDJkxp9YQefy4Mpx3RajIVcM6o7jxTvVd/qpC1IXUhGc1Mw==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.2.tgz", + "integrity": "sha512-4Q3S3Hy7pC6uaRo9gtXUTJ+EKo9AKs3BXKc2jYypEcMQ49gDPFU2P1ariX9SEtBzE5egIX6fSUmbmGazwBVF9w==", "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.2.tgz", - "integrity": "sha512-/bXb0bEsWMyEkIsUL2Yt5nFB5naLAwyOWMEviQfQY1x3l5WsLKgvZf66TM7UTfED6erckUVUJQ/jJ1FSpm3pRQ==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.2.tgz", + "integrity": "sha512-9Jie/At6qk70dNIcopcL4p+1UirusEtznpNtcq/u/C5cC4HBX7qSGsYIcG6bdxj15EYWhHiu02YvmdPzylIZlA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.44.2.tgz", - "integrity": "sha512-3D3OB1vSSBXmkGEZR27uiMRNiwN08/RVAcBKwhUYPaiZ8bcvdeEwWPvbnXvvXHY+A/7xluzcN+kaiOFNiOZwWg==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.2.tgz", + "integrity": "sha512-HPNJwxPL3EmhzeAnsWQCM3DcoqOz3/IC6de9rWfGR8ZCuEHETi9km66bH/wG3YH0V3nyzyFEGUZeL5PKyy4xvw==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.44.2.tgz", - "integrity": "sha512-VfU0fsMK+rwdK8mwODqYeM2hDrF2WiHaSmCBrS7gColkQft95/8tphyzv2EupVxn3iE0FI78wzffoULH1G+dkw==", + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.2.tgz", + "integrity": "sha512-nMKvq6FRHSzYfKLHZ+cChowlEkR2lj/V0jYj9JnGUVPL2/mIeFGmVM2mLaFeNa5Jev7W7TovXqXIG2d39y1KYA==", "cpu": [ "arm64" ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.2.tgz", + "integrity": "sha512-eFUvvnTYEKeTyHEijQKz81bLrUQOXKZqECeiWH6tb8eXXbZk+CXSG2aFrig2BQ/pjiVRj36zysjgILkqarS2YA==", + "cpu": [ + "arm64" + ], + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.44.2.tgz", - "integrity": "sha512-+qMUrkbUurpE6DVRjiJCNGZBGo9xM4Y0FXU5cjgudWqIBWbcLkjE3XprJUsOFgC6xjBClwVa9k6O3A7K3vxb5Q==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.2.tgz", + "integrity": "sha512-cBaWmXqyfRhH8zmUxK3d3sAhEWLrtMjWBRwdMMHJIXSjvjLKvv49adxiEz+FJ8AP90apSDDBx2Tyd/WylV6ikA==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.44.2.tgz", - "integrity": "sha512-3+QZROYfJ25PDcxFF66UEk8jGWigHJeecZILvkPkyQN7oc5BvFo4YEXFkOs154j3FTMp9mn9Ky8RCOwastduEA==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.2.tgz", + "integrity": "sha512-APwKy6YUhvZaEoHyM+9xqmTpviEI+9eL7LoCH+aLcvWYHJ663qG5zx7WzWZY+a9qkg5JtzcMyJ9z0WtQBMDmgA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -3411,18 +3715,21 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@scarf/scarf": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz", "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==", - "hasInstallScript": true + "hasInstallScript": true, + "license": "Apache-2.0" }, "node_modules/@sentry/core": { "version": "8.55.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.55.0.tgz", "integrity": "sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==", + "license": "MIT", "engines": { "node": ">=14.18" } @@ -3431,6 +3738,7 @@ "version": "8.55.0", "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.55.0.tgz", "integrity": "sha512-h10LJLDTRAzYgay60Oy7moMookqqSZSviCWkkmHZyaDn+4WURnPp5SKhhfrzPRQcXKrweiOwDSHBgn1tweDssg==", + "license": "MIT", "dependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/context-async-hooks": "^1.30.1", @@ -3476,6 +3784,7 @@ "version": "8.55.0", "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.55.0.tgz", "integrity": "sha512-UvatdmSr3Xf+4PLBzJNLZ2JjG1yAPWGe/VrJlJAqyTJ2gKeTzgXJJw8rp4pbvNZO8NaTGEYhhO+scLUj0UtLAQ==", + "license": "MIT", "dependencies": { "@sentry/core": "8.55.0" }, @@ -3492,11 +3801,12 @@ } }, "node_modules/@smithy/abort-controller": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.4.tgz", - "integrity": "sha512-gJnEjZMvigPDQWHrW3oPrFhQtkrgqBkyjj3pCIdF3A5M6vsZODG93KNlfJprv6bp4245bdT32fsHK4kkH3KYDA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.1.1.tgz", + "integrity": "sha512-vkzula+IwRvPR6oKQhMYioM3A/oX/lFCZiwuxkQbRhqJS2S4YRY2k7k/SyR2jMf3607HLtbEwlRxi0ndXHMjRg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3504,14 +3814,15 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.1.4.tgz", - "integrity": "sha512-prmU+rDddxHOH0oNcwemL+SwnzcG65sBF2yXRO7aeXIn/xTlq2pX7JLVbkBnVLowHLg4/OL4+jBmv9hVrVGS+w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.2.2.tgz", + "integrity": "sha512-IT6MatgBWagLybZl1xQcURXRICvqz1z3APSCAI9IqdvfCkrA7RaQIEfgC6G/KvfxnDfQUDqFV+ZlixcuFznGBQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/types": "^4.5.0", + "@smithy/util-config-provider": "^4.1.0", + "@smithy/util-middleware": "^4.1.1", "tslib": "^2.6.2" }, "engines": { @@ -3519,33 +3830,43 @@ } }, "node_modules/@smithy/core": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.7.0.tgz", - "integrity": "sha512-7ov8hu/4j0uPZv8b27oeOFtIBtlFmM3ibrPv/Omx1uUdoXvcpJ00U+H/OWWC/keAguLlcqwtyL2/jTlSnApgNQ==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.11.0.tgz", + "integrity": "sha512-Abs5rdP1o8/OINtE49wwNeWuynCu0kme1r4RI3VXVrHr4odVDG7h7mTnw1WXXfN5Il+c25QOnrdL2y56USfxkA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-serde": "^4.0.8", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-stream": "^4.2.3", - "@smithy/util-utf8": "^4.0.0", - "tslib": "^2.6.2" + "@smithy/middleware-serde": "^4.1.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-body-length-browser": "^4.1.0", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-stream": "^4.3.1", + "@smithy/util-utf8": "^4.1.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { "node": ">=18.0.0" } }, + "node_modules/@smithy/core/node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "license": "MIT" + }, "node_modules/@smithy/credential-provider-imds": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.6.tgz", - "integrity": "sha512-hKMWcANhUiNbCJouYkZ9V3+/Qf9pteR1dnwgdyzR09R4ODEYx8BbUysHwRSyex4rZ9zapddZhLFTnT4ZijR4pw==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.1.2.tgz", + "integrity": "sha512-JlYNq8TShnqCLg0h+afqe2wLAwZpuoSgOyzhYvTgbiKBWRov+uUve+vrZEQO6lkdLOWPh7gK5dtb9dS+KGendg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/property-provider": "^4.0.4", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/property-provider": "^4.1.1", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", "tslib": "^2.6.2" }, "engines": { @@ -3553,14 +3874,15 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.1.0.tgz", - "integrity": "sha512-mADw7MS0bYe2OGKkHYMaqarOXuDwRbO6ArD91XhHcl2ynjGCFF+hvqf0LyQcYxkA1zaWjefSkU7Ne9mqgApSgQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.2.1.tgz", + "integrity": "sha512-5/3wxKNtV3wO/hk1is+CZUhL8a1yy/U+9u9LKQ9kZTkMsHaQjJhc3stFfiujtMnkITjzWfndGA2f7g9Uh9vKng==", + "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.1.2", - "@smithy/querystring-builder": "^4.0.4", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", + "@smithy/protocol-http": "^5.2.1", + "@smithy/querystring-builder": "^4.1.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3568,13 +3890,14 @@ } }, "node_modules/@smithy/hash-node": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.4.tgz", - "integrity": "sha512-qnbTPUhCVnCgBp4z4BUJUhOEkVwxiEi1cyFM+Zj6o+aY8OFGxUQleKWq8ltgp3dujuhXojIvJWdoqpm6dVO3lQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.1.1.tgz", + "integrity": "sha512-H9DIU9WBLhYrvPs9v4sYvnZ1PiAI0oc8CgNQUJ1rpN3pP7QADbTOUjchI2FB764Ub0DstH5xbTqcMJu1pnVqxA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/types": "^4.5.0", + "@smithy/util-buffer-from": "^4.1.0", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3582,11 +3905,12 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.4.tgz", - "integrity": "sha512-bNYMi7WKTJHu0gn26wg8OscncTt1t2b8KcsZxvOv56XA6cyXtOAAAaNP7+m45xfppXfOatXF3Sb1MNsLUgVLTw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.1.1.tgz", + "integrity": "sha512-1AqLyFlfrrDkyES8uhINRlJXmHA2FkG+3DY8X+rmLSqmFwk3DJnvhyGzyByPyewh2jbmV+TYQBEfngQax8IFGg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3594,9 +3918,10 @@ } }, "node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", - "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.1.0.tgz", + "integrity": "sha512-ePTYUOV54wMogio+he4pBybe8fwg4sDvEVDBU8ZlHOZXbXK3/C0XfJgUCu6qAZcawv05ZhZzODGUerFBPsPUDQ==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3605,12 +3930,13 @@ } }, "node_modules/@smithy/md5-js": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.0.4.tgz", - "integrity": "sha512-uGLBVqcOwrLvGh/v/jw423yWHq/ofUGK1W31M2TNspLQbUV1Va0F5kTxtirkoHawODAZcjXTSGi7JwbnPcDPJg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.1.1.tgz", + "integrity": "sha512-MvWXKK743BuHjr/hnWuT6uStdKEaoqxHAQUvbKJPPZM5ZojTNFI5D+47BoQfBE5RgGlRRty05EbWA+NXDv+hIA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", - "@smithy/util-utf8": "^4.0.0", + "@smithy/types": "^4.5.0", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3618,12 +3944,13 @@ } }, "node_modules/@smithy/middleware-content-length": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.4.tgz", - "integrity": "sha512-F7gDyfI2BB1Kc+4M6rpuOLne5LOcEknH1n6UQB69qv+HucXBR1rkzXBnQTB2q46sFy1PM/zuSJOB532yc8bg3w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.1.1.tgz", + "integrity": "sha512-9wlfBBgTsRvC2JxLJxv4xDGNBrZuio3AgSl0lSFX7fneW2cGskXTYpFxCdRYD2+5yzmsiTuaAJD1Wp7gWt9y9w==", + "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3631,17 +3958,18 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "4.1.14", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.1.14.tgz", - "integrity": "sha512-+BGLpK5D93gCcSEceaaYhUD/+OCGXM1IDaq/jKUQ+ujB0PTWlWN85noodKw/IPFZhIKFCNEe19PGd/reUMeLSQ==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.2.2.tgz", + "integrity": "sha512-M51KcwD+UeSOFtpALGf5OijWt915aQT5eJhqnMKJt7ZTfDfNcvg2UZgIgTZUoiORawb6o5lk4n3rv7vnzQXgsA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.7.0", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-middleware": "^4.0.4", + "@smithy/core": "^3.11.0", + "@smithy/middleware-serde": "^4.1.1", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/shared-ini-file-loader": "^4.2.0", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "@smithy/util-middleware": "^4.1.1", "tslib": "^2.6.2" }, "engines": { @@ -3649,17 +3977,19 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.1.15.tgz", - "integrity": "sha512-iKYUJpiyTQ33U2KlOZeUb0GwtzWR3C0soYcKuCnTmJrvt6XwTPQZhMfsjJZNw7PpQ3TU4Ati1qLSrkSJxnnSMQ==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.2.2.tgz", + "integrity": "sha512-KZJueEOO+PWqflv2oGx9jICpHdBYXwCI19j7e2V3IMwKgFcXc9D9q/dsTf4B+uCnYxjNoS1jpyv6pGNGRsKOXA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/protocol-http": "^5.1.2", - "@smithy/service-error-classification": "^4.0.6", - "@smithy/smithy-client": "^4.4.6", - "@smithy/types": "^4.3.1", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/protocol-http": "^5.2.1", + "@smithy/service-error-classification": "^4.1.1", + "@smithy/smithy-client": "^4.6.2", + "@smithy/types": "^4.5.0", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-retry": "^4.1.1", + "@types/uuid": "^9.0.1", "tslib": "^2.6.2", "uuid": "^9.0.1" }, @@ -3667,13 +3997,20 @@ "node": ">=18.0.0" } }, + "node_modules/@smithy/middleware-retry/node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "license": "MIT" + }, "node_modules/@smithy/middleware-serde": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.8.tgz", - "integrity": "sha512-iSSl7HJoJaGyMIoNn2B7czghOVwJ9nD7TMvLhMWeSB5vt0TnEYyRRqPJu/TqW76WScaNvYYB8nRoiBHR9S1Ddw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.1.1.tgz", + "integrity": "sha512-lh48uQdbCoj619kRouev5XbWhCwRKLmphAif16c4J6JgJ4uXjub1PI6RL38d3BLliUvSso6klyB/LTNpWSNIyg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3681,11 +4018,12 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.4.tgz", - "integrity": "sha512-kagK5ggDrBUCCzI93ft6DjteNSfY8Ulr83UtySog/h09lTIOAJ/xUSObutanlPT0nhoHAkpmW9V5K8oPyLh+QA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.1.1.tgz", + "integrity": "sha512-ygRnniqNcDhHzs6QAPIdia26M7e7z9gpkIMUe/pK0RsrQ7i5MblwxY8078/QCnGq6AmlUUWgljK2HlelsKIb/A==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3693,13 +4031,14 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.1.3.tgz", - "integrity": "sha512-HGHQr2s59qaU1lrVH6MbLlmOBxadtzTsoO4c+bF5asdgVik3I8o7JIOzoeqWc5MjVa+vD36/LWE0iXKpNqooRw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.2.2.tgz", + "integrity": "sha512-SYGTKyPvyCfEzIN5rD8q/bYaOPZprYUPD2f5g9M7OjaYupWOoQFYJ5ho+0wvxIRf471i2SR4GoiZ2r94Jq9h6A==", + "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3707,14 +4046,15 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.1.0.tgz", - "integrity": "sha512-vqfSiHz2v8b3TTTrdXi03vNz1KLYYS3bhHCDv36FYDqxT7jvTll1mMnCrkD+gOvgwybuunh/2VmvOMqwBegxEg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.2.1.tgz", + "integrity": "sha512-REyybygHlxo3TJICPF89N2pMQSf+p+tBJqpVe1+77Cfi9HBPReNjTgtZ1Vg73exq24vkqJskKDpfF74reXjxfw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/querystring-builder": "^4.0.4", - "@smithy/types": "^4.3.1", + "@smithy/abort-controller": "^4.1.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/querystring-builder": "^4.1.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3722,11 +4062,12 @@ } }, "node_modules/@smithy/property-provider": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz", - "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.1.1.tgz", + "integrity": "sha512-gm3ZS7DHxUbzC2wr8MUCsAabyiXY0gaj3ROWnhSx/9sPMc6eYLMM4rX81w1zsMaObj2Lq3PZtNCC1J6lpEY7zg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3734,11 +4075,12 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.1.2.tgz", - "integrity": "sha512-rOG5cNLBXovxIrICSBm95dLqzfvxjEmuZx4KK3hWwPFHGdW3lxY0fZNXfv2zebfRO7sJZ5pKJYHScsqopeIWtQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.2.1.tgz", + "integrity": "sha512-T8SlkLYCwfT/6m33SIU/JOVGNwoelkrvGjFKDSDtVvAXj/9gOT78JVJEas5a+ETjOu4SVvpCstKgd0PxSu/aHw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3746,12 +4088,13 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.4.tgz", - "integrity": "sha512-SwREZcDnEYoh9tLNgMbpop+UTGq44Hl9tdj3rf+yeLcfH7+J8OXEBaMc2kDxtyRHu8BhSg9ADEx0gFHvpJgU8w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.1.1.tgz", + "integrity": "sha512-J9b55bfimP4z/Jg1gNo+AT84hr90p716/nvxDkPGCD4W70MPms0h8KF50RDRgBGZeL83/u59DWNqJv6tEP/DHA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", - "@smithy/util-uri-escape": "^4.0.0", + "@smithy/types": "^4.5.0", + "@smithy/util-uri-escape": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3759,11 +4102,12 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.4.tgz", - "integrity": "sha512-6yZf53i/qB8gRHH/l2ZwUG5xgkPgQF15/KxH0DdXMDHjesA9MeZje/853ifkSY0x4m5S+dfDZ+c4x439PF0M2w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.1.1.tgz", + "integrity": "sha512-63TEp92YFz0oQ7Pj9IuI3IgnprP92LrZtRAkE3c6wLWJxfy/yOPRt39IOKerVr0JS770olzl0kGafXlAXZ1vng==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3771,22 +4115,24 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.6.tgz", - "integrity": "sha512-RRoTDL//7xi4tn5FrN2NzH17jbgmnKidUqd4KvquT0954/i6CXXkh1884jBiunq24g9cGtPBEXlU40W6EpNOOg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.1.1.tgz", + "integrity": "sha512-Iam75b/JNXyDE41UvrlM6n8DNOa/r1ylFyvgruTUx7h2Uk7vDNV9AAwP1vfL1fOL8ls0xArwEGVcGZVd7IO/Cw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1" + "@smithy/types": "^4.5.0" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.4.tgz", - "integrity": "sha512-63X0260LoFBjrHifPDs+nM9tV0VMkOTl4JRMYNuKh/f5PauSjowTfvF3LogfkWdcPoxsA9UjqEOgjeYIbhb7Nw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.2.0.tgz", + "integrity": "sha512-OQTfmIEp2LLuWdxa8nEEPhZmiOREO6bcB6pjs0AySf4yiZhl6kMOfqmcwcY8BaBPX+0Tb+tG7/Ia/6mwpoZ7Pw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3794,17 +4140,18 @@ } }, "node_modules/@smithy/signature-v4": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.2.tgz", - "integrity": "sha512-d3+U/VpX7a60seHziWnVZOHuEgJlclufjkS6zhXvxcJgkJq4UWdH5eOBLzHRMx6gXjsdT9h6lfpmLzbrdupHgQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.2.1.tgz", + "integrity": "sha512-M9rZhWQLjlQVCCR37cSjHfhriGRN+FQ8UfgrYNufv66TJgk+acaggShl3KS5U/ssxivvZLlnj7QH2CUOKlxPyA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/is-array-buffer": "^4.1.0", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-hex-encoding": "^4.1.0", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-uri-escape": "^4.1.0", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3812,16 +4159,17 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.4.6.tgz", - "integrity": "sha512-3wfhywdzB/CFszP6moa5L3lf5/zSfQoH0kvVSdkyK2az5qZet0sn2PAHjcTDiq296Y4RP5yxF7B6S6+3oeBUCQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.6.2.tgz", + "integrity": "sha512-u82cjh/x7MlMat76Z38TRmEcG6JtrrxN4N2CSNG5o2v2S3hfLAxRgSgFqf0FKM3dglH41Evknt/HOX+7nfzZ3g==", + "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.7.0", - "@smithy/middleware-endpoint": "^4.1.14", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", - "@smithy/util-stream": "^4.2.3", + "@smithy/core": "^3.11.0", + "@smithy/middleware-endpoint": "^4.2.2", + "@smithy/middleware-stack": "^4.1.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-stream": "^4.3.1", "tslib": "^2.6.2" }, "engines": { @@ -3829,9 +4177,10 @@ } }, "node_modules/@smithy/types": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz", - "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.5.0.tgz", + "integrity": "sha512-RkUpIOsVlAwUIZXO1dsz8Zm+N72LClFfsNqf173catVlvRZiwPy0x2u0JLEA4byreOPKDZPGjmPDylMoP8ZJRg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3840,12 +4189,13 @@ } }, "node_modules/@smithy/url-parser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.4.tgz", - "integrity": "sha512-eMkc144MuN7B0TDA4U2fKs+BqczVbk3W+qIvcoCY6D1JY3hnAdCuhCZODC+GAeaxj0p6Jroz4+XMUn3PCxQQeQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.1.1.tgz", + "integrity": "sha512-bx32FUpkhcaKlEoOMbScvc93isaSiRM75pQ5IgIBaMkT7qMlIibpPRONyx/0CvrXHzJLpOn/u6YiDX2hcvs7Dg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^4.0.4", - "@smithy/types": "^4.3.1", + "@smithy/querystring-parser": "^4.1.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3853,12 +4203,13 @@ } }, "node_modules/@smithy/util-base64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", - "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.1.0.tgz", + "integrity": "sha512-RUGd4wNb8GeW7xk+AY5ghGnIwM96V0l2uzvs/uVHf+tIuVX2WSvynk5CxNoBCsM2rQRSZElAo9rt3G5mJ/gktQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/util-buffer-from": "^4.1.0", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3866,9 +4217,10 @@ } }, "node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", - "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.1.0.tgz", + "integrity": "sha512-V2E2Iez+bo6bUMOTENPr6eEmepdY8Hbs+Uc1vkDKgKNA/brTJqOW/ai3JO1BGj9GbCeLqw90pbbH7HFQyFotGQ==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3877,9 +4229,10 @@ } }, "node_modules/@smithy/util-body-length-node": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", - "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.1.0.tgz", + "integrity": "sha512-BOI5dYjheZdgR9XiEM3HJcEMCXSoqbzu7CzIgYrx0UtmvtC3tC2iDGpJLsSRFffUpy8ymsg2ARMP5fR8mtuUQQ==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3888,11 +4241,12 @@ } }, "node_modules/@smithy/util-buffer-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", - "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.1.0.tgz", + "integrity": "sha512-N6yXcjfe/E+xKEccWEKzK6M+crMrlwaCepKja0pNnlSkm6SjAeLKKA++er5Ba0I17gvKfN/ThV+ZOx/CntKTVw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", + "@smithy/is-array-buffer": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3900,9 +4254,10 @@ } }, "node_modules/@smithy/util-config-provider": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", - "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.1.0.tgz", + "integrity": "sha512-swXz2vMjrP1ZusZWVTB/ai5gK+J8U0BWvP10v9fpcFvg+Xi/87LHvHfst2IgCs1i0v4qFZfGwCmeD/KNCdJZbQ==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3911,13 +4266,14 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.22", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.22.tgz", - "integrity": "sha512-hjElSW18Wq3fUAWVk6nbk7pGrV7ZT14DL1IUobmqhV3lxcsIenr5FUsDe2jlTVaS8OYBI3x+Og9URv5YcKb5QA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.1.2.tgz", + "integrity": "sha512-QKrOw01DvNHKgY+3p4r9Ut4u6EHLVZ01u6SkOMe6V6v5C+nRPXJeWh72qCT1HgwU3O7sxAIu23nNh+FOpYVZKA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.0.4", - "@smithy/smithy-client": "^4.4.6", - "@smithy/types": "^4.3.1", + "@smithy/property-provider": "^4.1.1", + "@smithy/smithy-client": "^4.6.2", + "@smithy/types": "^4.5.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, @@ -3926,16 +4282,17 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.22", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.22.tgz", - "integrity": "sha512-7B8mfQBtwwr2aNRRmU39k/bsRtv9B6/1mTMrGmmdJFKmLAH+KgIiOuhaqfKOBGh9sZ/VkZxbvm94rI4MMYpFjQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.1.2.tgz", + "integrity": "sha512-l2yRmSfx5haYHswPxMmCR6jGwgPs5LjHLuBwlj9U7nNBMS43YV/eevj+Xq1869UYdiynnMrCKtoOYQcwtb6lKg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/config-resolver": "^4.1.4", - "@smithy/credential-provider-imds": "^4.0.6", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/property-provider": "^4.0.4", - "@smithy/smithy-client": "^4.4.6", - "@smithy/types": "^4.3.1", + "@smithy/config-resolver": "^4.2.2", + "@smithy/credential-provider-imds": "^4.1.2", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/property-provider": "^4.1.1", + "@smithy/smithy-client": "^4.6.2", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3943,12 +4300,13 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.6.tgz", - "integrity": "sha512-YARl3tFL3WgPuLzljRUnrS2ngLiUtkwhQtj8PAL13XZSyUiNLQxwG3fBBq3QXFqGFUXepIN73pINp3y8c2nBmA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.1.2.tgz", + "integrity": "sha512-+AJsaaEGb5ySvf1SKMRrPZdYHRYSzMkCoK16jWnIMpREAnflVspMIDeCVSZJuj+5muZfgGpNpijE3mUNtjv01Q==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3956,9 +4314,10 @@ } }, "node_modules/@smithy/util-hex-encoding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", - "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.1.0.tgz", + "integrity": "sha512-1LcueNN5GYC4tr8mo14yVYbh/Ur8jHhWOxniZXii+1+ePiIbsLZ5fEI0QQGtbRRP5mOhmooos+rLmVASGGoq5w==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3967,11 +4326,12 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.4.tgz", - "integrity": "sha512-9MLKmkBmf4PRb0ONJikCbCwORACcil6gUWojwARCClT7RmLzF04hUR4WdRprIXal7XVyrddadYNfp2eF3nrvtQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.1.1.tgz", + "integrity": "sha512-CGmZ72mL29VMfESz7S6dekqzCh8ZISj3B+w0g1hZFXaOjGTVaSqfAEFAq8EGp8fUL+Q2l8aqNmt8U1tglTikeg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3979,12 +4339,13 @@ } }, "node_modules/@smithy/util-retry": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.6.tgz", - "integrity": "sha512-+YekoF2CaSMv6zKrA6iI/N9yva3Gzn4L6n35Luydweu5MMPYpiGZlWqehPHDHyNbnyaYlz/WJyYAZnC+loBDZg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.1.1.tgz", + "integrity": "sha512-jGeybqEZ/LIordPLMh5bnmnoIgsqnp4IEimmUp5c5voZ8yx+5kAlN5+juyr7p+f7AtZTgvhmInQk4Q0UVbrZ0Q==", + "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^4.0.6", - "@smithy/types": "^4.3.1", + "@smithy/service-error-classification": "^4.1.1", + "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, "engines": { @@ -3992,17 +4353,18 @@ } }, "node_modules/@smithy/util-stream": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.2.3.tgz", - "integrity": "sha512-cQn412DWHHFNKrQfbHY8vSFI3nTROY1aIKji9N0tpp8gUABRilr7wdf8fqBbSlXresobM+tQFNk6I+0LXK/YZg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.3.1.tgz", + "integrity": "sha512-khKkW/Jqkgh6caxMWbMuox9+YfGlsk9OnHOYCGVEdYQb/XVzcORXHLYUubHmmda0pubEDncofUrPNniS9d+uAA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/fetch-http-handler": "^5.1.0", - "@smithy/node-http-handler": "^4.1.0", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/fetch-http-handler": "^5.2.1", + "@smithy/node-http-handler": "^4.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-buffer-from": "^4.1.0", + "@smithy/util-hex-encoding": "^4.1.0", + "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -4010,9 +4372,10 @@ } }, "node_modules/@smithy/util-uri-escape": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", - "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.1.0.tgz", + "integrity": "sha512-b0EFQkq35K5NHUYxU72JuoheM6+pytEVUGlTwiFxWFpmddA+Bpz3LgsPRIpBk8lnPE47yT7AF2Egc3jVnKLuPg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -4021,11 +4384,12 @@ } }, "node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", - "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.1.0.tgz", + "integrity": "sha512-mEu1/UIXAdNYuBcyEPbjScKi/+MQVXNIuY/7Cm5XLIWe319kDrT5SizBE95jqtmEXoDbGoZxKLCMttdZdqTZKQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-buffer-from": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -4035,12 +4399,19 @@ "node_modules/@socket.io/component-emitter": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", - "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "license": "MIT" }, "node_modules/@thi.ng/bitstream": { - "version": "2.4.21", - "resolved": "https://registry.npmjs.org/@thi.ng/bitstream/-/bitstream-2.4.21.tgz", - "integrity": "sha512-ol302chc9iolVwIOgclqN+1LJV13xjHdJo/q/aDsgX4Rw44SpeaL2PoEwaO+P40qRMNHgZeOQdwFUgjsLSfGnQ==", + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@thi.ng/bitstream/-/bitstream-2.4.28.tgz", + "integrity": "sha512-QuPqKSbDJ6eHY5Iv2N4h2gFFdGPIGUVINT3ZXrCDXNw5VlCppjBmqFKcUv7Qjru5PikHUlPC4+zkImcp5/vpsQ==", "funding": [ { "type": "github", @@ -4055,17 +4426,18 @@ "url": "https://liberapay.com/thi.ng" } ], + "license": "Apache-2.0", "dependencies": { - "@thi.ng/errors": "^2.5.35" + "@thi.ng/errors": "^2.5.42" }, "engines": { "node": ">=18" } }, "node_modules/@thi.ng/errors": { - "version": "2.5.35", - "resolved": "https://registry.npmjs.org/@thi.ng/errors/-/errors-2.5.35.tgz", - "integrity": "sha512-AUWVN2Mz23WbuREv/bmYmNNhMq+h8GzwAib6xnvsvv2LCy2Ekkt9/vupFGzTxcnFjT7e481/RaxMp6aHXy597A==", + "version": "2.5.42", + "resolved": "https://registry.npmjs.org/@thi.ng/errors/-/errors-2.5.42.tgz", + "integrity": "sha512-jsImkUhxzYzYgh2+0EJEGVKGyzSr2ovq1CTx8bilgJzuF778M6eh4ya81oc8LwT9Oqm6oz5ZZjVEBMldj4rRAw==", "funding": [ { "type": "github", @@ -4080,6 +4452,7 @@ "url": "https://liberapay.com/thi.ng" } ], + "license": "Apache-2.0", "engines": { "node": ">=18" } @@ -4102,12 +4475,23 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/@tokenizer/inflate/node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@tokenizer/inflate/node_modules/token-types": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.3.tgz", - "integrity": "sha512-IKJ6EzuPPWtKtEIEPpIdXv9j5j2LGJEYk0CKY2efgKoYKLBiZdh6iQkLVBow/CB3phyWAWCyk+bZeaimJn6uRQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", "license": "MIT", "dependencies": { + "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" }, @@ -4122,13 +4506,15 @@ "node_modules/@tokenizer/token": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "license": "MIT" }, "node_modules/@types/body-parser": { "version": "1.19.6", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", "dev": true, + "license": "MIT", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -4139,6 +4525,7 @@ "resolved": "https://registry.npmjs.org/@types/compression/-/compression-1.8.1.tgz", "integrity": "sha512-kCFuWS0ebDbmxs0AXYn6e2r2nrGAb5KwQhknjSPSPgJcGd8+HVSILlUyFhGqML2gk39HcG7D1ydW9/qpYkN00Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/express": "*", "@types/node": "*" @@ -4148,6 +4535,7 @@ "version": "3.4.36", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4156,6 +4544,7 @@ "version": "2.8.19", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4163,13 +4552,15 @@ "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==" + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" }, "node_modules/@types/express": { "version": "4.17.23", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.23.tgz", "integrity": "sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -4182,6 +4573,7 @@ "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -4193,19 +4585,22 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/long": { "version": "4.0.2", @@ -4219,6 +4614,7 @@ "integrity": "sha512-5eEkJZ/BLvTE3vXGKkWlyTSUVZuzj23Wj8PoyOq2lt5I3CYbiLBOPb3XmCW6QcuOibIUE6emHXHt9E/F/rCa6w==", "deprecated": "This is a stub types definition. mime provides its own type definitions, so you do not need this installed.", "dev": true, + "license": "MIT", "dependencies": { "mime": "*" } @@ -4227,20 +4623,23 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.4.tgz", "integrity": "sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/mysql": { "version": "2.15.26", "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.26.tgz", "integrity": "sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/node": { - "version": "22.16.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.16.2.tgz", - "integrity": "sha512-Cdqa/eJTvt4fC4wmq1Mcc0CPUjp/Qy2FGqLza3z3pKymsI969TcZ54diNJv8UYUgeWxyb8FSbCkhdR6WqmUFhA==", + "version": "22.18.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.3.tgz", + "integrity": "sha512-gTVM8js2twdtqM+AE2PdGEe9zGQY4UvmFjan9rZcVb6FGdStfjWoWejdmy4CfWVO9rh5MiYQGZloKAGkJt8lMw==", + "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } @@ -4249,21 +4648,24 @@ "version": "3.0.11", "resolved": "https://registry.npmjs.org/@types/node-cron/-/node-cron-3.0.11.tgz", "integrity": "sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", + "version": "2.6.13", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", + "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", + "license": "MIT", "dependencies": { "@types/node": "*", - "form-data": "^4.0.0" + "form-data": "^4.0.4" } }, "node_modules/@types/pg": { "version": "8.6.1", "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "license": "MIT", "dependencies": { "@types/node": "*", "pg-protocol": "*", @@ -4274,6 +4676,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.6.tgz", "integrity": "sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ==", + "license": "MIT", "dependencies": { "@types/pg": "*" } @@ -4283,6 +4686,7 @@ "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.5.tgz", "integrity": "sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4291,31 +4695,36 @@ "version": "0.12.2", "resolved": "https://registry.npmjs.org/@types/qrcode-terminal/-/qrcode-terminal-0.12.2.tgz", "integrity": "sha512-v+RcIEJ+Uhd6ygSQ0u5YYY7ZM+la7GgPbs0V/7l/kFs2uO4S8BcIUEMoP7za4DNIqNnUD5npf0A/7kBhrCKG5Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/qs": { "version": "6.14.0", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==", - "dev": true + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/send": { "version": "0.17.5", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", "dev": true, + "license": "MIT", "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -4325,13 +4734,15 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/serve-static": { "version": "1.15.8", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", "dev": true, + "license": "MIT", "dependencies": { "@types/http-errors": "*", "@types/node": "*", @@ -4341,12 +4752,14 @@ "node_modules/@types/shimmer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", - "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" + "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==", + "license": "MIT" }, "node_modules/@types/tedious": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", "integrity": "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4355,18 +4768,21 @@ "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/validator": { - "version": "13.15.2", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.2.tgz", - "integrity": "sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q==" + "version": "13.15.3", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.3.tgz", + "integrity": "sha512-7bcUmDyS6PN3EuD9SlGGOxM77F8WLVsrwkxyWxKnxzmXoequ6c7741QBrANq6htVRGOITJ7z72mTP6Z4XyuG+Q==", + "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.5.1", "@typescript-eslint/scope-manager": "6.21.0", @@ -4402,6 +4818,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -4430,6 +4847,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0" @@ -4447,6 +4865,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/utils": "6.21.0", @@ -4474,6 +4893,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, + "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -4487,6 +4907,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", @@ -4515,6 +4936,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", @@ -4540,6 +4962,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" @@ -4556,12 +4979,14 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@wasm-audio-decoders/common": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/common/-/common-9.0.7.tgz", "integrity": "sha512-WRaUuWSKV7pkttBygml/a6dIEpatq2nnZGFIoPTc5yPLkxL6Wk4YaslPM98OPQvWacvNZ+Py9xROGDtrFBDzag==", + "license": "MIT", "dependencies": { "@eshaz/web-worker": "1.2.2", "simple-yenc": "^1.0.4" @@ -4571,6 +4996,7 @@ "version": "0.2.8", "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/flac/-/flac-0.2.8.tgz", "integrity": "sha512-CxvylHiUmtCrf0hUSzYQlD9RtoY/LsPuKR8M6ZjtQrXHzSLir0whWjPs1yb+hDZdK8R1NbESHcz2ZV88eMcKUg==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7", "codec-parser": "2.5.0" @@ -4584,6 +5010,7 @@ "version": "0.1.18", "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/ogg-vorbis/-/ogg-vorbis-0.1.18.tgz", "integrity": "sha512-kEg6b5vW4wAXfGAqe5wzvSuAs2FEhPY/rniYF/Gx3rgxQcPiRI86SBAyIRWFJ7O4CY/JJHX57B1OCDueMlBSLQ==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7", "codec-parser": "2.5.0" @@ -4597,6 +5024,7 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/opus-ml/-/opus-ml-0.0.1.tgz", "integrity": "sha512-FALuUCz10HS2h8KB4L7wmfXncOuBDFvlKRk6Ga2rw8sr/zNIpwCjhhomxH4JKPhVLOnBjZfrPa8aTFIQq74vzQ==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7" }, @@ -4609,12 +5037,14 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "license": "(Unlicense OR Apache-2.0)", "optional": true }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -4626,6 +5056,7 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -4638,6 +5069,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4646,6 +5078,7 @@ "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -4657,6 +5090,7 @@ "version": "1.9.5", "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "license": "MIT", "peerDependencies": { "acorn": "^8" } @@ -4666,6 +5100,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -4674,6 +5109,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", "engines": { "node": ">= 14" } @@ -4682,6 +5118,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", "dependencies": { "humanize-ms": "^1.2.1" }, @@ -4694,6 +5131,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -4706,9 +5144,10 @@ } }, "node_modules/amqplib": { - "version": "0.10.8", - "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.8.tgz", - "integrity": "sha512-Tfn1O9sFgAP8DqeMEpt2IacsVTENBpblB3SqLdn0jK2AeX8iyCvbptBc8lyATT9bQ31MsjVwUSQ1g8f4jHOUfw==", + "version": "0.10.9", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.9.tgz", + "integrity": "sha512-jwSftI4QjS3mizvnSnOrPGYiUnm1vI2OP1iXeOUz5pb74Ua0nbf6nPyyTzuiCLEE3fMpaJORXh2K/TQ08H5xGA==", + "license": "MIT", "dependencies": { "buffer-more-ints": "~1.0.0", "url-parse": "~1.5.10" @@ -4721,6 +5160,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -4729,6 +5169,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4742,29 +5183,34 @@ "node_modules/any-base": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", - "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==" + "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==", + "license": "MIT" }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" @@ -4779,13 +5225,15 @@ "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" }, "node_modules/array-includes": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", @@ -4808,6 +5256,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4817,6 +5266,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", @@ -4838,6 +5288,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -4856,6 +5307,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -4874,6 +5326,7 @@ "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", @@ -4900,6 +5353,7 @@ "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -4908,6 +5362,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.5.0.tgz", "integrity": "sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==", + "license": "MIT", "dependencies": { "tslib": "^2.4.0" } @@ -4915,12 +5370,14 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -4928,12 +5385,14 @@ "node_modules/audio-buffer": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/audio-buffer/-/audio-buffer-5.0.0.tgz", - "integrity": "sha512-gsDyj1wwUp8u7NBB+eW6yhLb9ICf+0eBmDX8NGaAS00w8/fLqFdxUlL5Ge/U8kB64DlQhdonxYC59dXy1J7H/w==" + "integrity": "sha512-gsDyj1wwUp8u7NBB+eW6yhLb9ICf+0eBmDX8NGaAS00w8/fLqFdxUlL5Ge/U8kB64DlQhdonxYC59dXy1J7H/w==", + "license": "MIT" }, "node_modules/audio-decode": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/audio-decode/-/audio-decode-2.2.3.tgz", "integrity": "sha512-Z0lHvMayR/Pad9+O9ddzaBJE0DrhZkQlStrC1RwcAHF3AhQAsdwKHeLGK8fYKyp2DDU6xHxzGb4CLMui12yVrg==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/flac": "^0.2.4", "@wasm-audio-decoders/ogg-vorbis": "^0.1.15", @@ -4949,6 +5408,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/audio-type/-/audio-type-2.2.1.tgz", "integrity": "sha512-En9AY6EG1qYqEy5L/quryzbA4akBpJrnBZNxeKTqGHC2xT9Qc4aZ8b7CcbOMFTTc/MGdoNyp+SN4zInZNKxMYA==", + "license": "MIT", "engines": { "node": ">=14" } @@ -4957,6 +5417,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -4971,23 +5432,26 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/await-to-js/-/await-to-js-3.0.0.tgz", "integrity": "sha512-zJAaP9zxTcvTHRlejau3ZOY4V7SRpiByf3/dxx2uyKxxor19tpmpV2QRsTKikckwhaPmr2dVpxxMr7jOCYVp5g==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/axios": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz", - "integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, "node_modules/baileys": { - "version": "7.0.0-rc.2", - "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#88ec0c4db212f16357bb133503fbdd2368620cc4", + "version": "7.0.0-rc.3", + "resolved": "https://registry.npmjs.org/baileys/-/baileys-7.0.0-rc.3.tgz", + "integrity": "sha512-SVRLTDMKnWhX2P+bANVO1s/IigmGsN2UMbR69ftwsj+DtHxmSn8qjWftVZ//dTOhkncU7xZhTEOWtsOrPoemvQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -4995,7 +5459,7 @@ "@hapi/boom": "^9.1.3", "async-mutex": "^0.5.0", "axios": "^1.6.0", - "libsignal": "git+https://github.com/whiskeysockets/libsignal-node", + "libsignal": "git+https://github.com/whiskeysockets/libsignal-node.git", "lru-cache": "^11.1.0", "music-metadata": "^11.7.0", "pino": "^9.6", @@ -5027,6 +5491,7 @@ "version": "9.1.4", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-9.1.4.tgz", "integrity": "sha512-Ls1oH8jaN1vNsqcaHVYJrKmgMcKsC1wcp8bujvXrHaAqD2iDYq3HoOwsxwo09Cuda5R5nC0o0IxlrlTuvPuzSw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x" } @@ -5034,21 +5499,14 @@ "node_modules/baileys/node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" - }, - "node_modules/baileys/node_modules/lru-cache": { - "version": "11.2.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", - "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", - "license": "ISC", - "engines": { - "node": "20 || >=22" - } + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "license": "BSD-3-Clause" }, "node_modules/baileys/node_modules/pino": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-9.7.0.tgz", - "integrity": "sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==", + "version": "9.9.5", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.9.5.tgz", + "integrity": "sha512-d1s98p8/4TfYhsJ09r/Azt30aYELRi6NNnZtEbqFw6BoGsdPVf5lKNK3kUwH8BmJJfpTLNuicjUQjaMbd93dVg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -5070,6 +5528,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", + "license": "MIT", "dependencies": { "split2": "^4.0.0" } @@ -5077,7 +5536,8 @@ "node_modules/baileys/node_modules/pino-std-serializers": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", - "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==" + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", + "license": "MIT" }, "node_modules/baileys/node_modules/process-warning": { "version": "5.0.0", @@ -5092,12 +5552,14 @@ "type": "opencollective", "url": "https://opencollective.com/fastify" } - ] + ], + "license": "MIT" }, "node_modules/baileys/node_modules/sonic-boom": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" } @@ -5106,6 +5568,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", + "license": "MIT", "dependencies": { "real-require": "^0.2.0" } @@ -5113,7 +5576,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", @@ -5132,12 +5596,14 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "license": "MIT", "engines": { "node": "^4.5.0 || >= 5.9" } @@ -5146,6 +5612,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.1.0.tgz", "integrity": "sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg==", + "license": "MIT", "dependencies": { "readable-stream": "^3.4.0" } @@ -5153,12 +5620,14 @@ "node_modules/bmp-ts": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/bmp-ts/-/bmp-ts-1.0.9.tgz", - "integrity": "sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw==" + "integrity": "sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw==", + "license": "MIT" }, "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -5182,6 +5651,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -5189,22 +5659,26 @@ "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "license": "ISC" }, "node_modules/bowser": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", - "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.12.1.tgz", + "integrity": "sha512-z4rE2Gxh7tvshQ4hluIT7XcFrgLIQaw9X3A+kTTRdovCz5PMukm/0QC/BKSYPj3omF5Qfypn9O/c5kgpmvYUCw==", + "license": "MIT" }, "node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -5214,6 +5688,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -5224,7 +5699,8 @@ "node_modules/browser-or-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.1.1.tgz", - "integrity": "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==" + "integrity": "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==", + "license": "MIT" }, "node_modules/buffer": { "version": "6.0.3", @@ -5244,6 +5720,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -5253,6 +5730,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -5260,22 +5738,26 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" }, "node_modules/buffer-more-ints": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", - "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==", + "license": "MIT" }, "node_modules/bundle-require": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", + "license": "MIT", "dependencies": { "load-tsconfig": "^0.2.3" }, @@ -5301,31 +5783,63 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/c12": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", + "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.2.2", + "defu": "^6.1.4", + "dotenv": "^16.6.1", + "exsolve": "^1.0.7", + "giget": "^2.0.0", + "jiti": "^2.4.2", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^2.2.0", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cacheable": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-1.10.1.tgz", - "integrity": "sha512-Fa2BZY0CS9F0PFc/6aVA6tgpOdw+hmv9dkZOlHXII5v5Hw+meJBIWDcPrG9q/dXxGcNbym5t77fzmawrBQfTmQ==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-1.10.4.tgz", + "integrity": "sha512-Gd7ccIUkZ9TE2odLQVS+PDjIvQCdJKUlLdJRVvZu0aipj07Qfx+XIej7hhDrKGGoIxV5m5fT/kOJNJPQhQneRg==", + "license": "MIT", "dependencies": { - "hookified": "^1.10.0", - "keyv": "^5.3.4" + "hookified": "^1.11.0", + "keyv": "^5.5.0" } }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", @@ -5343,6 +5857,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -5355,6 +5870,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" @@ -5371,6 +5887,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -5379,6 +5896,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", "engines": { "node": ">=6" } @@ -5388,6 +5906,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5403,6 +5922,7 @@ "version": "1.0.0-rc.11", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz", "integrity": "sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag==", + "license": "MIT", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -5424,6 +5944,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -5436,15 +5957,41 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, "node_modules/cjs-module-lexer": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", - "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==" + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "license": "MIT" }, "node_modules/class-validator": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.2.tgz", "integrity": "sha512-3kMVRF2io8N8pY1IFIXlho9r8IPUUIfHe2hYVtiebvAzU2XeQFXTv+XI4WX+TnXmtwXMDcjngcpkiPM0O9PvLw==", + "license": "MIT", "dependencies": { "@types/validator": "^13.11.8", "libphonenumber-js": "^1.11.1", @@ -5452,22 +5999,51 @@ } }, "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "license": "ISC", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "license": "MIT", "engines": { "node": ">=0.8" } @@ -5476,6 +6052,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "license": "Apache-2.0", "engines": { "node": ">=0.10.0" } @@ -5483,12 +6060,14 @@ "node_modules/codec-parser": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/codec-parser/-/codec-parser-2.5.0.tgz", - "integrity": "sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==" + "integrity": "sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==", + "license": "LGPL-3.0-or-later" }, "node_modules/color": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" @@ -5501,6 +6080,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -5511,12 +6091,14 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, "node_modules/color-string": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -5526,6 +6108,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -5537,6 +6120,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "license": "MIT", "engines": { "node": ">= 6" } @@ -5545,6 +6129,7 @@ "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "license": "MIT", "dependencies": { "mime-db": ">= 1.43.0 < 2" }, @@ -5553,15 +6138,16 @@ } }, "node_modules/compression": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.0.tgz", - "integrity": "sha512-k6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+vIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+YHr7xTgOgGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", + "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "compressible": "~2.0.18", "debug": "2.6.9", "negotiator": "~0.6.4", - "on-headers": "~1.0.2", + "on-headers": "~1.1.0", "safe-buffer": "5.2.1", "vary": "~1.1.2" }, @@ -5573,6 +6159,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -5580,13 +6167,15 @@ "node_modules/compression/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-stream": { "version": "1.6.2", @@ -5595,6 +6184,7 @@ "engines": [ "node >= 0.8" ], + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", @@ -5605,12 +6195,14 @@ "node_modules/concat-stream/node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" }, "node_modules/concat-stream/node_modules/readable-stream": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -5624,25 +6216,29 @@ "node_modules/concat-stream/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" }, "node_modules/concat-stream/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", + "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", + "license": "MIT" }, "node_modules/consola": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" } @@ -5651,6 +6247,7 @@ "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" }, @@ -5662,6 +6259,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -5670,6 +6268,7 @@ "version": "0.7.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -5677,17 +6276,20 @@ "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -5700,6 +6302,7 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -5713,6 +6316,7 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -5728,6 +6332,7 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "license": "BSD-2-Clause", "engines": { "node": ">= 6" }, @@ -5746,6 +6351,7 @@ "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -5763,6 +6369,7 @@ "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -5780,6 +6387,7 @@ "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -5793,14 +6401,16 @@ } }, "node_modules/dayjs": { - "version": "1.11.13", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", - "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" + "version": "1.11.18", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.18.tgz", + "integrity": "sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==", + "license": "MIT" }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -5817,6 +6427,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5825,6 +6436,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -5833,12 +6445,23 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge-ts": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", + "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.0.0" + } }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -5856,6 +6479,7 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -5868,10 +6492,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "license": "MIT" + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -5880,23 +6511,32 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "license": "MIT" + }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" } }, "node_modules/detect-libc": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", - "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.0.tgz", + "integrity": "sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg==", + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -5904,13 +6544,15 @@ "node_modules/dijkstrajs": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", - "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "license": "MIT" }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -5923,6 +6565,7 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -5934,6 +6577,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -5952,12 +6596,14 @@ "type": "github", "url": "https://github.com/sponsors/fb55" } - ] + ], + "license": "BSD-2-Clause" }, "node_modules/domhandler": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -5972,6 +6618,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -5985,6 +6632,7 @@ "version": "16.6.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -5996,6 +6644,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -6008,12 +6657,14 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } @@ -6021,18 +6672,39 @@ "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/effect": { + "version": "3.16.12", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.16.12.tgz", + "integrity": "sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "fast-check": "^3.23.1" + } }, "node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz", + "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==", "license": "MIT" }, + "node_modules/empathic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -6041,6 +6713,7 @@ "version": "6.6.4", "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.4.tgz", "integrity": "sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==", + "license": "MIT", "dependencies": { "@types/cors": "^2.8.12", "@types/node": ">=10.0.0", @@ -6060,6 +6733,7 @@ "version": "6.6.3", "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz", "integrity": "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==", + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", @@ -6072,6 +6746,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -6088,6 +6763,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -6108,6 +6784,7 @@ "version": "5.2.3", "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -6116,6 +6793,7 @@ "version": "0.7.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6124,6 +6802,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -6140,6 +6819,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -6160,6 +6840,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -6172,6 +6853,7 @@ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", "dev": true, + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", @@ -6239,6 +6921,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -6247,6 +6930,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -6255,6 +6939,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -6266,6 +6951,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", @@ -6281,6 +6967,7 @@ "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -6293,6 +6980,7 @@ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, + "license": "MIT", "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", @@ -6306,10 +6994,11 @@ } }, "node_modules/esbuild": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.6.tgz", - "integrity": "sha512-GVuzuUwtdsghE3ocJ9Bs8PNoF13HNQ5TXbEi2AhvVb8xU1Iwt9Fos9FEamfoee+u/TOsn7GUWc04lz46n2bbTg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", + "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -6317,38 +7006,39 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.6", - "@esbuild/android-arm": "0.25.6", - "@esbuild/android-arm64": "0.25.6", - "@esbuild/android-x64": "0.25.6", - "@esbuild/darwin-arm64": "0.25.6", - "@esbuild/darwin-x64": "0.25.6", - "@esbuild/freebsd-arm64": "0.25.6", - "@esbuild/freebsd-x64": "0.25.6", - "@esbuild/linux-arm": "0.25.6", - "@esbuild/linux-arm64": "0.25.6", - "@esbuild/linux-ia32": "0.25.6", - "@esbuild/linux-loong64": "0.25.6", - "@esbuild/linux-mips64el": "0.25.6", - "@esbuild/linux-ppc64": "0.25.6", - "@esbuild/linux-riscv64": "0.25.6", - "@esbuild/linux-s390x": "0.25.6", - "@esbuild/linux-x64": "0.25.6", - "@esbuild/netbsd-arm64": "0.25.6", - "@esbuild/netbsd-x64": "0.25.6", - "@esbuild/openbsd-arm64": "0.25.6", - "@esbuild/openbsd-x64": "0.25.6", - "@esbuild/openharmony-arm64": "0.25.6", - "@esbuild/sunos-x64": "0.25.6", - "@esbuild/win32-arm64": "0.25.6", - "@esbuild/win32-ia32": "0.25.6", - "@esbuild/win32-x64": "0.25.6" + "@esbuild/aix-ppc64": "0.25.9", + "@esbuild/android-arm": "0.25.9", + "@esbuild/android-arm64": "0.25.9", + "@esbuild/android-x64": "0.25.9", + "@esbuild/darwin-arm64": "0.25.9", + "@esbuild/darwin-x64": "0.25.9", + "@esbuild/freebsd-arm64": "0.25.9", + "@esbuild/freebsd-x64": "0.25.9", + "@esbuild/linux-arm": "0.25.9", + "@esbuild/linux-arm64": "0.25.9", + "@esbuild/linux-ia32": "0.25.9", + "@esbuild/linux-loong64": "0.25.9", + "@esbuild/linux-mips64el": "0.25.9", + "@esbuild/linux-ppc64": "0.25.9", + "@esbuild/linux-riscv64": "0.25.9", + "@esbuild/linux-s390x": "0.25.9", + "@esbuild/linux-x64": "0.25.9", + "@esbuild/netbsd-arm64": "0.25.9", + "@esbuild/netbsd-x64": "0.25.9", + "@esbuild/openbsd-arm64": "0.25.9", + "@esbuild/openbsd-x64": "0.25.9", + "@esbuild/openharmony-arm64": "0.25.9", + "@esbuild/sunos-x64": "0.25.9", + "@esbuild/win32-arm64": "0.25.9", + "@esbuild/win32-ia32": "0.25.9", + "@esbuild/win32-x64": "0.25.9" } }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6356,13 +7046,15 @@ "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6376,6 +7068,7 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -6427,10 +7120,11 @@ } }, "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.2.tgz", + "integrity": "sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ==", "dev": true, + "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -6443,6 +7137,7 @@ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -6454,6 +7149,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6463,6 +7159,7 @@ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7" }, @@ -6480,6 +7177,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6489,6 +7187,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, + "license": "MIT", "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -6522,6 +7221,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6532,6 +7232,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6541,6 +7242,7 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -6553,6 +7255,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -6565,6 +7268,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6577,6 +7281,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -6586,6 +7291,7 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -6594,10 +7300,11 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", - "integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.11.7" @@ -6628,6 +7335,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", "dev": true, + "license": "MIT", "peerDependencies": { "eslint": ">=5.0.0" } @@ -6637,6 +7345,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -6653,6 +7362,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -6665,6 +7375,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6675,6 +7386,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6687,6 +7399,7 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -6704,6 +7417,7 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -6716,6 +7430,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -6728,6 +7443,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -6737,6 +7453,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -6745,6 +7462,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6753,6 +7471,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6760,17 +7479,20 @@ "node_modules/eventemitter2": { "version": "6.4.9", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz", - "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==" + "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==", + "license": "MIT" }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", "engines": { "node": ">=0.8.x" } @@ -6784,6 +7506,7 @@ "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -6829,6 +7552,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "license": "ISC", "peerDependencies": { "express": "^4.16.2" } @@ -6837,6 +7561,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -6844,25 +7569,57 @@ "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/exsolve": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.7.tgz", + "integrity": "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==", + "license": "MIT" + }, + "node_modules/fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^6.1.0" + }, + "engines": { + "node": ">=8.0.0" + } }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -6879,6 +7636,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -6890,38 +7648,38 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-redact": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", + "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" } ], + "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" @@ -6932,6 +7690,7 @@ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -6947,6 +7706,7 @@ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" }, @@ -6958,6 +7718,7 @@ "version": "16.5.4", "resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.4.tgz", "integrity": "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==", + "license": "MIT", "dependencies": { "readable-web-to-node-stream": "^3.0.0", "strtok3": "^6.2.4", @@ -6975,6 +7736,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -6986,6 +7748,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6994,6 +7757,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", @@ -7011,6 +7775,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -7018,13 +7783,15 @@ "node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -7040,6 +7807,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "license": "MIT", "dependencies": { "magic-string": "^0.30.17", "mlly": "^1.7.4", @@ -7051,6 +7819,7 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -7065,6 +7834,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -7073,13 +7843,15 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fluent-ffmpeg": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz", "integrity": "sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==", "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "license": "MIT", "dependencies": { "async": "^0.2.9", "which": "^1.1.1" @@ -7092,6 +7864,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -7100,15 +7873,16 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -7122,6 +7896,7 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "license": "MIT", "dependencies": { "is-callable": "^1.2.7" }, @@ -7136,6 +7911,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" @@ -7148,9 +7924,10 @@ } }, "node_modules/form-data": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", - "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -7165,12 +7942,14 @@ "node_modules/form-data-encoder": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", + "license": "MIT" }, "node_modules/formdata-node": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", "dependencies": { "node-domexception": "1.0.0", "web-streams-polyfill": "4.0.0-beta.3" @@ -7183,6 +7962,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -7190,12 +7970,14 @@ "node_modules/forwarded-parse": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz", - "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==" + "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==", + "license": "MIT" }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -7204,13 +7986,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -7223,6 +8007,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7232,6 +8017,7 @@ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -7252,6 +8038,7 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7260,6 +8047,7 @@ "version": "3.9.0", "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", + "license": "MIT", "engines": { "node": ">= 4" } @@ -7268,14 +8056,28 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -7299,6 +8101,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -7312,6 +8115,7 @@ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -7341,17 +8145,36 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.10.1.tgz", "integrity": "sha512-2760b1vpJHNmLzZ/ubTtNnEx5WApN/PYWJvXvgS+tL1egTTthayFYIQQNi136FLEDcN/IyEY2EcGpIITD6eYUw==", + "license": "MIT", "dependencies": { "image-q": "^4.0.0", "omggif": "^1.0.10" } }, + "node_modules/giget": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", + "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.6.0", + "pathe": "^2.0.3" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7372,6 +8195,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -7384,6 +8208,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7394,6 +8219,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -7406,6 +8232,7 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -7421,6 +8248,7 @@ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -7437,6 +8265,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7456,6 +8285,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7467,13 +8297,15 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7486,6 +8318,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -7494,6 +8327,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -7506,6 +8340,7 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.0" }, @@ -7520,6 +8355,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7531,6 +8367,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -7545,6 +8382,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -7553,9 +8391,10 @@ } }, "node_modules/hookified": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.10.0.tgz", - "integrity": "sha512-dJw0492Iddsj56U1JsSTm9E/0B/29a1AuoSLRAte8vQg/kaTGF3IgjEWT8c8yG4cC10+HisE1x5QAwR0Xwc+DA==" + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.12.0.tgz", + "integrity": "sha512-hMr1Y9TCLshScrBbV2QxJ9BROddxZ12MX9KsCtuGGy/3SmmN5H1PllKerrVlSotur9dlE8hmUKAOSa3WDzsZmQ==", + "license": "MIT" }, "node_modules/htmlparser2": { "version": "8.0.2", @@ -7568,6 +8407,7 @@ "url": "https://github.com/sponsors/fb55" } ], + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -7579,6 +8419,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -7594,6 +8435,7 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", "dependencies": { "agent-base": "^7.1.2", "debug": "4" @@ -7606,6 +8448,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", "dependencies": { "ms": "^2.0.0" } @@ -7628,6 +8471,7 @@ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" } ], + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.2" } @@ -7636,6 +8480,7 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -7660,13 +8505,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -7675,6 +8522,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/image-q/-/image-q-4.0.0.tgz", "integrity": "sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==", + "license": "MIT", "dependencies": { "@types/node": "16.9.1" } @@ -7682,13 +8530,15 @@ "node_modules/image-q/node_modules/@types/node": { "version": "16.9.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", + "license": "MIT" }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -7704,6 +8554,7 @@ "version": "1.14.2", "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.14.2.tgz", "integrity": "sha512-5tCuY9BV8ujfOpwtAGgsTx9CGUapcFMEEyByLv1B+v2+6DhAcw+Zr0nhQT7uwaZ7DiourxFEscghOR8e1aPLQw==", + "license": "Apache-2.0", "dependencies": { "acorn": "^8.14.0", "acorn-import-attributes": "^1.9.5", @@ -7716,6 +8567,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -7726,6 +8578,7 @@ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -7734,13 +8587,15 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", @@ -7751,14 +8606,10 @@ } }, "node_modules/ip-address": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", - "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", "license": "MIT", - "dependencies": { - "jsbn": "1.1.0", - "sprintf-js": "^1.1.3" - }, "engines": { "node": ">= 12" } @@ -7767,6 +8618,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", + "license": "MIT", "engines": { "node": ">= 10" } @@ -7775,6 +8627,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" @@ -7791,6 +8644,7 @@ "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -7804,15 +8658,17 @@ } }, "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", + "license": "MIT" }, "node_modules/is-async-function": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, + "license": "MIT", "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", @@ -7831,6 +8687,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-base64/-/is-base64-1.1.0.tgz", "integrity": "sha512-Nlhg7Z2dVC4/PTvIFkgVVNvPHSO2eR/Yd0XzhGiXCXEvWnptXlXa/clQ8aePPiMuxEGcWfzWbGw2Fe3d+Y3v1g==", + "license": "MIT", "bin": { "is_base64": "bin/is-base64", "is-base64": "bin/is-base64" @@ -7841,6 +8698,7 @@ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, + "license": "MIT", "dependencies": { "has-bigints": "^1.0.2" }, @@ -7856,6 +8714,7 @@ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -7871,6 +8730,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7882,6 +8742,7 @@ "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -7897,6 +8758,7 @@ "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", @@ -7914,6 +8776,7 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" @@ -7930,6 +8793,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7939,6 +8803,7 @@ "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, @@ -7953,6 +8818,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } @@ -7961,6 +8827,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "get-proto": "^1.0.0", @@ -7979,6 +8846,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -7991,6 +8859,7 @@ "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8003,6 +8872,7 @@ "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8015,6 +8885,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -8024,6 +8895,7 @@ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -8040,6 +8912,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8048,6 +8921,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", @@ -8066,6 +8940,7 @@ "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8078,6 +8953,7 @@ "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, @@ -8093,6 +8969,7 @@ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -8109,6 +8986,7 @@ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", @@ -8125,6 +9003,7 @@ "version": "1.1.15", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "license": "MIT", "dependencies": { "which-typed-array": "^1.1.16" }, @@ -8140,6 +9019,7 @@ "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8152,6 +9032,7 @@ "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, @@ -8167,6 +9048,7 @@ "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" @@ -8182,17 +9064,20 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -8207,6 +9092,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/jimp/-/jimp-1.6.0.tgz", "integrity": "sha512-YcwCHw1kiqEeI5xRpDlPPBGL2EOpBKLwO4yIBJcXWHPj5PnA5urGq0jbyhM5KoNpypQ6VboSoxc9D8HyfvngSg==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/diff": "1.6.0", @@ -8241,9 +9127,10 @@ } }, "node_modules/jiti": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", - "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", + "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -8252,6 +9139,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "license": "MIT", "engines": { "node": ">=10" } @@ -8259,13 +9147,15 @@ "node_modules/jpeg-js": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", - "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==" + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", + "license": "BSD-3-Clause" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -8273,40 +9163,39 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", - "license": "MIT" - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -8318,6 +9207,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", + "license": "MIT", "engines": { "node": "*" } @@ -8326,6 +9216,7 @@ "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -8347,6 +9238,7 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -8357,17 +9249,19 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, "node_modules/keyv": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.3.4.tgz", - "integrity": "sha512-ypEvQvInNpUe+u+w8BIcPkQvEqXquyyibWE/1NB5T2BTzIpS5cGEV1LZskDzPSTvNAaT4+5FutvzlvnkxOSKlw==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.1.tgz", + "integrity": "sha512-eF3cHZ40bVsjdlRi/RvKAuB0+B61Q1xWvohnrJrnaQslM3h1n79IV+mc9EGag4nrA9ZOlNyr3TUzW5c8uy8vNA==", + "license": "MIT", "dependencies": { - "@keyv/serialize": "^1.0.3" + "@keyv/serialize": "^1.1.1" } }, "node_modules/levn": { @@ -8375,6 +9269,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -8384,14 +9279,15 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.12.9", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.9.tgz", - "integrity": "sha512-VWwAdNeJgN7jFOD+wN4qx83DTPMVPPAUyx9/TUkBXKLiNkuWWk6anV0439tgdtwaJDrEdqkvdN22iA6J4bUCZg==" + "version": "1.12.17", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.17.tgz", + "integrity": "sha512-bsxi8FoceAYR/bjHcLYc2ShJ/aVAzo5jaxAYiMHF0BD+NTp47405CGuPNKYpw+lHadN9k/ClFGc9X5vaZswIrA==", + "license": "MIT" }, "node_modules/libsignal": { "name": "@whiskeysockets/libsignal-node", "version": "2.0.1", - "resolved": "git+ssh://git@github.com/whiskeysockets/libsignal-node.git#4d08331a833727c338c1a90041d17b870210dfae", + "resolved": "git+ssh://git@github.com/whiskeysockets/libsignal-node.git#e81ecfc32eb74951d789ab37f7e341ab66d5fff1", "license": "GPL-3.0", "dependencies": { "curve25519-js": "^0.0.4", @@ -8440,6 +9336,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "license": "MIT", "engines": { "node": ">=14" }, @@ -8450,12 +9347,14 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" }, "node_modules/link-preview-js": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/link-preview-js/-/link-preview-js-3.1.0.tgz", "integrity": "sha512-hSvdHCy7tZJ8ohdgN5WcTBKaubpX7saYBzrSmNDDHnC7P6q+F4we+dwXuEr9LuplnkiGxkD4SaO4rrschfCZ2A==", + "license": "MIT", "dependencies": { "cheerio": "1.0.0-rc.11", "url": "0.11.0" @@ -8468,6 +9367,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } @@ -8477,6 +9377,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -8490,76 +9391,93 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" }, "node_modules/lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" }, "node_modules/lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" }, "node_modules/lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "license": "MIT" }, "node_modules/long": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", - "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==" + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" }, "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", + "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } }, "node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "version": "0.30.19", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", + "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", + "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -8574,11 +9492,12 @@ } }, "node_modules/mediainfo.js": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/mediainfo.js/-/mediainfo.js-0.3.5.tgz", - "integrity": "sha512-frLJzKOoAUC0sbPzmg9VOR+WFbNj5CarbTuOzXeH9cOl33haU/CGcyXUTWK00HPXCVS2N5eT0o0dirVxaPIOIw==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/mediainfo.js/-/mediainfo.js-0.3.6.tgz", + "integrity": "sha512-3xVRlxwlVWIZV3z1q7pb8LzFOO7iKi/DXoRiFRZdOlrUEhPyJDaaRt0uK32yQJabArQicRBeq7cRxmdZlIBTyA==", + "license": "BSD-2-Clause", "dependencies": { - "yargs": "^17.7.2" + "yargs": "^18.0.0" }, "bin": { "mediainfo.js": "dist/esm/cli.js" @@ -8591,6 +9510,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" } @@ -8600,6 +9520,7 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -8608,6 +9529,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -8617,6 +9539,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -8626,12 +9549,13 @@ } }, "node_modules/mime": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.7.tgz", - "integrity": "sha512-2OfDPL+e03E0LrXaGYOtTFIYhiuzep94NSsuhrNULq+stylcJedcHdzHtz0atMUuGwJfFYs0YL5xeC/Ca2x0eQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.1.0.tgz", + "integrity": "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw==", "funding": [ "https://github.com/sponsors/broofa" ], + "license": "MIT", "bin": { "mime": "bin/cli.js" }, @@ -8643,6 +9567,7 @@ "version": "1.54.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -8651,6 +9576,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -8662,6 +9588,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -8671,6 +9598,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -8685,14 +9613,16 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minio": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/minio/-/minio-8.0.5.tgz", - "integrity": "sha512-/vAze1uyrK2R/DSkVutE4cjVoAowvIQ18RAwn7HrqnLecLlMazFnY0oNBqfuoAWvu7mZIGX75AzpuV05TJeoHg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/minio/-/minio-8.0.6.tgz", + "integrity": "sha512-sOeh2/b/XprRmEtYsnNRFtOqNRTPDvYtMWh+spWlfsuCV/+IdxNeKVUMKLqI7b5Dr07ZqCPuaRGU/rB9pZYVdQ==", + "license": "Apache-2.0", "dependencies": { "async": "^3.2.4", "block-stream2": "^2.1.0", @@ -8716,12 +9646,44 @@ "node_modules/minio/node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, + "node_modules/minio/node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.1.1" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/minio/node_modules/strnum": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } @@ -8730,6 +9692,7 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", "dependencies": { "minimist": "^1.2.6" }, @@ -8738,25 +9701,45 @@ } }, "node_modules/mlly": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", - "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", + "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", + "license": "MIT", "dependencies": { - "acorn": "^8.14.0", - "pathe": "^2.0.1", - "pkg-types": "^1.3.0", - "ufo": "^1.5.4" + "acorn": "^8.15.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.1" + } + }, + "node_modules/mlly/node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "license": "MIT" + }, + "node_modules/mlly/node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" } }, "node_modules/module-details-from-path": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.4.tgz", - "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==" + "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==", + "license": "MIT" }, "node_modules/mpg123-decoder": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/mpg123-decoder/-/mpg123-decoder-1.0.2.tgz", "integrity": "sha512-cw0Laz57gumQsfCqnNeGtgq64EcyrK/z4qx+kq4iba7iSSXfI7uO3jiHjdHxNp4PB2v08VZYZ2Fr68VM1JkaPQ==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7" }, @@ -8768,13 +9751,15 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/multer": { "version": "1.4.5-lts.2", "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", + "license": "MIT", "dependencies": { "append-field": "^1.0.0", "busboy": "^1.0.0", @@ -8789,9 +9774,9 @@ } }, "node_modules/music-metadata": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.7.1.tgz", - "integrity": "sha512-qoimzvpOnOi2VJpGz6Nz4SwmcYKe39TsAwlcNilgnDrGKNQDib35t0kj5fy1E71DQgqGApBeAKLmcV9pO3l/2w==", + "version": "11.8.3", + "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.8.3.tgz", + "integrity": "sha512-Tgiv4MlCgDb6XzelziB1mmL2xeoHls0KTpCm3Z3qr+LfF4mBEpkuc5vNrc927IT5+S5fv+vzStfI+HYC0igDpA==", "funding": [ { "type": "github", @@ -8804,14 +9789,15 @@ ], "license": "MIT", "dependencies": { + "@borewit/text-codec": "^0.2.0", "@tokenizer/token": "^0.3.0", "content-type": "^1.0.5", "debug": "^4.4.1", "file-type": "^21.0.0", "media-typer": "^1.1.0", - "strtok3": "^10.3.2", - "token-types": "^6.0.3", - "uint8array-extras": "^1.4.0" + "strtok3": "^10.3.4", + "token-types": "^6.1.1", + "uint8array-extras": "^1.4.1" }, "engines": { "node": ">=18" @@ -8836,9 +9822,9 @@ } }, "node_modules/music-metadata/node_modules/strtok3": { - "version": "10.3.2", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.2.tgz", - "integrity": "sha512-or9w505RhhY66+uoe5YOC5QO/bRuATaoim3XTh+pGKx5VMWi/HDhMKuCjDLsLJouU2zg9Hf1nLPcNW7IHv80kQ==", + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", "license": "MIT", "dependencies": { "@tokenizer/token": "^0.3.0" @@ -8852,11 +9838,12 @@ } }, "node_modules/music-metadata/node_modules/token-types": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.3.tgz", - "integrity": "sha512-IKJ6EzuPPWtKtEIEPpIdXv9j5j2LGJEYk0CKY2efgKoYKLBiZdh6iQkLVBow/CB3phyWAWCyk+bZeaimJn6uRQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", "license": "MIT", "dependencies": { + "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" }, @@ -8868,10 +9855,21 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/music-metadata/node_modules/token-types/node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", @@ -8882,6 +9880,7 @@ "version": "2.29.3", "resolved": "https://registry.npmjs.org/nats/-/nats-2.29.3.tgz", "integrity": "sha512-tOQCRCwC74DgBTk4pWZ9V45sk4d7peoE2njVprMRCBXrhJ5q5cYM7i6W+Uvw2qUrcfOSnuisrX7bEx3b3Wx4QA==", + "license": "Apache-2.0", "dependencies": { "nkeys.js": "1.1.0" }, @@ -8893,12 +9892,14 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.4", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -8907,6 +9908,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/nkeys.js/-/nkeys.js-1.1.0.tgz", "integrity": "sha512-tB/a0shZL5UZWSwsoeyqfTszONTt4k2YS0tuQioMOD180+MbombYVgzDUYHlx+gejYK6rgf08n/2Df99WY0Sxg==", + "license": "Apache-2.0", "dependencies": { "tweetnacl": "1.0.3" }, @@ -8918,6 +9920,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz", "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==", + "license": "MIT", "dependencies": { "clone": "2.x" }, @@ -8929,6 +9932,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", + "license": "ISC", "dependencies": { "uuid": "8.3.2" }, @@ -8940,6 +9944,7 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -8959,6 +9964,7 @@ "url": "https://paypal.me/jimmywarting" } ], + "license": "MIT", "engines": { "node": ">=10.5.0" } @@ -8967,6 +9973,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -8982,10 +9989,17 @@ } } }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "license": "MIT" + }, "node_modules/node-wav": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/node-wav/-/node-wav-0.0.2.tgz", "integrity": "sha512-M6Rm/bbG6De/gKGxOpeOobx/dnGuP0dz40adqx38boqHhlWssBJZgLCPBNtb9NkrmnKYiV04xELq+R6PFOnoLA==", + "license": "MIT", "engines": { "node": ">=4.4.0" } @@ -8994,6 +10008,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0" }, @@ -9001,10 +10016,30 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "node_modules/nypm": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.1.tgz", + "integrity": "sha512-hlacBiRiv1k9hZFiphPUkfSQ/ZfQzZDzC+8z0wL3lvDAOUu/2NnChkKuMoMjNur/9OpKuz2QsIeiPVN0xM5Q0w==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.2", + "pathe": "^2.0.3", + "pkg-types": "^2.2.0", + "tinyexec": "^1.0.1" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, + "engines": { + "node": "^14.16.0 || >=16.10.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9013,6 +10048,7 @@ "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -9025,6 +10061,7 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -9034,6 +10071,7 @@ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -9054,6 +10092,7 @@ "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9072,6 +10111,7 @@ "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9086,6 +10126,7 @@ "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -9103,6 +10144,7 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/ogg-opus-decoder/-/ogg-opus-decoder-1.7.0.tgz", "integrity": "sha512-/lrj4+ZGjxZCCNiDSlNEckLrCL+UU9N9XtqES7sXq/Lm6PMi8Pwn/D6TTsbvG45krt21ohAh2FqdEsMuI7ZN4w==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7", "@wasm-audio-decoders/opus-ml": "0.0.1", @@ -9114,15 +10156,23 @@ "url": "https://github.com/sponsors/eshaz" } }, + "node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "license": "MIT" + }, "node_modules/omggif": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", - "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==" + "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==", + "license": "MIT" }, "node_modules/on-exit-leak-free": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -9131,6 +10181,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -9139,9 +10190,10 @@ } }, "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -9151,6 +10203,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } @@ -9159,6 +10212,7 @@ "version": "4.104.0", "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", "integrity": "sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==", + "license": "Apache-2.0", "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", @@ -9185,9 +10239,10 @@ } }, "node_modules/openai/node_modules/@types/node": { - "version": "18.19.117", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.117.tgz", - "integrity": "sha512-hcxGs9TfQGghOM8atpRT+bBMUX7V8WosdYt98bQ59wUToJck55eCOlemJ+0FpOZOQw5ff7LSi9+IO56KvYEFyQ==", + "version": "18.19.124", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.124.tgz", + "integrity": "sha512-hY4YWZFLs3ku6D2Gqo3RchTd9VRCcrjqp/I0mmohYeUVA5Y8eCXKJEasHxLAJVZRJuQogfd1GiJ9lgogBgKeuQ==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -9195,13 +10250,15 @@ "node_modules/openai/node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -9218,6 +10275,7 @@ "version": "0.7.10", "resolved": "https://registry.npmjs.org/opus-decoder/-/opus-decoder-0.7.10.tgz", "integrity": "sha512-qUZdyAK+kKy/wUSd/oZ0ULE9U/yskp332n2oBvSP/Jz/wHsHiVRg33f/tRUR8TRiw+ka7AQUclxcr5TbUJo+VA==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7" }, @@ -9231,6 +10289,7 @@ "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", "dev": true, + "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.6", "object-keys": "^1.1.1", @@ -9248,6 +10307,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -9263,6 +10323,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -9277,6 +10338,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -9284,18 +10346,21 @@ "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -9306,17 +10371,20 @@ "node_modules/parse-bmfont-ascii": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", - "integrity": "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==" + "integrity": "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==", + "license": "MIT" }, "node_modules/parse-bmfont-binary": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", - "integrity": "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==" + "integrity": "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==", + "license": "MIT" }, "node_modules/parse-bmfont-xml": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.6.tgz", "integrity": "sha512-0cEliVMZEhrFDwMh4SxIyVJpqYoOWDJ9P895tFuS+XuNzI5UBmBk5U5O4KuJdTnZpSBI4LFA2+ZiJaiwfSwlMA==", + "license": "MIT", "dependencies": { "xml-parse-from-string": "^1.0.0", "xml2js": "^0.5.0" @@ -9326,6 +10394,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "license": "MIT", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -9338,6 +10407,7 @@ "version": "7.3.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", "dependencies": { "entities": "^6.0.0" }, @@ -9349,6 +10419,7 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "license": "MIT", "dependencies": { "domhandler": "^5.0.3", "parse5": "^7.0.0" @@ -9361,6 +10432,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -9372,6 +10444,7 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -9380,6 +10453,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", "engines": { "node": ">=8" } @@ -9389,6 +10463,7 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9397,6 +10472,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } @@ -9404,12 +10480,14 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -9421,16 +10499,24 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, "node_modules/path-to-regexp": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -9438,12 +10524,14 @@ "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==" + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "license": "MIT" }, "node_modules/peek-readable": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", "integrity": "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -9452,10 +10540,17 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, "node_modules/pg": { "version": "8.16.3", "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", + "license": "MIT", "dependencies": { "pg-connection-string": "^2.9.1", "pg-pool": "^3.10.1", @@ -9482,17 +10577,20 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz", "integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==", + "license": "MIT", "optional": true }, "node_modules/pg-connection-string": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz", - "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==" + "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==", + "license": "MIT" }, "node_modules/pg-int8": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", "engines": { "node": ">=4.0.0" } @@ -9501,6 +10599,7 @@ "version": "3.10.1", "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz", "integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==", + "license": "MIT", "peerDependencies": { "pg": ">=8.0" } @@ -9508,12 +10607,14 @@ "node_modules/pg-protocol": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz", - "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==" + "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==", + "license": "MIT" }, "node_modules/pg-types": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", "dependencies": { "pg-int8": "1.0.1", "postgres-array": "~2.0.0", @@ -9529,6 +10630,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", "dependencies": { "split2": "^4.1.0" } @@ -9536,13 +10638,15 @@ "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -9554,6 +10658,7 @@ "version": "8.21.0", "resolved": "https://registry.npmjs.org/pino/-/pino-8.21.0.tgz", "integrity": "sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -9575,6 +10680,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "license": "MIT", "dependencies": { "readable-stream": "^4.0.0", "split2": "^4.0.0" @@ -9584,6 +10690,7 @@ "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -9598,12 +10705,14 @@ "node_modules/pino-std-serializers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", + "license": "MIT" }, "node_modules/pirates": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "license": "MIT", "engines": { "node": ">= 6" } @@ -9612,6 +10721,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.3.0.tgz", "integrity": "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==", + "license": "ISC", "dependencies": { "pngjs": "^6.0.0" }, @@ -9623,24 +10733,27 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", + "license": "MIT", "engines": { "node": ">=12.13.0" } }, "node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "license": "MIT", "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" } }, "node_modules/pngjs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "license": "MIT", "engines": { "node": ">=14.19.0" } @@ -9649,6 +10762,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -9667,6 +10781,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "lilconfig": "^3.1.1" }, @@ -9698,6 +10813,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -9706,6 +10822,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9714,6 +10831,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9722,6 +10840,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -9734,6 +10853,7 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -9743,6 +10863,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -9758,6 +10879,7 @@ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, + "license": "MIT", "dependencies": { "fast-diff": "^1.1.2" }, @@ -9766,13 +10888,14 @@ } }, "node_modules/prisma": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.11.1.tgz", - "integrity": "sha512-VzJToRlV0s9Vu2bfqHiRJw73hZNCG/AyJeX+kopbu4GATTjTUdEWUteO3p4BLYoHpMS4o8pD3v6tF44BHNZI1w==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.16.1.tgz", + "integrity": "sha512-MFkMU0eaDDKAT4R/By2IA9oQmwLTxokqv2wegAErr9Rf+oIe7W2sYpE/Uxq0H2DliIR7vnV63PkC1bEwUtl98w==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "@prisma/config": "6.11.1", - "@prisma/engines": "6.11.1" + "@prisma/config": "6.16.1", + "@prisma/engines": "6.16.1" }, "bin": { "prisma": "build/index.js" @@ -9793,6 +10916,7 @@ "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", "engines": { "node": ">= 0.6.0" } @@ -9800,18 +10924,21 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" }, "node_modules/process-warning": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", - "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", + "license": "MIT" }, "node_modules/protobufjs": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.3.tgz", - "integrity": "sha512-sildjKwVqOI2kmFDiXQ6aEB0fjYTafpEvIBs8tOR8qI4spuL9OPROLVu2qZqi/xgCfsHIwVqlaF8JBjWFHnKbw==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -9834,6 +10961,7 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -9846,6 +10974,7 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", "engines": { "node": ">= 0.10" } @@ -9853,20 +10982,39 @@ "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", "engines": { "node": ">=6" } }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, "node_modules/pusher": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/pusher/-/pusher-5.2.0.tgz", "integrity": "sha512-F6LNiZyJsIkoHLz+YurjKZ1HH8V1/cMggn4k97kihjP3uTvm0P4mZzSFeHOWIy+PlJ2VInJBhUFJBYLsFR5cjg==", + "license": "MIT", "dependencies": { "@types/node-fetch": "^2.5.7", "abort-controller": "^3.0.0", @@ -9883,6 +11031,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/qoa-format/-/qoa-format-1.0.1.tgz", "integrity": "sha512-dMB0Z6XQjdpz/Cw4Rf6RiBpQvUSPCfYlQMWvmuWlWkAT7nDQD29cVZ1SwDUB6DYJSitHENwbt90lqfI+7bvMcw==", + "license": "MIT", "dependencies": { "@thi.ng/bitstream": "^2.2.12" } @@ -9891,6 +11040,7 @@ "version": "1.5.4", "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "license": "MIT", "dependencies": { "dijkstrajs": "^1.0.1", "pngjs": "^5.0.0", @@ -9915,16 +11065,24 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, + "node_modules/qrcode/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, "node_modules/qrcode/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -9937,6 +11095,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -9948,6 +11107,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -9962,6 +11122,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -9973,14 +11134,30 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", "engines": { "node": ">=10.13.0" } }, + "node_modules/qrcode/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/qrcode/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -9993,12 +11170,14 @@ "node_modules/qrcode/node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" }, "node_modules/qrcode/node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", @@ -10020,6 +11199,7 @@ "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -10032,6 +11212,7 @@ "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" }, @@ -10046,6 +11227,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "license": "MIT", "dependencies": { "decode-uri-component": "^0.2.2", "filter-obj": "^1.1.0", @@ -10071,7 +11253,8 @@ "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT" }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -10091,17 +11274,20 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/quick-format-unescaped": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -10110,6 +11296,7 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -10120,10 +11307,21 @@ "node": ">= 0.8" } }, + "node_modules/rc9": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "destr": "^2.0.3" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -10137,6 +11335,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.4.tgz", "integrity": "sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==", + "license": "MIT", "dependencies": { "readable-stream": "^4.7.0" }, @@ -10152,6 +11351,7 @@ "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -10163,10 +11363,24 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/real-require": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "license": "MIT", "engines": { "node": ">= 12.13.0" } @@ -10175,6 +11389,10 @@ "version": "4.7.1", "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.1.tgz", "integrity": "sha512-S1bJDnqLftzHXHP8JsT5II/CtHWQrASX5K96REjWjlmWKrviSOLWmM7QnRLstAWsu1VBBV1ffV6DzCvxNP0UJQ==", + "license": "MIT", + "workspaces": [ + "./packages/*" + ], "dependencies": { "@redis/bloom": "1.2.0", "@redis/client": "1.6.1", @@ -10189,6 +11407,7 @@ "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -10211,6 +11430,7 @@ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -10230,6 +11450,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -10238,6 +11459,7 @@ "version": "7.5.2", "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz", "integrity": "sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ==", + "license": "MIT", "dependencies": { "debug": "^4.3.5", "module-details-from-path": "^1.0.3", @@ -10250,17 +11472,20 @@ "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "license": "MIT", "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", @@ -10281,6 +11506,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -10300,6 +11526,7 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -10311,6 +11538,7 @@ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -10322,9 +11550,10 @@ } }, "node_modules/rollup": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.2.tgz", - "integrity": "sha512-PVoapzTwSEcelaWGth3uR66u7ZRo6qhPHc0f2uRO9fX6XDVNrIiGYS0Pj9+R8yIIYSD/mCx2b16Ws9itljKSPg==", + "version": "4.50.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.2.tgz", + "integrity": "sha512-BgLRGy7tNS9H66aIMASq1qSYbAAJV6Z6WR4QYTvj5FgF15rZ/ympT1uixHXwzbZUBDbkvqUI1KR0fH1FhMaQ9w==", + "license": "MIT", "dependencies": { "@types/estree": "1.0.8" }, @@ -10336,26 +11565,27 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.44.2", - "@rollup/rollup-android-arm64": "4.44.2", - "@rollup/rollup-darwin-arm64": "4.44.2", - "@rollup/rollup-darwin-x64": "4.44.2", - "@rollup/rollup-freebsd-arm64": "4.44.2", - "@rollup/rollup-freebsd-x64": "4.44.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.44.2", - "@rollup/rollup-linux-arm-musleabihf": "4.44.2", - "@rollup/rollup-linux-arm64-gnu": "4.44.2", - "@rollup/rollup-linux-arm64-musl": "4.44.2", - "@rollup/rollup-linux-loongarch64-gnu": "4.44.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.44.2", - "@rollup/rollup-linux-riscv64-gnu": "4.44.2", - "@rollup/rollup-linux-riscv64-musl": "4.44.2", - "@rollup/rollup-linux-s390x-gnu": "4.44.2", - "@rollup/rollup-linux-x64-gnu": "4.44.2", - "@rollup/rollup-linux-x64-musl": "4.44.2", - "@rollup/rollup-win32-arm64-msvc": "4.44.2", - "@rollup/rollup-win32-ia32-msvc": "4.44.2", - "@rollup/rollup-win32-x64-msvc": "4.44.2", + "@rollup/rollup-android-arm-eabi": "4.50.2", + "@rollup/rollup-android-arm64": "4.50.2", + "@rollup/rollup-darwin-arm64": "4.50.2", + "@rollup/rollup-darwin-x64": "4.50.2", + "@rollup/rollup-freebsd-arm64": "4.50.2", + "@rollup/rollup-freebsd-x64": "4.50.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.50.2", + "@rollup/rollup-linux-arm-musleabihf": "4.50.2", + "@rollup/rollup-linux-arm64-gnu": "4.50.2", + "@rollup/rollup-linux-arm64-musl": "4.50.2", + "@rollup/rollup-linux-loong64-gnu": "4.50.2", + "@rollup/rollup-linux-ppc64-gnu": "4.50.2", + "@rollup/rollup-linux-riscv64-gnu": "4.50.2", + "@rollup/rollup-linux-riscv64-musl": "4.50.2", + "@rollup/rollup-linux-s390x-gnu": "4.50.2", + "@rollup/rollup-linux-x64-gnu": "4.50.2", + "@rollup/rollup-linux-x64-musl": "4.50.2", + "@rollup/rollup-openharmony-arm64": "4.50.2", + "@rollup/rollup-win32-arm64-msvc": "4.50.2", + "@rollup/rollup-win32-ia32-msvc": "4.50.2", + "@rollup/rollup-win32-x64-msvc": "4.50.2", "fsevents": "~2.3.2" } }, @@ -10378,6 +11608,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -10396,6 +11627,7 @@ "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", @@ -10427,13 +11659,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "isarray": "^2.0.5" @@ -10449,6 +11683,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -10465,6 +11700,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", "engines": { "node": ">=10" } @@ -10472,17 +11708,20 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" }, "node_modules/sax": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "license": "ISC" }, "node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -10494,6 +11733,7 @@ "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -10517,6 +11757,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -10524,12 +11765,14 @@ "node_modules/send/node_modules/debug/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/send/node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -10538,6 +11781,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -10549,6 +11793,7 @@ "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", @@ -10562,12 +11807,14 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -10585,6 +11832,7 @@ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -10600,6 +11848,7 @@ "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", "dev": true, + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", @@ -10612,13 +11861,15 @@ "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" }, "node_modules/sharp": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.2.tgz", - "integrity": "sha512-lszvBmB9QURERtyKT2bNmsgxXK0ShJrL/fvqlonCo7e6xBF8nT8xU6pW+PMIbLsz0RxQk3rgH9kd8UmvOzlMJg==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.3.tgz", + "integrity": "sha512-eX2IQ6nFohW4DbvHIOLRB3MHFpYqaqvXd3Tp5e/T/dSH83fxaNJQRvDMhASmkNTsNTVF2/OOopzRCt7xokgPfg==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.4", @@ -10631,33 +11882,35 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.34.2", - "@img/sharp-darwin-x64": "0.34.2", - "@img/sharp-libvips-darwin-arm64": "1.1.0", - "@img/sharp-libvips-darwin-x64": "1.1.0", - "@img/sharp-libvips-linux-arm": "1.1.0", - "@img/sharp-libvips-linux-arm64": "1.1.0", - "@img/sharp-libvips-linux-ppc64": "1.1.0", - "@img/sharp-libvips-linux-s390x": "1.1.0", - "@img/sharp-libvips-linux-x64": "1.1.0", - "@img/sharp-libvips-linuxmusl-arm64": "1.1.0", - "@img/sharp-libvips-linuxmusl-x64": "1.1.0", - "@img/sharp-linux-arm": "0.34.2", - "@img/sharp-linux-arm64": "0.34.2", - "@img/sharp-linux-s390x": "0.34.2", - "@img/sharp-linux-x64": "0.34.2", - "@img/sharp-linuxmusl-arm64": "0.34.2", - "@img/sharp-linuxmusl-x64": "0.34.2", - "@img/sharp-wasm32": "0.34.2", - "@img/sharp-win32-arm64": "0.34.2", - "@img/sharp-win32-ia32": "0.34.2", - "@img/sharp-win32-x64": "0.34.2" + "@img/sharp-darwin-arm64": "0.34.3", + "@img/sharp-darwin-x64": "0.34.3", + "@img/sharp-libvips-darwin-arm64": "1.2.0", + "@img/sharp-libvips-darwin-x64": "1.2.0", + "@img/sharp-libvips-linux-arm": "1.2.0", + "@img/sharp-libvips-linux-arm64": "1.2.0", + "@img/sharp-libvips-linux-ppc64": "1.2.0", + "@img/sharp-libvips-linux-s390x": "1.2.0", + "@img/sharp-libvips-linux-x64": "1.2.0", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.0", + "@img/sharp-libvips-linuxmusl-x64": "1.2.0", + "@img/sharp-linux-arm": "0.34.3", + "@img/sharp-linux-arm64": "0.34.3", + "@img/sharp-linux-ppc64": "0.34.3", + "@img/sharp-linux-s390x": "0.34.3", + "@img/sharp-linux-x64": "0.34.3", + "@img/sharp-linuxmusl-arm64": "0.34.3", + "@img/sharp-linuxmusl-x64": "0.34.3", + "@img/sharp-wasm32": "0.34.3", + "@img/sharp-win32-arm64": "0.34.3", + "@img/sharp-win32-ia32": "0.34.3", + "@img/sharp-win32-x64": "0.34.3" } }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -10669,6 +11922,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { "node": ">=8" } @@ -10676,12 +11930,14 @@ "node_modules/shimmer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", + "license": "BSD-2-Clause" }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", @@ -10700,6 +11956,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" @@ -10715,6 +11972,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -10732,6 +11990,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -10750,6 +12009,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", "engines": { "node": ">=14" }, @@ -10758,9 +12018,10 @@ } }, "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", + "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" } @@ -10769,6 +12030,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.3.tgz", "integrity": "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA==", + "license": "MIT", "engines": { "node": ">=20.12.2" } @@ -10777,6 +12039,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/simple-yenc/-/simple-yenc-1.0.4.tgz", "integrity": "sha512-5gvxpSd79e9a3V4QDYUqnqxeD4HGlhCakVpb6gMnDD7lexJggSBJRBO5h52y/iJrdXRilX9UCuDaIJhSWm5OWw==", + "license": "MIT", "funding": { "type": "individual", "url": "https://github.com/sponsors/eshaz" @@ -10787,6 +12050,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -10805,6 +12069,7 @@ "version": "4.8.1", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "license": "MIT", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", @@ -10822,6 +12087,7 @@ "version": "2.5.5", "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "license": "MIT", "dependencies": { "debug": "~4.3.4", "ws": "~8.17.1" @@ -10831,6 +12097,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -10847,6 +12114,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -10867,6 +12135,7 @@ "version": "4.8.1", "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz", "integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==", + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.2", @@ -10881,6 +12150,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -10897,6 +12167,7 @@ "version": "4.2.4", "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" @@ -10909,6 +12180,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -10925,6 +12197,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -10938,12 +12211,12 @@ } }, "node_modules/socks": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", - "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", "license": "MIT", "dependencies": { - "ip-address": "^9.0.5", + "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" }, "engines": { @@ -10969,14 +12242,55 @@ "version": "3.8.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", "integrity": "sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" } }, + "node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "deprecated": "The work that was done in this beta branch won't be included in future versions", + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map/node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "license": "MIT", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/source-map/node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "license": "BSD-2-Clause" + }, + "node_modules/source-map/node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/split-on-first": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "license": "MIT", "engines": { "node": ">=6" } @@ -10985,20 +12299,16 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", "engines": { "node": ">= 10.x" } }, - "node_modules/sprintf-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "license": "BSD-3-Clause" - }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -11008,6 +12318,7 @@ "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "internal-slot": "^1.1.0" @@ -11019,12 +12330,14 @@ "node_modules/stream-chain": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz", - "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==" + "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==", + "license": "BSD-3-Clause" }, "node_modules/stream-json": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz", "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==", + "license": "BSD-3-Clause", "dependencies": { "stream-chain": "^2.2.5" } @@ -11041,6 +12354,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "license": "MIT", "engines": { "node": ">=4" } @@ -11049,21 +12363,26 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/string-width-cjs": { @@ -11071,6 +12390,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -11086,17 +12406,39 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, - "node_modules/string-width/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } }, "node_modules/string.prototype.trim": { "version": "1.2.10", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", @@ -11118,6 +12460,7 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", @@ -11136,6 +12479,7 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -11152,6 +12496,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -11164,6 +12509,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -11176,6 +12522,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -11185,6 +12532,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -11193,20 +12541,22 @@ } }, "node_modules/strnum": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", - "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" } - ] + ], + "license": "MIT" }, "node_modules/strtok3": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", "integrity": "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==", + "license": "MIT", "dependencies": { "@tokenizer/token": "^0.3.0", "peek-readable": "^4.1.0" @@ -11223,6 +12573,7 @@ "version": "3.35.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", @@ -11244,6 +12595,7 @@ "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -11263,6 +12615,7 @@ "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -11278,6 +12631,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -11289,6 +12643,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -11297,9 +12652,10 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.26.2", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.26.2.tgz", - "integrity": "sha512-WmMS9iMlHQejNm/Uw5ZTo4e3M2QMmEavRz7WLWVsq7Mlx4PSHJbY+VCrLsAz9wLxyHVgrJdt7N8+SdQLa52Ykg==", + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.29.0.tgz", + "integrity": "sha512-gqs7Md3AxP4mbpXAq31o5QW+wGUZsUzVatg70yXpUR245dfIis5jAzufBd+UQM/w2xSfrhvA1eqsrgnl2PbezQ==", + "license": "Apache-2.0", "dependencies": { "@scarf/scarf": "=1.4.0" } @@ -11308,6 +12664,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-5.0.1.tgz", "integrity": "sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==", + "license": "MIT", "dependencies": { "swagger-ui-dist": ">=5.0.0" }, @@ -11319,12 +12676,13 @@ } }, "node_modules/synckit": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.8.tgz", - "integrity": "sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", "dev": true, + "license": "MIT", "dependencies": { - "@pkgr/core": "^0.2.4" + "@pkgr/core": "^0.2.9" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -11337,12 +12695,14 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", "dependencies": { "any-promise": "^1.0.0" } @@ -11351,6 +12711,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", "dependencies": { "thenify": ">= 3.1.0 < 4" }, @@ -11362,6 +12723,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz", "integrity": "sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==", + "license": "MIT", "dependencies": { "real-require": "^0.2.0" } @@ -11370,6 +12732,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "license": "MIT", "dependencies": { "readable-stream": "3" } @@ -11377,20 +12740,23 @@ "node_modules/tinycolor2": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", - "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==" + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz", + "integrity": "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==", + "license": "MIT" }, "node_modules/tinyglobby": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", - "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", "dependencies": { - "fdir": "^6.4.4", - "picomatch": "^4.0.2" + "fdir": "^6.5.0", + "picomatch": "^4.0.3" }, "engines": { "node": ">=12.0.0" @@ -11400,9 +12766,13 @@ } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.6", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", - "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, "peerDependencies": { "picomatch": "^3 || ^4" }, @@ -11413,9 +12783,10 @@ } }, "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -11428,6 +12799,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -11439,6 +12811,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", "engines": { "node": ">=0.6" } @@ -11447,6 +12820,7 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", "integrity": "sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==", + "license": "MIT", "dependencies": { "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" @@ -11462,12 +12836,14 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "license": "MIT", "bin": { "tree-kill": "cli.js" } @@ -11477,6 +12853,7 @@ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, @@ -11487,13 +12864,15 @@ "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "license": "Apache-2.0" }, "node_modules/tsconfig-paths": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", "dev": true, + "license": "MIT", "dependencies": { "json5": "^2.2.2", "minimist": "^1.2.6", @@ -11506,12 +12885,14 @@ "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/tsup": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.0.tgz", "integrity": "sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==", + "license": "MIT", "dependencies": { "bundle-require": "^5.1.0", "cac": "^6.7.14", @@ -11559,78 +12940,25 @@ } } }, - "node_modules/tsup/node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/tsup/node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/tsup/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/tsup/node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "dependencies": { - "whatwg-url": "^7.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/tsup/node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/tsup/node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" - }, - "node_modules/tsup/node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } + "node_modules/tsup/node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "license": "MIT" }, "node_modules/tsx": { - "version": "4.20.3", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.3.tgz", - "integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==", + "version": "4.20.5", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.5.tgz", + "integrity": "sha512-+wKjMNU9w/EaQayHXb7WA7ZaHY6hN8WgfvHNQ3t1PnU91/7O8TcTnIhCDYTZwnt8JsO9IBqZ30Ln1r7pPF52Aw==", "devOptional": true, "license": "MIT", "dependencies": { @@ -11650,18 +12978,21 @@ "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" }, "node_modules/tweetnacl-util": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "license": "Unlicense" }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -11674,6 +13005,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -11685,6 +13017,7 @@ "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -11697,6 +13030,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -11706,6 +13040,7 @@ "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -11720,6 +13055,7 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", @@ -11739,6 +13075,7 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", @@ -11760,6 +13097,7 @@ "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -11778,13 +13116,15 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" }, "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "devOptional": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11796,12 +13136,13 @@ "node_modules/ufo": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", - "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==" + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "license": "MIT" }, "node_modules/uint8array-extras": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.4.0.tgz", - "integrity": "sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", "license": "MIT", "engines": { "node": ">=18" @@ -11815,6 +13156,7 @@ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", @@ -11831,12 +13173,14 @@ "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -11846,6 +13190,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -11854,6 +13199,7 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", + "license": "MIT", "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -11863,6 +13209,7 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -11871,12 +13218,14 @@ "node_modules/url/node_modules/punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", + "license": "MIT" }, "node_modules/utif2": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/utif2/-/utif2-4.1.0.tgz", "integrity": "sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w==", + "license": "MIT", "dependencies": { "pako": "^1.0.11" } @@ -11885,6 +13234,7 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -11896,12 +13246,14 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", "engines": { "node": ">= 0.4.0" } @@ -11914,6 +13266,7 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -11922,6 +13275,7 @@ "version": "13.15.15", "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.15.tgz", "integrity": "sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==", + "license": "MIT", "engines": { "node": ">= 0.10" } @@ -11930,6 +13284,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -11938,6 +13293,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "license": "MIT", "dependencies": { "util": "^0.12.3" }, @@ -11949,6 +13305,7 @@ "version": "4.0.0-beta.3", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", "engines": { "node": ">= 14" } @@ -11956,12 +13313,14 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -11971,6 +13330,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -11986,6 +13346,7 @@ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "dev": true, + "license": "MIT", "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", @@ -12005,6 +13366,7 @@ "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", @@ -12032,6 +13394,7 @@ "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, + "license": "MIT", "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", @@ -12048,12 +13411,14 @@ "node_modules/which-module": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" }, "node_modules/which-typed-array": { "version": "1.1.19", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", @@ -12075,21 +13440,23 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -12100,6 +13467,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -12112,16 +13480,77 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -12141,12 +13570,14 @@ "node_modules/xml-parse-from-string": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", - "integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==" + "integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==", + "license": "MIT" }, "node_modules/xml2js": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "license": "MIT", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -12159,6 +13590,7 @@ "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", "engines": { "node": ">=4.0" } @@ -12175,6 +13607,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", "engines": { "node": ">=0.4" } @@ -12183,6 +13616,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } @@ -12190,31 +13624,33 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" }, "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "license": "MIT", "dependencies": { - "cliui": "^8.0.1", + "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", + "string-width": "^7.2.0", "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "yargs-parser": "^22.0.0" }, "engines": { - "node": ">=12" + "node": "^20.19.0 || ^22.12.0 || >=23" } }, "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", "engines": { - "node": ">=12" + "node": "^20.19.0 || ^22.12.0 || >=23" } }, "node_modules/yocto-queue": { @@ -12222,6 +13658,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -12233,6 +13670,7 @@ "version": "3.25.76", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index f73ca388..0633d1e9 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "github:WhiskeySockets/Baileys", + "baileys": "^7.0.0-rc.3", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", @@ -125,7 +125,7 @@ "eslint-plugin-simple-import-sort": "^10.0.0", "prettier": "^3.4.2", "tsconfig-paths": "^4.2.0", - "tsx": "^4.20.3", + "tsx": "^4.20.5", "typescript": "^5.7.2" } } diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index fffae53c..ace12e16 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -151,6 +151,19 @@ import { v4 } from 'uuid'; import { BaileysMessageProcessor } from './baileysMessage.processor'; import { useVoiceCallsBaileys } from './voiceCalls/useVoiceCallsBaileys'; +export interface ExtendedMessageKey extends WAMessageKey { + senderPn?: string; + previousRemoteJid?: string | null; +} + +export interface ExtendedIMessageKey extends proto.IMessageKey { + senderPn?: string; + remoteJidAlt?: string; + participantAlt?: string; + server_id?: string; + isViewOnce?: boolean; +} + const groupMetadataCache = new CacheService(new CacheEngine(configService, 'groups').getEngine()); // Adicione a função getVideoDuration no início do arquivo @@ -986,8 +999,8 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - if (m.key.remoteJid?.includes('@lid') && m.key.remoteJidAlt) { - m.key.remoteJid = m.key.remoteJidAlt; + if (m.key.remoteJid?.includes('@lid') && (m.key as ExtendedIMessageKey).senderPn) { + m.key.remoteJid = (m.key as ExtendedIMessageKey).senderPn; } if (Long.isLong(m?.messageTimestamp)) { @@ -1052,9 +1065,9 @@ export class BaileysStartupService extends ChannelStartupService { ) => { try { for (const received of messages) { - if (received.key.remoteJid?.includes('@lid') && received.key.remoteJidAlt) { - (received.key as { previousRemoteJid?: string | null }).previousRemoteJid = received.key.remoteJid; - received.key.remoteJid = received.key.remoteJidAlt; + if (received.key.remoteJid?.includes('@lid') && (received.key as ExtendedMessageKey).senderPn) { + (received.key as ExtendedMessageKey).previousRemoteJid = received.key.remoteJid; + received.key.remoteJid = (received.key as ExtendedMessageKey).senderPn; } if ( received?.messageStubParameters?.some?.((param) => @@ -4308,47 +4321,30 @@ export class BaileysStartupService extends ChannelStartupService { throw new Error('Method not available in the Baileys service'); } - private sanitizeMessageContent(messageContent: any): any { - if (!messageContent) return messageContent; + private convertLongToNumber(obj: any): any { + if (obj === null || obj === undefined) { + return obj; + } - // Deep clone and sanitize to avoid modifying original - return JSON.parse( - JSON.stringify(messageContent, (key, value) => { - // Convert Long objects to numbers - if (Long.isLong(value)) { - return value.toNumber(); + if (Long.isLong(obj)) { + return obj.toNumber(); + } + + if (Array.isArray(obj)) { + return obj.map((item) => this.convertLongToNumber(item)); + } + + if (typeof obj === 'object') { + const converted: any = {}; + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + converted[key] = this.convertLongToNumber(obj[key]); } + } + return converted; + } - // Convert Uint8Array to regular arrays - if (value instanceof Uint8Array) { - return Array.from(value); - } - - // Remove functions and other non-serializable objects - if (typeof value === 'function') { - return undefined; - } - - // Handle objects with toJSON method - if (value && typeof value === 'object' && typeof value.toJSON === 'function') { - return value.toJSON(); - } - - // Handle special objects that might not serialize properly - if (value && typeof value === 'object') { - // Check if it's a plain object or has prototype issues - try { - JSON.stringify(value); - return value; - } catch (e) { - // If it can't be stringified, return a safe representation - return '[Non-serializable object]'; - } - } - - return value; - }), - ); + return obj; } private prepareMessage(message: proto.IWebMessageInfo): any { @@ -4363,11 +4359,11 @@ export class BaileysStartupService extends ChannelStartupService { ? 'Você' : message?.participant || (message.key?.participant ? message.key.participant.split('@')[0] : null)), status: status[message.status], - message: this.sanitizeMessageContent({ ...message.message }), - contextInfo: this.sanitizeMessageContent(contentMsg?.contextInfo), + message: this.convertLongToNumber({ ...message.message }), + contextInfo: this.convertLongToNumber(contentMsg?.contextInfo), messageType: contentType || 'unknown', messageTimestamp: Long.isLong(message.messageTimestamp) - ? (message.messageTimestamp as Long).toNumber() + ? message.messageTimestamp.toNumber() : (message.messageTimestamp as number), instanceId: this.instanceId, source: getDevice(message.key.id), diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 2cf16134..be3d5620 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -1,5 +1,6 @@ import { InstanceDto } from '@api/dto/instance.dto'; import { Options, Quoted, SendAudioDto, SendMediaDto, SendTextDto } from '@api/dto/sendMessage.dto'; +import { ExtendedMessageKey } from '@api/integrations/channel/whatsapp/whatsapp.baileys.service'; import { ChatwootDto } from '@api/integrations/chatbot/chatwoot/dto/chatwoot.dto'; import { postgresClient } from '@api/integrations/chatbot/chatwoot/libs/postgres.client'; import { chatwootImport } from '@api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper'; @@ -1284,12 +1285,7 @@ export class ChatwootService { }); if (message) { - const key = message.key as { - id: string; - remoteJid: string; - fromMe: boolean; - participant: string; - }; + const key = message.key as ExtendedMessageKey; await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); @@ -1487,12 +1483,7 @@ export class ChatwootService { }, }); if (lastMessage && !lastMessage.chatwootIsRead) { - const key = lastMessage.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = lastMessage.key as ExtendedMessageKey; waInstance?.markMessageAsRead({ readMessages: [ @@ -1550,12 +1541,7 @@ export class ChatwootService { chatwootMessageIds: ChatwootMessage, instance: InstanceDto, ) { - const key = message.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = message.key as ExtendedMessageKey; if (!chatwootMessageIds.messageId || !key?.id) { return; @@ -1623,12 +1609,7 @@ export class ChatwootService { }, }); - const key = message?.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = message?.key as ExtendedMessageKey; if (message && key?.id) { return { @@ -2258,12 +2239,13 @@ export class ChatwootService { body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text }\n\n_\`${i18next.t('cw.message.edited')}.\`_`; const message = await this.getMessageByKeyId(instance, body?.key?.id); - const key = message.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + + if (!message) { + this.logger.warn('Message not found for edit event'); + return; + } + + const key = message.key as ExtendedMessageKey; const messageType = key?.fromMe ? 'outgoing' : 'incoming'; @@ -2541,7 +2523,7 @@ export class ChatwootService { const savedMessages = await this.prismaRepository.message.findMany({ where: { Instance: { name: instance.instanceName }, - messageTimestamp: { gte: dayjs().subtract(6, 'hours').unix() }, + messageTimestamp: { gte: Number(dayjs().subtract(6, 'hours').unix()) }, AND: ids.map((id) => ({ key: { path: ['id'], not: id } })), }, }); diff --git a/src/api/services/monitor.service.ts b/src/api/services/monitor.service.ts index 90962dcb..ea472182 100644 --- a/src/api/services/monitor.service.ts +++ b/src/api/services/monitor.service.ts @@ -29,6 +29,8 @@ export class WAMonitoringService { Object.assign(this.db, configService.get('DATABASE')); Object.assign(this.redis, configService.get('CACHE')); + + (this as any).providerSession = Object.freeze(configService.get('PROVIDER')); } private readonly db: Partial = {}; @@ -37,7 +39,7 @@ export class WAMonitoringService { private readonly logger = new Logger('WAMonitoringService'); public readonly waInstances: Record = {}; - private readonly providerSession = Object.freeze(this.configService.get('PROVIDER')); + private readonly providerSession: ProviderSession; public delInstanceTime(instance: string) { const time = this.configService.get('DEL_INSTANCE'); diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index b26a5ef0..af737ed0 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -3,6 +3,8 @@ import fs from 'fs'; import i18next from 'i18next'; import path from 'path'; +const __dirname = path.resolve(process.cwd(), 'src', 'utils'); + const languages = ['en', 'pt-BR', 'es']; const translationsPath = path.join(__dirname, 'translations'); const configService: ConfigService = new ConfigService(); @@ -12,8 +14,9 @@ const resources: any = {}; languages.forEach((language) => { const languagePath = path.join(translationsPath, `${language}.json`); if (fs.existsSync(languagePath)) { + const translationContent = fs.readFileSync(languagePath, 'utf8'); resources[language] = { - translation: require(languagePath), + translation: JSON.parse(translationContent), }; } }); From 875b874a7b305c3fc22d8848912bd224b2688e5e Mon Sep 17 00:00:00 2001 From: Elizandro Pacheco Date: Tue, 16 Sep 2025 19:34:44 -0300 Subject: [PATCH 070/129] feat: add Prometheus-compatible /metrics endpoint (gated by PROMETHEUS_METRICS) --- src/api/routes/index.router.ts | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index 48954ea0..d28c05f2 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -6,6 +6,7 @@ import { ChatbotRouter } from '@api/integrations/chatbot/chatbot.router'; import { EventRouter } from '@api/integrations/event/event.router'; import { StorageRouter } from '@api/integrations/storage/storage.router'; import { configService } from '@config/env.config'; +import { waMonitor } from '@api/server.module'; import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion'; import { Router } from 'express'; import fs from 'fs'; @@ -42,6 +43,65 @@ const telemetry = new Telemetry(); const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); +// Expose Prometheus metrics when enabled by env flag +if (process.env.PROMETHEUS_METRICS === 'true') { + router.get('/metrics', async (req, res) => { + res.set('Content-Type', 'text/plain; version=0.0.4; charset=utf-8'); + res.set('Cache-Control', 'no-cache, no-store, must-revalidate'); + + const escapeLabel = (value: unknown) => + String(value ?? '') + .replace(/\\/g, '\\\\') + .replace(/\n/g, '\\n') + .replace(/"/g, '\\"'); + + const lines: string[] = []; + + const clientName = process.env.DATABASE_CONNECTION_CLIENT_NAME || ''; + const serverUrl = serverConfig.URL || ''; + + // environment info + lines.push('# HELP evolution_environment_info Environment information'); + lines.push('# TYPE evolution_environment_info gauge'); + lines.push( + `evolution_environment_info{version="${escapeLabel(packageJson.version)}",clientName="${escapeLabel( + clientName, + )}",serverUrl="${escapeLabel(serverUrl)}"} 1`, + ); + + const instances = (waMonitor && waMonitor.waInstances) || {}; + const instanceEntries = Object.entries(instances); + + // total instances + lines.push('# HELP evolution_instances_total Total number of instances'); + lines.push('# TYPE evolution_instances_total gauge'); + lines.push(`evolution_instances_total ${instanceEntries.length}`); + + // per-instance status + lines.push('# HELP evolution_instance_up 1 if instance state is open, else 0'); + lines.push('# TYPE evolution_instance_up gauge'); + lines.push('# HELP evolution_instance_state Instance state as a labelled metric'); + lines.push('# TYPE evolution_instance_state gauge'); + + for (const [name, instance] of instanceEntries) { + const state = instance?.connectionStatus?.state || 'unknown'; + const integration = instance?.integration || ''; + const up = state === 'open' ? 1 : 0; + + lines.push( + `evolution_instance_up{instance="${escapeLabel(name)}",integration="${escapeLabel(integration)}"} ${up}`, + ); + lines.push( + `evolution_instance_state{instance="${escapeLabel(name)}",integration="${escapeLabel( + integration, + )}",state="${escapeLabel(state)}"} 1`, + ); + } + + res.send(lines.join('\n') + '\n'); + }); +} + if (!serverConfig.DISABLE_MANAGER) router.use('/manager', new ViewsRouter().router); router.get('/assets/*', (req, res) => { From a3223ec890808048fa659bece84979d660137361 Mon Sep 17 00:00:00 2001 From: Elizandro Pacheco Date: Tue, 16 Sep 2025 19:35:22 -0300 Subject: [PATCH 071/129] chore: local compose/image tweaks for testing metrics (not part of PR) --- Dockerfile.metrics | 19 +++++++++++++++++++ docker-compose.yaml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.metrics diff --git a/Dockerfile.metrics b/Dockerfile.metrics new file mode 100644 index 00000000..e8d46d04 --- /dev/null +++ b/Dockerfile.metrics @@ -0,0 +1,19 @@ +FROM evoapicloud/evolution-api:latest AS base +WORKDIR /evolution + +# Copiamos apenas o necessário para recompilar o dist com as mudanças locais +COPY tsconfig.json tsup.config.ts package.json ./ +COPY src ./src + +# Recompila usando os node_modules já presentes na imagem base +RUN npm run build + +# Runtime final: reaproveita a imagem oficial e apenas sobrepõe o dist +FROM evoapicloud/evolution-api:latest AS final +WORKDIR /evolution +COPY --from=base /evolution/dist ./dist + +ENV PROMETHEUS_METRICS=true + +# Entrada original da imagem oficial já sobe o app em /evolution + diff --git a/docker-compose.yaml b/docker-compose.yaml index b049f00f..b4899797 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ version: "3.8" services: api: container_name: evolution_api - image: evoapicloud/evolution-api:latest + image: evolution/api:metrics restart: always depends_on: - redis From 0e737d48c12355597b9d8a287846bb97cd29f5b3 Mon Sep 17 00:00:00 2001 From: Elizandro Pacheco Date: Tue, 16 Sep 2025 19:40:21 -0300 Subject: [PATCH 072/129] chore(metrics): use 'unknown' as fallback for clientName label --- src/api/routes/index.router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index d28c05f2..1d865269 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -57,7 +57,7 @@ if (process.env.PROMETHEUS_METRICS === 'true') { const lines: string[] = []; - const clientName = process.env.DATABASE_CONNECTION_CLIENT_NAME || ''; + const clientName = process.env.DATABASE_CONNECTION_CLIENT_NAME || 'unknown'; const serverUrl = serverConfig.URL || ''; // environment info From 3eeffe4586cd1ac6126159dcdfac703796993e5f Mon Sep 17 00:00:00 2001 From: furious Date: Tue, 16 Sep 2025 23:02:36 -0300 Subject: [PATCH 073/129] fix: convert mediaKey from media messages to avoid bad decrypt errors --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index ace12e16..4b1db159 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -3601,7 +3601,7 @@ export class BaileysStartupService extends ChannelStartupService { } if (typeof mediaMessage['mediaKey'] === 'object') { - msg.message = JSON.parse(JSON.stringify(msg.message)); + msg.message[mediaType].mediaKey = Uint8Array.from(Object.values(mediaMessage['mediaKey'])); } let buffer: Buffer; From 4378c33f42acbdeafcb67ec8ec701bf6a734fa66 Mon Sep 17 00:00:00 2001 From: ricael Date: Wed, 17 Sep 2025 08:51:16 -0300 Subject: [PATCH 074/129] Merge branch 'develop' into main_ From 481e179cc5796137ee6808063787e34d905aab1b Mon Sep 17 00:00:00 2001 From: Rafael Nocelli Soares <49046514+Nocelli@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:49:13 -0300 Subject: [PATCH 075/129] feat: add extra fields to object sent to Flowise bot --- .../integrations/chatbot/flowise/services/flowise.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/integrations/chatbot/flowise/services/flowise.service.ts b/src/api/integrations/chatbot/flowise/services/flowise.service.ts index 9db13305..5505189c 100644 --- a/src/api/integrations/chatbot/flowise/services/flowise.service.ts +++ b/src/api/integrations/chatbot/flowise/services/flowise.service.ts @@ -57,6 +57,8 @@ export class FlowiseService extends BaseChatbotService { overrideConfig: { sessionId: remoteJid, vars: { + messageId: msg?.key?.id, + fromMe: msg?.key?.fromMe, remoteJid: remoteJid, pushName: pushName, instanceName: instance.instanceName, From edfcb0c0821937b9b005e36fe5a7c1fed364b586 Mon Sep 17 00:00:00 2001 From: Elizandro Pacheco Date: Wed, 17 Sep 2025 12:05:30 -0300 Subject: [PATCH 076/129] style(metrics): linted index.router.ts after eslint --fix --- src/api/routes/index.router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index 1d865269..70019d3c 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -5,8 +5,8 @@ import { ChannelRouter } from '@api/integrations/channel/channel.router'; import { ChatbotRouter } from '@api/integrations/chatbot/chatbot.router'; import { EventRouter } from '@api/integrations/event/event.router'; import { StorageRouter } from '@api/integrations/storage/storage.router'; -import { configService } from '@config/env.config'; import { waMonitor } from '@api/server.module'; +import { configService } from '@config/env.config'; import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion'; import { Router } from 'express'; import fs from 'fs'; From b514fab30ef1c848ea5a930ed5e26b7a459e4b1f Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 14:25:36 -0300 Subject: [PATCH 077/129] fix: address Path Traversal vulnerability in /assets endpoint by implementing security checks --- CHANGELOG.md | 4 ++++ src/api/routes/index.router.ts | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cedfc9dd..017b2518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 2.3.3 (develop) +### Security + +* **CRITICAL**: Fixed Path Traversal vulnerability in /assets endpoint that allowed unauthenticated local file read + ### Testing * Baileys Updates: v7.0.0-rc.3 ([Link](https://github.com/WhiskeySockets/Baileys/releases/tag/v7.0.0-rc.3)) diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index 70019d3c..f1a86393 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -106,13 +106,27 @@ if (!serverConfig.DISABLE_MANAGER) router.use('/manager', new ViewsRouter().rout router.get('/assets/*', (req, res) => { const fileName = req.params[0]; + + // Security: Reject paths containing traversal patterns + if (!fileName || fileName.includes('..') || fileName.includes('\\') || path.isAbsolute(fileName)) { + return res.status(403).send('Forbidden'); + } + const basePath = path.join(process.cwd(), 'manager', 'dist'); + const assetsPath = path.join(basePath, 'assets'); + const filePath = path.join(assetsPath, fileName); - const filePath = path.join(basePath, 'assets/', fileName); + // Security: Ensure the resolved path is within the assets directory + const resolvedPath = path.resolve(filePath); + const resolvedAssetsPath = path.resolve(assetsPath); - if (fs.existsSync(filePath)) { - res.set('Content-Type', mimeTypes.lookup(filePath) || 'text/css'); - res.send(fs.readFileSync(filePath)); + if (!resolvedPath.startsWith(resolvedAssetsPath + path.sep) && resolvedPath !== resolvedAssetsPath) { + return res.status(403).send('Forbidden'); + } + + if (fs.existsSync(resolvedPath)) { + res.set('Content-Type', mimeTypes.lookup(resolvedPath) || 'text/css'); + res.send(fs.readFileSync(resolvedPath)); } else { res.status(404).send('File not found'); } From 00780157dbd7900cdbf62f94f2aedc8ade10ace4 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 14:27:14 -0300 Subject: [PATCH 078/129] style(sqs): format messageGroupId assignment for improved readability --- src/api/integrations/event/sqs/sqs.controller.ts | 4 +++- src/config/env.config.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index 84955513..08c89053 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -163,7 +163,9 @@ export class SqsController extends EventController implements EventControllerInt message.dataType = 's3'; } - const messageGroupId = sqsConfig.GLOBAL_ENABLED ? `${serverConfig.NAME}-${eventFormatted}-${instanceName}` : 'evolution'; + const messageGroupId = sqsConfig.GLOBAL_ENABLED + ? `${serverConfig.NAME}-${eventFormatted}-${instanceName}` + : 'evolution'; const isGlobalEnabled = sqsConfig.GLOBAL_ENABLED; const params = { MessageBody: JSON.stringify(message), diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 55d7f326..98ffc1de 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -536,7 +536,7 @@ export class ConfigService { REMOVE_INSTANCE: process.env?.SQS_GLOBAL_REMOVE_INSTANCE === 'true', SEND_MESSAGE: process.env?.SQS_GLOBAL_SEND_MESSAGE === 'true', TYPEBOT_CHANGE_STATUS: process.env?.SQS_GLOBAL_TYPEBOT_CHANGE_STATUS === 'true', - TYPEBOT_START: process.env?.SQS_GLOBAL_TYPEBOT_START === 'true' + TYPEBOT_START: process.env?.SQS_GLOBAL_TYPEBOT_START === 'true', }, }, WEBSOCKET: { From 55822f9443ae5a3200e122083d97ff84227fd58c Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 14:30:27 -0300 Subject: [PATCH 079/129] style: improve code formatting for better readability in WhatsApp service files --- .../channel/meta/whatsapp.business.service.ts | 8 ++-- .../whatsapp/whatsapp.baileys.service.ts | 43 +++++++++++-------- src/utils/getConversationMessage.ts | 14 +++--- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index 0b76b87a..66847f82 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -463,7 +463,8 @@ export class BusinessStartupService extends ChannelStartupService { this.logger?.info?.('Video upload attempted but is disabled by configuration.'); return { success: false, - message: 'Video upload is currently disabled. Please contact support if you need this feature enabled.', + message: + 'Video upload is currently disabled. Please contact support if you need this feature enabled.', }; } @@ -1213,8 +1214,9 @@ export class BusinessStartupService extends ChannelStartupService { const token = this.token; const headers = { Authorization: `Bearer ${token}` }; - const url = `${this.configService.get('WA_BUSINESS').URL}/${this.configService.get('WA_BUSINESS').VERSION - }/${this.number}/media`; + const url = `${this.configService.get('WA_BUSINESS').URL}/${ + this.configService.get('WA_BUSINESS').VERSION + }/${this.number}/media`; const res = await axios.post(url, formData, { headers }); return res.data.id; diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index c3f7d3d1..f1dd2b3a 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -381,7 +381,7 @@ export class BaileysStartupService extends ChannelStartupService { qrcodeTerminal.generate(qr, { small: true }, (qrcode) => this.logger.log( `\n{ instance: ${this.instance.name} pairingCode: ${this.instance.qrcode.pairingCode}, qrcodeCount: ${this.instance.qrcode.count} }\n` + - qrcode, + qrcode, ), ); @@ -978,16 +978,16 @@ export class BaileysStartupService extends ChannelStartupService { const messagesRepository: Set = new Set( chatwootImport.getRepositoryMessagesCache(instance) ?? - ( - await this.prismaRepository.message.findMany({ - select: { key: true }, - where: { instanceId: this.instanceId }, - }) - ).map((message) => { - const key = message.key as { id: string }; + ( + await this.prismaRepository.message.findMany({ + select: { key: true }, + where: { instanceId: this.instanceId }, + }) + ).map((message) => { + const key = message.key as { id: string }; - return key.id; - }), + return key.id; + }), ); if (chatwootImport.getRepositoryMessagesCache(instance) === null) { @@ -4726,12 +4726,7 @@ export class BaileysStartupService extends ChannelStartupService { } public async fetchMessages(query: Query) { - const keyFilters = query?.where?.key as { - id?: string; - fromMe?: boolean; - remoteJid?: string; - participants?: string; - }; + const keyFilters = query?.where?.key as ExtendedIMessageKey; const timestampFilter = {}; if (query?.where?.messageTimestamp) { @@ -4754,7 +4749,13 @@ export class BaileysStartupService extends ChannelStartupService { keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, - keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, + keyFilters?.participant ? { key: { path: ['participant'], equals: keyFilters?.participant } } : {}, + { + OR: [ + keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, + keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {}, + ], + }, ], }, }); @@ -4778,7 +4779,13 @@ export class BaileysStartupService extends ChannelStartupService { keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, - keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, + keyFilters?.participant ? { key: { path: ['participant'], equals: keyFilters?.participant } } : {}, + { + OR: [ + keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, + keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {}, + ], + }, ], }, orderBy: { messageTimestamp: 'desc' }, diff --git a/src/utils/getConversationMessage.ts b/src/utils/getConversationMessage.ts index a34695e7..eca23b45 100644 --- a/src/utils/getConversationMessage.ts +++ b/src/utils/getConversationMessage.ts @@ -38,14 +38,16 @@ const getTypeMessage = (msg: any) => { ? `videoMessage|${mediaId}${msg?.message?.videoMessage?.caption ? `|${msg?.message?.videoMessage?.caption}` : ''}` : undefined, documentMessage: msg?.message?.documentMessage - ? `documentMessage|${mediaId}${msg?.message?.documentMessage?.caption ? `|${msg?.message?.documentMessage?.caption}` : '' - }` + ? `documentMessage|${mediaId}${ + msg?.message?.documentMessage?.caption ? `|${msg?.message?.documentMessage?.caption}` : '' + }` : undefined, documentWithCaptionMessage: msg?.message?.documentWithCaptionMessage?.message?.documentMessage - ? `documentWithCaptionMessage|${mediaId}${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption - ? `|${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption}` - : '' - }` + ? `documentWithCaptionMessage|${mediaId}${ + msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption + ? `|${msg?.message?.documentWithCaptionMessage?.message?.documentMessage?.caption}` + : '' + }` : undefined, externalAdReplyBody: msg?.contextInfo?.externalAdReply?.body ? `externalAdReplyBody|${msg.contextInfo.externalAdReply.body}` From dd931eee36e4da75c9536f7e640667c6549ef16c Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 14:38:48 -0300 Subject: [PATCH 080/129] docs: changelog 2.3.3 --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 017b2518..585a89ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,28 @@ # 2.3.3 (develop) +### Features + +* Add extra fields to object sent to Flowise bot +* Add Prometheus-compatible /metrics endpoint (gated by PROMETHEUS_METRICS) +* Implement linkPreview support for Evolution Bot + +### Fixed + +* Address Path Traversal vulnerability in /assets endpoint by implementing security checks +* Convert mediaKey from media messages to avoid bad decrypt errors +* Improve code formatting for better readability in WhatsApp service files +* Format messageGroupId assignment for improved readability +* Improve linkPreview implementation based on PR feedback +* Clean up code formatting for linkPreview implementation +* Use 'unknown' as fallback for clientName label +* Remove abort process when status is paused, allowing the chatbot return after the time expires and after being paused due to human interaction (stopBotFromMe) +* Enhance message content sanitization in Baileys service and improve message retrieval logic in Chatwoot service +* Integrate Typebot status change events for webhook in chatbot controller and service + ### Security * **CRITICAL**: Fixed Path Traversal vulnerability in /assets endpoint that allowed unauthenticated local file read +* Customizable Websockets Security ### Testing From 09ee2e6296f9ea8a0df328d8b610a6acef1be850 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 14:49:26 -0300 Subject: [PATCH 081/129] feat: integrate Husky and lint-staged for automated code quality checks; update changelog and README for new features --- .github/workflows/check_code_quality.yml | 16 +- .husky/README.md | 51 +++ .husky/pre-commit | 1 + .husky/pre-push | 2 + CHANGELOG.md | 2 + README.md | 17 + package-lock.json | 399 ++++++++++++++++++ package.json | 14 +- .../whatsapp/whatsapp.baileys.service.ts | 7 + 9 files changed, 504 insertions(+), 5 deletions(-) create mode 100644 .husky/README.md create mode 100644 .husky/pre-commit create mode 100755 .husky/pre-push diff --git a/.github/workflows/check_code_quality.yml b/.github/workflows/check_code_quality.yml index 07bffd7a..e8260340 100644 --- a/.github/workflows/check_code_quality.yml +++ b/.github/workflows/check_code_quality.yml @@ -8,20 +8,28 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: 20.x + - name: Cache node modules + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install packages - run: npm install + run: npm ci - name: Check linting run: npm run lint:check - - name: Check build + - name: Generate Prisma client run: npm run db:generate - name: Check build diff --git a/.husky/README.md b/.husky/README.md new file mode 100644 index 00000000..14d5fa8b --- /dev/null +++ b/.husky/README.md @@ -0,0 +1,51 @@ +# Git Hooks Configuration + +Este projeto usa [Husky](https://typicode.github.io/husky/) para automatizar verificações de qualidade de código. + +## Hooks Configurados + +### Pre-commit +- **Arquivo**: `.husky/pre-commit` +- **Executa**: `npx lint-staged` +- **Função**: Executa lint e correções automáticas apenas nos arquivos modificados + +### Pre-push +- **Arquivo**: `.husky/pre-push` +- **Executa**: `npm run build` + `npm run lint:check` +- **Função**: Verifica se o projeto compila e não tem erros de lint antes do push + +## Lint-staged Configuration + +Configurado no `package.json`: + +```json +"lint-staged": { + "src/**/*.{ts,js}": [ + "eslint --fix", + "git add" + ], + "src/**/*.ts": [ + "npm run build" + ] +} +``` + +## Como funciona + +1. **Ao fazer commit**: Executa lint apenas nos arquivos modificados +2. **Ao fazer push**: Executa build completo e verificação de lint +3. **Se houver erros**: O commit/push é bloqueado até correção + +## Comandos úteis + +```bash +# Pular hooks (não recomendado) +git commit --no-verify +git push --no-verify + +# Executar lint manualmente +npm run lint + +# Executar build manualmente +npm run build +``` diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..2312dc58 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000..a72538ac --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,2 @@ +npm run build +npm run lint:check diff --git a/CHANGELOG.md b/CHANGELOG.md index 585a89ad..fbffdefa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixed * Address Path Traversal vulnerability in /assets endpoint by implementing security checks +* Configure Husky and lint-staged for automated code quality checks on commits and pushes * Convert mediaKey from media messages to avoid bad decrypt errors * Improve code formatting for better readability in WhatsApp service files * Format messageGroupId assignment for improved readability @@ -18,6 +19,7 @@ * Remove abort process when status is paused, allowing the chatbot return after the time expires and after being paused due to human interaction (stopBotFromMe) * Enhance message content sanitization in Baileys service and improve message retrieval logic in Chatwoot service * Integrate Typebot status change events for webhook in chatbot controller and service +* Mimetype of videos video ### Security diff --git a/README.md b/README.md index 6d9b3344..4411061a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ [![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord) [![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman) [![Documentation](https://img.shields.io/badge/Documentation-Official-green)](https://doc.evolution-api.com) +[![Feature Requests](https://img.shields.io/badge/Feature-Requests-purple)](https://evolutionapi.canny.io/feature-requests) +[![Roadmap](https://img.shields.io/badge/Roadmap-Community-blue)](https://evolutionapi.canny.io/feature-requests) +[![Changelog](https://img.shields.io/badge/Changelog-Updates-green)](https://evolutionapi.canny.io/changelog) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE) [![Support](https://img.shields.io/badge/Donation-picpay-green)](https://app.picpay.com/user/davidsongomes1998) [![Sponsors](https://img.shields.io/badge/Github-sponsor-orange)](https://github.com/sponsors/EvolutionAPI) @@ -67,6 +70,20 @@ Evolution API supports various integrations to enhance its functionality. Below - Amazon S3 / Minio: - Store media files received in [Amazon S3](https://aws.amazon.com/pt/s3/) or [Minio](https://min.io/). +## Community & Feedback + +We value community input and feedback to continuously improve Evolution API: + +### 🚀 Feature Requests & Roadmap +- **[Feature Requests](https://evolutionapi.canny.io/feature-requests)**: Submit new feature ideas and vote on community proposals +- **[Roadmap](https://evolutionapi.canny.io/feature-requests)**: View planned features and development progress +- **[Changelog](https://evolutionapi.canny.io/changelog)**: Stay updated with the latest releases and improvements + +### 💬 Community Support +- **[WhatsApp Group](https://evolution-api.com/whatsapp)**: Join our community for support and discussions +- **[Discord Community](https://evolution-api.com/discord)**: Real-time chat with developers and users +- **[GitHub Issues](https://github.com/EvolutionAPI/evolution-api/issues)**: Report bugs and technical issues + ## Telemetry Notice To continuously improve our services, we have implemented telemetry that collects data on the routes used, the most accessed routes, and the version of the API in use. We would like to assure you that no sensitive or personal data is collected during this process. The telemetry helps us identify improvements and provide a better experience for users. diff --git a/package-lock.json b/package-lock.json index a517340d..eb3a7f2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -83,6 +83,8 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-simple-import-sort": "^10.0.0", + "husky": "^9.1.7", + "lint-staged": "^16.1.6", "prettier": "^3.4.2", "tsconfig-paths": "^4.2.0", "tsx": "^4.20.5", @@ -5156,6 +5158,22 @@ "node": ">=10" } }, + "node_modules/ansi-escapes": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.0.tgz", + "integrity": "sha512-YdhtCd19sKRKfAAUsrcC1wzm4JuzJoiX4pOJqIoW2qmKj5WzG/dL8uUJ0361zaXtHqK7gEhOwtAtz7t3Yq3X5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -5998,6 +6016,85 @@ "validator": "^13.9.0" } }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.1.0.tgz", + "integrity": "sha512-7JDGG+4Zp0CsknDCedl0DYdaeOhc46QNpXi3NLQblkZpXXgA6LncLDUUyvrjSvZeF3VRQa+KiMGomazQrC1V8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^7.1.0", + "string-width": "^8.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz", + "integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/cliui": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", @@ -6104,6 +6201,13 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -6848,6 +6952,19 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/es-abstract": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", @@ -8453,6 +8570,22 @@ "ms": "^2.0.0" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/i18next": { "version": "23.16.8", "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.8.tgz", @@ -9363,6 +9496,75 @@ "node": ">=18" } }, + "node_modules/lint-staged": { + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.1.6.tgz", + "integrity": "sha512-U4kuulU3CKIytlkLlaHcGgKscNfJPNTiDF2avIUGFCv7K95/DCYQ7Ra62ydeRWmgQGg9zJYw2dzdbztwJlqrow==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.6.0", + "commander": "^14.0.0", + "debug": "^4.4.1", + "lilconfig": "^3.1.3", + "listr2": "^9.0.3", + "micromatch": "^4.0.8", + "nano-spawn": "^1.0.2", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.8.1" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=20.17" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/commander": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.1.tgz", + "integrity": "sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/listr2": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.4.tgz", + "integrity": "sha512-1wd/kpAdKRLwv7/3OKC8zZ5U8e/fajCfWMxacUvB79S5nLrYGPtUI/8chMQhn3LQjsRVErTb9i1ECAwW0ZIHnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/load-tsconfig": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", @@ -9449,6 +9651,55 @@ "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", "license": "MIT" }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/long": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", @@ -9593,6 +9844,19 @@ "node": ">= 0.6" } }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -9876,6 +10140,19 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nano-spawn": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-1.0.3.tgz", + "integrity": "sha512-jtpsQDetTnvS2Ts1fiRdci5rx0VYws5jGyC+4IYOTnIQ/wwdf6JdomlHBwqC3bJYOvaKu0C2GSZ1A60anrYpaA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/nano-spawn?sponsor=1" + } + }, "node_modules/nats": { "version": "2.29.3", "resolved": "https://registry.npmjs.org/nats/-/nats-2.29.3.tgz", @@ -10208,6 +10485,22 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/openai": { "version": "4.104.0", "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", @@ -10654,6 +10947,19 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pino": { "version": "8.21.0", "resolved": "https://registry.npmjs.org/pino/-/pino-8.21.0.tgz", @@ -11521,6 +11827,23 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -11532,6 +11855,13 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -12055,6 +12385,52 @@ "node": ">=8" } }, + "node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -12368,6 +12744,16 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-width": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", @@ -13627,6 +14013,19 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "devOptional": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/yargs": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", diff --git a/package.json b/package.json index 0633d1e9..2c0f2c19 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "db:deploy:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate deploy --schema prisma\\DATABASE_PROVIDER-schema.prisma\"", "db:studio": "node runWithProvider.js \"npx prisma studio --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:migrate:dev": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate dev --schema ./prisma/DATABASE_PROVIDER-schema.prisma && cp -r ./prisma/migrations/* ./prisma/DATABASE_PROVIDER-migrations\"", - "db:migrate:dev:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate dev --schema prisma\\DATABASE_PROVIDER-schema.prisma\"" + "db:migrate:dev:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate dev --schema prisma\\DATABASE_PROVIDER-schema.prisma\"", + "prepare": "husky" }, "repository": { "type": "git", @@ -48,6 +49,15 @@ "url": "https://github.com/EvolutionAPI/evolution-api/issues" }, "homepage": "https://github.com/EvolutionAPI/evolution-api#readme", + "lint-staged": { + "src/**/*.{ts,js}": [ + "eslint --fix", + "git add" + ], + "src/**/*.ts": [ + "npm run build" + ] + }, "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", "@aws-sdk/client-sqs": "^3.723.0", @@ -123,6 +133,8 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-simple-import-sort": "^10.0.0", + "husky": "^9.1.7", + "lint-staged": "^16.1.6", "prettier": "^3.4.2", "tsconfig-paths": "^4.2.0", "tsx": "^4.20.5", diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index f1dd2b3a..44c66434 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -2604,6 +2604,13 @@ export class BaileysStartupService extends ChannelStartupService { } } + if (mediaMessage?.fileName) { + mimetype = mimeTypes.lookup(mediaMessage.fileName).toString(); + if (mimetype === 'application/mp4') { + mimetype = 'video/mp4'; + } + } + prepareMedia[mediaType].caption = mediaMessage?.caption; prepareMedia[mediaType].mimetype = mimetype; prepareMedia[mediaType].fileName = mediaMessage.fileName; From 805f40c841ff2b055d3e24846ba251f032d5596e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 15:05:17 -0300 Subject: [PATCH 082/129] feat: add code quality tools and security policy - Configure Husky with pre-commit and pre-push hooks - Add commitlint for conventional commit validation - Create comprehensive security policy (SECURITY.md) - Add GitHub Actions for security scanning and dependency review - Create PR and issue templates for better collaboration - Add Canny.io references for community feedback - Fix path traversal vulnerability in /assets endpoint - Create MySQL schema sync analysis tools --- .github/ISSUE_TEMPLATE/bug_report.yml | 81 + .github/ISSUE_TEMPLATE/feature_request.yml | 85 + .github/dependabot.yml | 38 + .github/pull_request_template.md | 41 + .github/workflows/check_code_quality.yml | 6 +- .github/workflows/security.yml | 51 + .husky/commit-msg | 1 + README.md | 4 + SECURITY.md | 99 ++ commitlint.config.js | 34 + package-lock.json | 1841 ++++++++++++++++++++ package.json | 16 +- 12 files changed, 2293 insertions(+), 4 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/security.yml create mode 100755 .husky/commit-msg create mode 100644 SECURITY.md create mode 100644 commitlint.config.js diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..9873a587 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,81 @@ +name: 🐛 Bug Report +description: Report a bug or unexpected behavior +title: "[BUG] " +labels: ["bug", "needs-triage"] +assignees: [] + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + Please search existing issues before creating a new one. + + - type: textarea + id: description + attributes: + label: 📋 Bug Description + description: A clear and concise description of what the bug is. + placeholder: Describe the bug... + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: 🔄 Steps to Reproduce + description: Steps to reproduce the behavior + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + + - type: textarea + id: expected + attributes: + label: ✅ Expected Behavior + description: A clear and concise description of what you expected to happen. + placeholder: What should happen? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: ❌ Actual Behavior + description: A clear and concise description of what actually happened. + placeholder: What actually happened? + validations: + required: true + + - type: textarea + id: environment + attributes: + label: 🌍 Environment + description: Please provide information about your environment + value: | + - OS: [e.g. Ubuntu 20.04, Windows 10, macOS 12.0] + - Node.js version: [e.g. 18.17.0] + - Evolution API version: [e.g. 2.3.3] + - Database: [e.g. PostgreSQL 14, MySQL 8.0] + - Connection type: [e.g. Baileys, WhatsApp Business API] + validations: + required: true + + - type: textarea + id: logs + attributes: + label: 📋 Logs + description: If applicable, add logs to help explain your problem. + placeholder: Paste relevant logs here... + render: shell + + - type: textarea + id: additional + attributes: + label: 📝 Additional Context + description: Add any other context about the problem here. + placeholder: Any additional information... diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..789db1eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,85 @@ +name: ✨ Feature Request +description: Suggest a new feature or enhancement +title: "[FEATURE] " +labels: ["enhancement", "needs-triage"] +assignees: [] + +body: + - type: markdown + attributes: + value: | + Thanks for suggesting a new feature! + Please check our [Feature Requests on Canny](https://evolutionapi.canny.io/feature-requests) first. + + - type: textarea + id: problem + attributes: + label: 🎯 Problem Statement + description: Is your feature request related to a problem? Please describe. + placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + validations: + required: true + + - type: textarea + id: solution + attributes: + label: 💡 Proposed Solution + description: Describe the solution you'd like + placeholder: A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: 🔄 Alternatives Considered + description: Describe alternatives you've considered + placeholder: A clear and concise description of any alternative solutions or features you've considered. + + - type: dropdown + id: priority + attributes: + label: 📊 Priority + description: How important is this feature to you? + options: + - Low - Nice to have + - Medium - Would be helpful + - High - Important for my use case + - Critical - Blocking my work + validations: + required: true + + - type: dropdown + id: component + attributes: + label: 🧩 Component + description: Which component does this feature relate to? + options: + - WhatsApp Integration (Baileys) + - WhatsApp Business API + - Chatwoot Integration + - Typebot Integration + - OpenAI Integration + - Dify Integration + - API Endpoints + - Database + - Authentication + - Webhooks + - File Storage + - Other + + - type: textarea + id: use_case + attributes: + label: 🎯 Use Case + description: Describe your specific use case for this feature + placeholder: How would you use this feature? What problem does it solve for you? + validations: + required: true + + - type: textarea + id: additional + attributes: + label: 📝 Additional Context + description: Add any other context, screenshots, or examples about the feature request here. + placeholder: Any additional information, mockups, or examples... diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2cfb925d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +version: 2 +updates: + # Enable version updates for npm + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + open-pull-requests-limit: 10 + commit-message: + prefix: "chore" + prefix-development: "chore" + include: "scope" + + # Enable version updates for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + open-pull-requests-limit: 5 + commit-message: + prefix: "ci" + include: "scope" + + # Enable version updates for Docker + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + open-pull-requests-limit: 5 + commit-message: + prefix: "chore" + include: "scope" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..e35dd9e5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,41 @@ +## 📋 Description + + +## 🔗 Related Issue + +Closes #(issue_number) + +## 🧪 Type of Change + +- [ ] 🐛 Bug fix (non-breaking change which fixes an issue) +- [ ] ✨ New feature (non-breaking change which adds functionality) +- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] 📚 Documentation update +- [ ] 🔧 Refactoring (no functional changes) +- [ ] ⚡ Performance improvement +- [ ] 🧹 Code cleanup +- [ ] 🔒 Security fix + +## 🧪 Testing + +- [ ] Manual testing completed +- [ ] Functionality verified in development environment +- [ ] No breaking changes introduced +- [ ] Tested with different connection types (if applicable) + +## 📸 Screenshots (if applicable) + + +## ✅ Checklist + +- [ ] My code follows the project's style guidelines +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have manually tested my changes thoroughly +- [ ] I have verified the changes work with different scenarios +- [ ] Any dependent changes have been merged and published + +## 📝 Additional Notes + diff --git a/.github/workflows/check_code_quality.yml b/.github/workflows/check_code_quality.yml index e8260340..c530bd8f 100644 --- a/.github/workflows/check_code_quality.yml +++ b/.github/workflows/check_code_quality.yml @@ -1,6 +1,10 @@ name: Check Code Quality -on: [pull_request] +on: + pull_request: + branches: [ main, develop ] + push: + branches: [ main, develop ] jobs: check-lint-and-build: diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 00000000..bbc73627 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,51 @@ +name: Security Scan + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + schedule: + - cron: '0 0 * * 1' # Weekly on Mondays + +jobs: + codeql: + name: CodeQL Analysis + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" + + dependency-review: + name: Dependency Review + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Dependency Review + uses: actions/dependency-review-action@v4 diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..0a4b97de --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx --no -- commitlint --edit $1 diff --git a/README.md b/README.md index 4411061a..5f486a15 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,10 @@ We value community input and feedback to continuously improve Evolution API: - **[Discord Community](https://evolution-api.com/discord)**: Real-time chat with developers and users - **[GitHub Issues](https://github.com/EvolutionAPI/evolution-api/issues)**: Report bugs and technical issues +### 🔒 Security +- **[Security Policy](./SECURITY.md)**: Guidelines for reporting security vulnerabilities +- **Security Contact**: contato@evolution-api.com + ## Telemetry Notice To continuously improve our services, we have implemented telemetry that collects data on the routes used, the most accessed routes, and the version of the API in use. We would like to assure you that no sensitive or personal data is collected during this process. The telemetry helps us identify improvements and provide a better experience for users. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..0e3189d2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,99 @@ +# Security Policy + +## Supported Versions + +We actively support the following versions of Evolution API with security updates: + +| Version | Supported | +| ------- | ------------------ | +| 2.3.x | ✅ Yes | +| 2.2.x | ✅ Yes | +| 2.1.x | ⚠️ Critical fixes only | +| < 2.1 | ❌ No | + +## Reporting a Vulnerability + +We take security vulnerabilities seriously. If you discover a security vulnerability in Evolution API, please help us by reporting it responsibly. + +### 🔒 Private Disclosure Process + +**Please DO NOT create a public GitHub issue for security vulnerabilities.** + +Instead, please report security vulnerabilities via email to: + +**📧 contato@evolution-api.com** + +### 📋 What to Include + +When reporting a vulnerability, please include: + +- **Description**: A clear description of the vulnerability +- **Impact**: What an attacker could achieve by exploiting this vulnerability +- **Steps to Reproduce**: Detailed steps to reproduce the issue +- **Proof of Concept**: If possible, include a minimal proof of concept +- **Environment**: Version of Evolution API, OS, Node.js version, etc. +- **Suggested Fix**: If you have ideas for how to fix the issue + +### 🕐 Response Timeline + +We will acknowledge receipt of your vulnerability report within **48 hours** and will send you regular updates about our progress. + +- **Initial Response**: Within 48 hours +- **Status Update**: Within 7 days +- **Resolution Timeline**: Varies based on complexity, typically 30-90 days + +### 🎯 Scope + +This security policy applies to: + +- Evolution API core application +- Official Docker images +- Documentation that could lead to security issues + +### 🚫 Out of Scope + +The following are generally considered out of scope: + +- Third-party integrations (Chatwoot, Typebot, etc.) - please report to respective projects +- Issues in dependencies - please report to the dependency maintainers +- Social engineering attacks +- Physical attacks +- Denial of Service attacks + +### 🏆 Recognition + +We believe in recognizing security researchers who help us keep Evolution API secure: + +- We will acknowledge your contribution in our security advisories (unless you prefer to remain anonymous) +- For significant vulnerabilities, we may feature you in our Hall of Fame +- We will work with you on coordinated disclosure timing + +### 📚 Security Best Practices + +For users deploying Evolution API: + +- Always use the latest supported version +- Keep your dependencies up to date +- Use strong authentication methods +- Implement proper network security +- Monitor your logs for suspicious activity +- Follow the principle of least privilege + +### 🔄 Security Updates + +Security updates will be: + +- Released as patch versions (e.g., 2.3.1 → 2.3.2) +- Documented in our [CHANGELOG.md](./CHANGELOG.md) +- Announced in our community channels +- Tagged with security labels in GitHub releases + +## Contact + +For any questions about this security policy, please contact: + +- **Email**: contato@evolution-api.com + +--- + +Thank you for helping keep Evolution API and our community safe! 🛡️ diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..81322258 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,34 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [ + 2, + 'always', + [ + 'feat', // New feature + 'fix', // Bug fix + 'docs', // Documentation changes + 'style', // Code style changes (formatting, etc) + 'refactor', // Code refactoring + 'perf', // Performance improvements + 'test', // Adding or updating tests + 'chore', // Maintenance tasks + 'ci', // CI/CD changes + 'build', // Build system changes + 'revert', // Reverting changes + 'security', // Security fixes + ], + ], + 'type-case': [2, 'always', 'lower-case'], + 'type-empty': [2, 'never'], + 'scope-case': [2, 'always', 'lower-case'], + 'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']], + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'header-max-length': [2, 'always', 100], + 'body-leading-blank': [1, 'always'], + 'body-max-line-length': [2, 'always', 100], + 'footer-leading-blank': [1, 'always'], + 'footer-max-line-length': [2, 'always', 100], + }, +}; diff --git a/package-lock.json b/package-lock.json index eb3a7f2b..bb56cd2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,6 +65,8 @@ "tsup": "^8.3.5" }, "devDependencies": { + "@commitlint/cli": "^19.8.1", + "@commitlint/config-conventional": "^19.8.1", "@types/compression": "^1.7.5", "@types/cors": "^2.8.17", "@types/express": "^4.17.18", @@ -78,6 +80,8 @@ "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", + "commitizen": "^4.3.1", + "cz-conventional-changelog": "^3.3.0", "eslint": "^8.45.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.31.0", @@ -749,6 +753,31 @@ "node": ">=18.0.0" } }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/runtime": { "version": "7.28.4", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", @@ -782,6 +811,509 @@ "node": ">=18" } }, + "node_modules/@commitlint/cli": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.8.1.tgz", + "integrity": "sha512-LXUdNIkspyxrlV6VDHWBmCZRtkEVRpBKxi2Gtw3J54cGWhLCTouVD/Q6ZSaSvd2YaDObWK8mDjrz3TIKtaQMAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/format": "^19.8.1", + "@commitlint/lint": "^19.8.1", + "@commitlint/load": "^19.8.1", + "@commitlint/read": "^19.8.1", + "@commitlint/types": "^19.8.1", + "tinyexec": "^1.0.0", + "yargs": "^17.0.0" + }, + "bin": { + "commitlint": "cli.js" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@commitlint/cli/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@commitlint/cli/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@commitlint/cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@commitlint/cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/@commitlint/config-conventional": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-19.8.1.tgz", + "integrity": "sha512-/AZHJL6F6B/G959CsMAzrPKKZjeEiAVifRyEwXxcT6qtqbPwGw+iQxmNS+Bu+i09OCtdNRW6pNpBvgPrtMr9EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "conventional-changelog-conventionalcommits": "^7.0.2" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/config-validator": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-19.8.1.tgz", + "integrity": "sha512-0jvJ4u+eqGPBIzzSdqKNX1rvdbSU1lPNYlfQQRIFnBgLy26BtC0cFnr7c/AyuzExMxWsMOte6MkTi9I3SQ3iGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "ajv": "^8.11.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/config-validator/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@commitlint/config-validator/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/@commitlint/ensure": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-19.8.1.tgz", + "integrity": "sha512-mXDnlJdvDzSObafjYrOSvZBwkD01cqB4gbnnFuVyNpGUM5ijwU/r/6uqUmBXAAOKRfyEjpkGVZxaDsCVnHAgyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.startcase": "^4.4.0", + "lodash.upperfirst": "^4.3.1" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/execute-rule": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-19.8.1.tgz", + "integrity": "sha512-YfJyIqIKWI64Mgvn/sE7FXvVMQER/Cd+s3hZke6cI1xgNT/f6ZAz5heND0QtffH+KbcqAwXDEE1/5niYayYaQA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/format": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-19.8.1.tgz", + "integrity": "sha512-kSJj34Rp10ItP+Eh9oCItiuN/HwGQMXBnIRk69jdOwEW9llW9FlyqcWYbHPSGofmjsqeoxa38UaEA5tsbm2JWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "chalk": "^5.3.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/format/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@commitlint/is-ignored": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-19.8.1.tgz", + "integrity": "sha512-AceOhEhekBUQ5dzrVhDDsbMaY5LqtN8s1mqSnT2Kz1ERvVZkNihrs3Sfk1Je/rxRNbXYFzKZSHaPsEJJDJV8dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "semver": "^7.6.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/lint": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-19.8.1.tgz", + "integrity": "sha512-52PFbsl+1EvMuokZXLRlOsdcLHf10isTPlWwoY1FQIidTsTvjKXVXYb7AvtpWkDzRO2ZsqIgPK7bI98x8LRUEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/is-ignored": "^19.8.1", + "@commitlint/parse": "^19.8.1", + "@commitlint/rules": "^19.8.1", + "@commitlint/types": "^19.8.1" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/load": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-19.8.1.tgz", + "integrity": "sha512-9V99EKG3u7z+FEoe4ikgq7YGRCSukAcvmKQuTtUyiYPnOd9a2/H9Ak1J9nJA1HChRQp9OA/sIKPugGS+FK/k1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/config-validator": "^19.8.1", + "@commitlint/execute-rule": "^19.8.1", + "@commitlint/resolve-extends": "^19.8.1", + "@commitlint/types": "^19.8.1", + "chalk": "^5.3.0", + "cosmiconfig": "^9.0.0", + "cosmiconfig-typescript-loader": "^6.1.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "lodash.uniq": "^4.5.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/load/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@commitlint/message": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-19.8.1.tgz", + "integrity": "sha512-+PMLQvjRXiU+Ae0Wc+p99EoGEutzSXFVwQfa3jRNUZLNW5odZAyseb92OSBTKCu+9gGZiJASt76Cj3dLTtcTdg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/parse": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-19.8.1.tgz", + "integrity": "sha512-mmAHYcMBmAgJDKWdkjIGq50X4yB0pSGpxyOODwYmoexxxiUCy5JJT99t1+PEMK7KtsCtzuWYIAXYAiKR+k+/Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "conventional-changelog-angular": "^7.0.0", + "conventional-commits-parser": "^5.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/read": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-19.8.1.tgz", + "integrity": "sha512-03Jbjb1MqluaVXKHKRuGhcKWtSgh3Jizqy2lJCRbRrnWpcM06MYm8th59Xcns8EqBYvo0Xqb+2DoZFlga97uXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/top-level": "^19.8.1", + "@commitlint/types": "^19.8.1", + "git-raw-commits": "^4.0.0", + "minimist": "^1.2.8", + "tinyexec": "^1.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/resolve-extends": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-19.8.1.tgz", + "integrity": "sha512-GM0mAhFk49I+T/5UCYns5ayGStkTt4XFFrjjf0L4S26xoMTSkdCf9ZRO8en1kuopC4isDFuEm7ZOm/WRVeElVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/config-validator": "^19.8.1", + "@commitlint/types": "^19.8.1", + "global-directory": "^4.0.1", + "import-meta-resolve": "^4.0.0", + "lodash.mergewith": "^4.6.2", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/resolve-extends/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/rules": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-19.8.1.tgz", + "integrity": "sha512-Hnlhd9DyvGiGwjfjfToMi1dsnw1EXKGJNLTcsuGORHz6SS9swRgkBsou33MQ2n51/boIDrbsg4tIBbRpEWK2kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/ensure": "^19.8.1", + "@commitlint/message": "^19.8.1", + "@commitlint/to-lines": "^19.8.1", + "@commitlint/types": "^19.8.1" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/to-lines": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-19.8.1.tgz", + "integrity": "sha512-98Mm5inzbWTKuZQr2aW4SReY6WUukdWXuZhrqf1QdKPZBCCsXuG87c+iP0bwtD6DBnmVVQjgp4whoHRVixyPBg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/top-level": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-19.8.1.tgz", + "integrity": "sha512-Ph8IN1IOHPSDhURCSXBz44+CIu+60duFwRsg6HqaISFHQHbmBtxVw4ZrFNIYUzEP7WwrNPxa2/5qJ//NK1FGcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^7.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/top-level/node_modules/find-up": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", + "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^7.2.0", + "path-exists": "^5.0.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/@commitlint/top-level/node_modules/yocto-queue": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/types": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-19.8.1.tgz", + "integrity": "sha512-/yCrWGCoA1SVKOks25EGadP9Pnj0oAIHGpl2wH2M2Y46dPM2ueb8wyCVOD7O3WCTkaJ0IkKvzhl1JY7+uCT2Dw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/conventional-commits-parser": "^5.0.0", + "chalk": "^5.3.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/types/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/@emnapi/runtime": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", @@ -4542,6 +5074,16 @@ "@types/node": "*" } }, + "node_modules/@types/conventional-commits-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.1.tgz", + "integrity": "sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/cors": { "version": "2.8.19", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", @@ -5246,6 +5788,13 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true, + "license": "MIT" + }, "node_modules/array-includes": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", @@ -5391,6 +5940,16 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -5626,6 +6185,43 @@ "node": "^4.5.0 || >= 5.9" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/block-stream2": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.1.0.tgz", @@ -5853,6 +6449,16 @@ "keyv": "^5.5.0" } }, + "node_modules/cachedir": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", @@ -5936,6 +6542,13 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, "node_modules/cheerio": { "version": "1.0.0-rc.11", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz", @@ -6032,6 +6645,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cli-truncate": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.1.0.tgz", @@ -6095,6 +6721,16 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, "node_modules/cliui": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", @@ -6229,6 +6865,68 @@ "node": ">= 6" } }, + "node_modules/commitizen": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.1.tgz", + "integrity": "sha512-gwAPAVTy/j5YcOOebcCRIijn+mSjWJC+IYKivTu6aG8Ei/scoXgfsMRnuAk6b0GRste2J4NGxVdMN3ZpfNaVaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cachedir": "2.3.0", + "cz-conventional-changelog": "3.3.0", + "dedent": "0.7.0", + "detect-indent": "6.1.0", + "find-node-modules": "^2.1.2", + "find-root": "1.1.0", + "fs-extra": "9.1.0", + "glob": "7.2.3", + "inquirer": "8.2.5", + "is-utf8": "^0.2.1", + "lodash": "4.17.21", + "minimist": "1.2.7", + "strip-bom": "4.0.0", + "strip-json-comments": "3.1.1" + }, + "bin": { + "commitizen": "bin/commitizen", + "cz": "bin/git-cz", + "git-cz": "bin/git-cz" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/commitizen/node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/commitizen/node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -6368,6 +7066,58 @@ "node": ">= 0.6" } }, + "node_modules/conventional-changelog-angular": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-commit-types": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", + "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", + "dev": true, + "license": "ISC" + }, + "node_modules/conventional-commits-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-text-path": "^2.0.0", + "JSONStream": "^1.3.5", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "conventional-commits-parser": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/cookie": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", @@ -6402,6 +7152,51 @@ "node": ">= 0.10" } }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cosmiconfig-typescript-loader": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.1.0.tgz", + "integrity": "sha512-tJ1w35ZRUiM5FeTzT7DtYWAFFv37ZLqSRkGi2oeCK1gPhvaWjkAtfXvLmvE1pRfxxp9aQo6ba/Pvg1dKj05D4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jiti": "^2.4.1" + }, + "engines": { + "node": ">=v18" + }, + "peerDependencies": { + "@types/node": "*", + "cosmiconfig": ">=9", + "typescript": ">=5" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -6450,6 +7245,118 @@ "integrity": "sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w==", "license": "MIT" }, + "node_modules/cz-conventional-changelog": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz", + "integrity": "sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^2.4.1", + "commitizen": "^4.0.3", + "conventional-commit-types": "^3.0.0", + "lodash.map": "^4.5.1", + "longest": "^2.0.1", + "word-wrap": "^1.0.3" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@commitlint/load": ">6.1.1" + } + }, + "node_modules/cz-conventional-changelog/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cz-conventional-changelog/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cz-conventional-changelog/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/cz-conventional-changelog/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cz-conventional-changelog/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/cz-conventional-changelog/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/cz-conventional-changelog/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/dargs": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-8.1.0.tgz", + "integrity": "sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -6545,6 +7452,13 @@ "node": ">=0.10" } }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true, + "license": "MIT" + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -6561,6 +7475,29 @@ "node": ">=16.0.0" } }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defaults/node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -6636,6 +7573,26 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-libc": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.0.tgz", @@ -6732,6 +7689,19 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dotenv": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", @@ -6952,6 +7922,16 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", @@ -6965,6 +7945,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-ex/node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, "node_modules/es-abstract": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", @@ -7619,6 +8616,19 @@ "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", "integrity": "sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw==" }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/express": { "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", @@ -7695,6 +8705,21 @@ "integrity": "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==", "license": "MIT" }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/fast-check": { "version": "3.23.2", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", @@ -7784,6 +8809,23 @@ "node": ">=6" } }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fast-xml-parser": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", @@ -7818,6 +8860,32 @@ "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", "license": "MIT" }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -7903,6 +8971,24 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/find-node-modules": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-2.1.3.tgz", + "integrity": "sha512-UC2I2+nx1ZuOBclWVNdcnbDR5dlrOdVb7xNjmT/lHE+LsgztWks3dG7boJ37yTS/venXw84B/mAW9uHVoC5QRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "findup-sync": "^4.0.0", + "merge": "^2.1.1" + } + }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "dev": true, + "license": "MIT" + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -7920,6 +9006,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/findup-sync": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^4.0.2", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/fix-dts-default-cjs-exports": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", @@ -8099,6 +9201,22 @@ "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -8285,6 +9403,24 @@ "giget": "dist/cli.mjs" } }, + "node_modules/git-raw-commits": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-4.0.0.tgz", + "integrity": "sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dargs": "^8.0.0", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "git-raw-commits": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -8344,6 +9480,74 @@ "node": "*" } }, + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "4.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, + "node_modules/global-prefix/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -8410,6 +9614,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -8507,6 +9718,19 @@ "node": ">= 0.4" } }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/hookified": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.12.0.tgz", @@ -8695,6 +9919,17 @@ "module-details-from-path": "^1.0.3" } }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -8723,6 +9958,162 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, + "node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/inquirer": { + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/inquirer/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -8987,6 +10378,16 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", @@ -9040,6 +10441,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -9132,6 +10543,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-text-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "text-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-typed-array": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", @@ -9147,6 +10571,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", + "dev": true, + "license": "MIT" + }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", @@ -9193,6 +10637,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -9283,6 +10737,13 @@ "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", "license": "BSD-3-Clause" }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -9303,6 +10764,13 @@ "dev": true, "license": "MIT" }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", @@ -9336,6 +10804,29 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, "node_modules/jsonschema": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", @@ -9345,6 +10836,23 @@ "node": "*" } }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/jsonwebtoken": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", @@ -9596,6 +11104,13 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -9632,6 +11147,20 @@ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "license": "MIT" }, + "node_modules/lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -9639,18 +11168,70 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", "license": "MIT" }, + "node_modules/lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -9706,6 +11287,16 @@ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, + "node_modules/longest": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", + "integrity": "sha512-Ajzxb8CM6WAnFjgiloPsI3bF+WCxcvhdIG3KNA2KN962+tdBsHcuQ4k4qX/EcS/2CRkcc0iAkR956Nib6aXU/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/lru-cache": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", @@ -9757,6 +11348,26 @@ "node": ">=18.0.0" } }, + "node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz", + "integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==", + "dev": true, + "license": "MIT" + }, "node_modules/merge-descriptors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", @@ -9844,6 +11455,16 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", @@ -10129,6 +11750,13 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -10577,6 +12205,90 @@ "url": "https://github.com/sponsors/eshaz" } }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/own-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", @@ -10696,6 +12408,35 @@ "node": ">=4.0.0" } }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/parse5": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", @@ -11761,6 +13502,16 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-in-the-middle": { "version": "7.5.2", "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz", @@ -11807,6 +13558,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -11919,6 +13684,16 @@ "fsevents": "~2.3.2" } }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -13077,6 +14852,19 @@ "url": "https://opencollective.com/synckit" } }, + "node_modules/text-extensions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -13114,6 +14902,13 @@ "real-require": "^0.2.0" } }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, "node_modules/through2": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", @@ -13180,6 +14975,19 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -13562,6 +15370,29 @@ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "license": "MIT" }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -13675,6 +15506,16 @@ "node": ">= 0.8" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/web-encoding": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", diff --git a/package.json b/package.json index 2c0f2c19..ebca32d0 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "test": "tsx watch ./test/all.test.ts", "lint": "eslint --fix --ext .ts src", "lint:check": "eslint --ext .ts src", + "commit": "cz", + "commitlint": "commitlint --edit", "db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:deploy": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:deploy:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate deploy --schema prisma\\DATABASE_PROVIDER-schema.prisma\"", @@ -51,13 +53,17 @@ "homepage": "https://github.com/EvolutionAPI/evolution-api#readme", "lint-staged": { "src/**/*.{ts,js}": [ - "eslint --fix", - "git add" + "eslint --fix" ], "src/**/*.ts": [ - "npm run build" + "tsc --noEmit --incremental" ] }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", "@aws-sdk/client-sqs": "^3.723.0", @@ -115,6 +121,8 @@ "tsup": "^8.3.5" }, "devDependencies": { + "@commitlint/cli": "^19.8.1", + "@commitlint/config-conventional": "^19.8.1", "@types/compression": "^1.7.5", "@types/cors": "^2.8.17", "@types/express": "^4.17.18", @@ -128,6 +136,8 @@ "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", + "commitizen": "^4.3.1", + "cz-conventional-changelog": "^3.3.0", "eslint": "^8.45.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.31.0", From 7088ad05d26a07486ff8a7d7c8cde210d0c8ded9 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 15:43:32 -0300 Subject: [PATCH 083/129] feat: add project guidelines and configuration files for development standards - Introduce AGENTS.md for repository guidelines and project structure - Add core development principles in .cursor/rules/core-development.mdc - Establish project-specific context in .cursor/rules/project-context.mdc - Implement Cursor IDE configuration in .cursor/rules/cursor.json - Create specialized rules for controllers, services, DTOs, guards, routes, and integrations - Update .gitignore to exclude unnecessary files - Enhance CLAUDE.md with project overview and common development commands --- .cursor/rules/README.md | 106 +++ .cursor/rules/core-development.mdc | 144 +++ .cursor/rules/cursor.json | 179 ++++ .cursor/rules/project-context.mdc | 174 ++++ .../specialized-rules/controller-rules.mdc | 342 +++++++ .cursor/rules/specialized-rules/dto-rules.mdc | 433 +++++++++ .../rules/specialized-rules/guard-rules.mdc | 416 +++++++++ .../integration-channel-rules.mdc | 552 ++++++++++++ .../integration-chatbot-rules.mdc | 597 ++++++++++++ .../integration-event-rules.mdc | 851 ++++++++++++++++++ .../integration-storage-rules.mdc | 608 +++++++++++++ .../rules/specialized-rules/route-rules.mdc | 416 +++++++++ .../rules/specialized-rules/service-rules.mdc | 294 ++++++ .../rules/specialized-rules/type-rules.mdc | 490 ++++++++++ .../rules/specialized-rules/util-rules.mdc | 653 ++++++++++++++ .../specialized-rules/validate-rules.mdc | 498 ++++++++++ .gitignore | 4 - AGENTS.md | 41 + CLAUDE.md | 204 +++-- 19 files changed, 6939 insertions(+), 63 deletions(-) create mode 100644 .cursor/rules/README.md create mode 100644 .cursor/rules/core-development.mdc create mode 100644 .cursor/rules/cursor.json create mode 100644 .cursor/rules/project-context.mdc create mode 100644 .cursor/rules/specialized-rules/controller-rules.mdc create mode 100644 .cursor/rules/specialized-rules/dto-rules.mdc create mode 100644 .cursor/rules/specialized-rules/guard-rules.mdc create mode 100644 .cursor/rules/specialized-rules/integration-channel-rules.mdc create mode 100644 .cursor/rules/specialized-rules/integration-chatbot-rules.mdc create mode 100644 .cursor/rules/specialized-rules/integration-event-rules.mdc create mode 100644 .cursor/rules/specialized-rules/integration-storage-rules.mdc create mode 100644 .cursor/rules/specialized-rules/route-rules.mdc create mode 100644 .cursor/rules/specialized-rules/service-rules.mdc create mode 100644 .cursor/rules/specialized-rules/type-rules.mdc create mode 100644 .cursor/rules/specialized-rules/util-rules.mdc create mode 100644 .cursor/rules/specialized-rules/validate-rules.mdc create mode 100644 AGENTS.md diff --git a/.cursor/rules/README.md b/.cursor/rules/README.md new file mode 100644 index 00000000..fdc82a68 --- /dev/null +++ b/.cursor/rules/README.md @@ -0,0 +1,106 @@ +# Evolution API Cursor Rules + +Este diretório contém as regras e configurações do Cursor IDE para o projeto Evolution API. + +## Estrutura dos Arquivos + +### Arquivos Principais (alwaysApply: true) +- **`core-development.mdc`** - Princípios fundamentais de desenvolvimento +- **`project-context.mdc`** - Contexto específico do projeto Evolution API +- **`cursor.json`** - Configurações do Cursor IDE + +### Regras Especializadas (alwaysApply: false) +Estas regras são ativadas automaticamente quando você trabalha nos arquivos correspondentes: + +#### Camadas da Aplicação +- **`specialized-rules/service-rules.mdc`** - Padrões para services (`src/api/services/`) +- **`specialized-rules/controller-rules.mdc`** - Padrões para controllers (`src/api/controllers/`) +- **`specialized-rules/dto-rules.mdc`** - Padrões para DTOs (`src/api/dto/`) +- **`specialized-rules/guard-rules.mdc`** - Padrões para guards (`src/api/guards/`) +- **`specialized-rules/route-rules.mdc`** - Padrões para routers (`src/api/routes/`) + +#### Tipos e Validação +- **`specialized-rules/type-rules.mdc`** - Definições TypeScript (`src/api/types/`) +- **`specialized-rules/validate-rules.mdc`** - Schemas de validação (`src/validate/`) + +#### Utilitários +- **`specialized-rules/util-rules.mdc`** - Funções utilitárias (`src/utils/`) + +#### Integrações +- **`specialized-rules/integration-channel-rules.mdc`** - Integrações de canal (`src/api/integrations/channel/`) +- **`specialized-rules/integration-chatbot-rules.mdc`** - Integrações de chatbot (`src/api/integrations/chatbot/`) +- **`specialized-rules/integration-storage-rules.mdc`** - Integrações de storage (`src/api/integrations/storage/`) +- **`specialized-rules/integration-event-rules.mdc`** - Integrações de eventos (`src/api/integrations/event/`) + +## Como Usar + +### Referências Cruzadas +Os arquivos principais fazem referência aos especializados usando a sintaxe `@specialized-rules/nome-do-arquivo.mdc`. Quando você trabalha em um arquivo específico, o Cursor automaticamente carrega as regras relevantes. + +### Exemplo de Uso +Quando você edita um arquivo em `src/api/services/`, o Cursor automaticamente: +1. Carrega `core-development.mdc` (sempre ativo) +2. Carrega `project-context.mdc` (sempre ativo) +3. Carrega `specialized-rules/service-rules.mdc` (ativado pelo glob pattern) + +### Padrões de Código +Cada arquivo de regras contém: +- **Estruturas padrão** - Como organizar o código +- **Padrões de nomenclatura** - Convenções de nomes +- **Exemplos práticos** - Código de exemplo +- **Anti-padrões** - O que evitar +- **Testes** - Como testar o código + +## Configuração do Cursor + +O arquivo `cursor.json` contém: +- Configurações de formatação +- Padrões de código específicos do Evolution API +- Diretórios principais do projeto +- Integrações e tecnologias utilizadas + +## Manutenção + +Para manter as regras atualizadas: +1. Analise novos padrões no código +2. Atualize as regras especializadas correspondentes +3. Mantenha os exemplos sincronizados com o código real +4. Documente mudanças significativas + +## Tecnologias Cobertas + +- **Backend**: Node.js 20+ + TypeScript 5+ + Express.js +- **Database**: Prisma ORM (PostgreSQL/MySQL) +- **Cache**: Redis + Node-cache +- **Queue**: RabbitMQ + Amazon SQS +- **Real-time**: Socket.io +- **Storage**: AWS S3 + Minio +- **Validation**: class-validator + Joi +- **Logging**: Pino +- **WhatsApp**: Baileys + Meta Business API +- **Integrations**: Chatwoot, Typebot, OpenAI, Dify + +## Estrutura do Projeto + +``` +src/ +├── api/ +│ ├── controllers/ # Controllers (HTTP handlers) +│ ├── services/ # Business logic +│ ├── dto/ # Data Transfer Objects +│ ├── guards/ # Authentication/Authorization +│ ├── routes/ # Express routers +│ ├── types/ # TypeScript definitions +│ └── integrations/ # External integrations +│ ├── channel/ # WhatsApp channels (Baileys, Business API) +│ ├── chatbot/ # Chatbot integrations +│ ├── event/ # Event integrations +│ └── storage/ # Storage integrations +├── cache/ # Cache implementations +├── config/ # Configuration files +├── utils/ # Utility functions +├── validate/ # Validation schemas +└── exceptions/ # Custom exceptions +``` + +Este sistema de regras garante consistência no código e facilita o desenvolvimento seguindo os padrões estabelecidos do Evolution API. diff --git a/.cursor/rules/core-development.mdc b/.cursor/rules/core-development.mdc new file mode 100644 index 00000000..f245b99d --- /dev/null +++ b/.cursor/rules/core-development.mdc @@ -0,0 +1,144 @@ +--- +description: Core development principles and standards for Evolution API development +globs: +alwaysApply: true +--- + +# Evolution API Development Standards + +## Cross-References +- **Project Context**: @project-context.mdc for Evolution API-specific patterns +- **Specialized Rules**: + - @specialized-rules/service-rules.mdc for service layer patterns + - @specialized-rules/controller-rules.mdc for controller patterns + - @specialized-rules/dto-rules.mdc for DTO validation patterns + - @specialized-rules/guard-rules.mdc for authentication/authorization + - @specialized-rules/route-rules.mdc for router patterns + - @specialized-rules/type-rules.mdc for TypeScript definitions + - @specialized-rules/util-rules.mdc for utility functions + - @specialized-rules/validate-rules.mdc for validation schemas + - @specialized-rules/integration-channel-rules.mdc for channel integrations + - @specialized-rules/integration-chatbot-rules.mdc for chatbot integrations + - @specialized-rules/integration-storage-rules.mdc for storage integrations + - @specialized-rules/integration-event-rules.mdc for event integrations +- **TypeScript/Node.js**: Node.js 20+ + TypeScript 5+ best practices +- **Express/Prisma**: Express.js + Prisma ORM patterns +- **WhatsApp Integrations**: Baileys + Meta Business API patterns + +## Senior Engineer Context - Evolution API Platform +- You are a senior software engineer working on a WhatsApp API platform +- Focus on Node.js + TypeScript + Express.js full-stack development +- Specialized in real-time messaging, WhatsApp integrations, and event-driven architecture +- Apply scalable patterns for multi-tenant API platform +- Consider WhatsApp integration workflow implications and performance at scale + +## Fundamental Principles + +### Code Quality Standards +- **Simplicity First**: Always prefer simple solutions over complex ones +- **DRY Principle**: Avoid code duplication - check for existing similar functionality before implementing +- **Single Responsibility**: Each function/class should have one clear purpose +- **Readable Code**: Write code that tells a story - clear naming and structure + +### Problem Resolution Approach +- **Follow Existing Patterns**: Use established Service patterns, DTOs, and Integration patterns +- **Event-Driven First**: Leverage EventEmitter2 for event publishing when adding new features +- **Integration Pattern**: Follow existing WhatsApp integration patterns for new channels +- **Conservative Changes**: Prefer extending existing services over creating new architecture +- **Clean Migration**: Remove deprecated patterns when introducing new ones +- **Incremental Changes**: Break large changes into smaller, testable increments with proper migrations + +### File and Function Organization - Node.js/TypeScript Structure +- **Services**: Keep services focused and under 200 lines +- **Controllers**: Keep controllers thin - only routing and validation +- **DTOs**: Use class-validator for all input validation +- **Integrations**: Follow `src/api/integrations/` structure for new integrations +- **Utils**: Extract common functionality into well-named utilities +- **Types**: Define clear TypeScript interfaces and types + +### Code Analysis and Reflection +- After writing code, deeply reflect on scalability and maintainability +- Provide 1-2 paragraph analysis of code changes +- Suggest improvements or next steps based on reflection +- Consider performance, security, and maintenance implications + +## Development Standards + +### TypeScript Standards +- **Strict Mode**: Always use TypeScript strict mode +- **No Any**: Avoid `any` type - use proper typing +- **Interfaces**: Define clear contracts with interfaces +- **Enums**: Use enums for constants and status values +- **Generics**: Use generics for reusable components + +### Error Handling Standards +- **HTTP Exceptions**: Use appropriate HTTP status codes +- **Logging**: Structured logging with context +- **Retry Logic**: Implement retry for external services +- **Graceful Degradation**: Handle service failures gracefully + +### Security Standards +- **Input Validation**: Validate all inputs with class-validator +- **Authentication**: Use API keys and JWT tokens +- **Rate Limiting**: Implement rate limiting for APIs +- **Data Sanitization**: Sanitize sensitive data in logs + +### Performance Standards +- **Caching**: Use Redis for frequently accessed data +- **Database**: Optimize Prisma queries with proper indexing +- **Memory**: Monitor memory usage and implement cleanup +- **Async**: Use async/await properly with error handling + +## Communication Standards + +### Language Requirements +- **User Communication**: Always respond in Portuguese (PT-BR) +- **Code Comments**: English for technical documentation +- **API Documentation**: English for consistency +- **Error Messages**: Portuguese for user-facing errors + +### Documentation Standards +- **Code Comments**: Document complex business logic +- **API Documentation**: Document all public endpoints +- **README**: Keep project documentation updated +- **Changelog**: Document breaking changes + +## Quality Assurance + +### Testing Standards +- **Unit Tests**: Test business logic in services +- **Integration Tests**: Test API endpoints +- **Mocks**: Mock external dependencies +- **Coverage**: Aim for 70%+ test coverage + +### Code Review Standards +- **Peer Review**: All code must be reviewed +- **Automated Checks**: ESLint, Prettier, TypeScript +- **Security Review**: Check for security vulnerabilities +- **Performance Review**: Check for performance issues + +## Evolution API Specific Patterns + +### WhatsApp Integration Patterns +- **Connection Management**: One connection per instance +- **Event Handling**: Proper event listeners for Baileys +- **Message Processing**: Queue-based message processing +- **Error Recovery**: Automatic reconnection logic + +### Multi-Database Support +- **Schema Compatibility**: Support PostgreSQL and MySQL +- **Migration Sync**: Keep migrations synchronized +- **Type Safety**: Use Prisma generated types +- **Connection Pooling**: Proper database connection management + +### Cache Strategy +- **Redis Primary**: Use Redis for distributed caching +- **Local Fallback**: Node-cache for local fallback +- **TTL Strategy**: Appropriate TTL for different data types +- **Cache Invalidation**: Proper cache invalidation patterns + +### Event System +- **EventEmitter2**: Use for internal events +- **WebSocket**: Socket.io for real-time updates +- **Queue Systems**: RabbitMQ/SQS for async processing +- **Webhook Processing**: Proper webhook validation and processing \ No newline at end of file diff --git a/.cursor/rules/cursor.json b/.cursor/rules/cursor.json new file mode 100644 index 00000000..a3d4275f --- /dev/null +++ b/.cursor/rules/cursor.json @@ -0,0 +1,179 @@ +{ + "version": "1.0", + "description": "Cursor IDE configuration for Evolution API project", + "rules": { + "general": { + "max_line_length": 120, + "indent_size": 2, + "end_of_line": "lf", + "charset": "utf-8", + "trim_trailing_whitespace": true, + "insert_final_newline": true + }, + "typescript": { + "quotes": "single", + "semi": true, + "trailing_comma": "es5", + "bracket_spacing": true, + "arrow_parens": "avoid", + "print_width": 120, + "tab_width": 2, + "use_tabs": false, + "single_quote": true, + "end_of_line": "lf", + "strict": true, + "no_implicit_any": true, + "strict_null_checks": true + }, + "javascript": { + "quotes": "single", + "semi": true, + "trailing_comma": "es5", + "bracket_spacing": true, + "arrow_parens": "avoid", + "print_width": 120, + "tab_width": 2, + "use_tabs": false, + "single_quote": true, + "end_of_line": "lf", + "style_guide": "eslint-airbnb" + }, + "json": { + "tab_width": 2, + "use_tabs": false, + "parser": "json" + }, + "ignore": { + "files": [ + "node_modules/**", + "dist/**", + "build/**", + ".git/**", + "*.min.js", + "*.min.css", + ".env", + ".env.*", + ".env.example", + "coverage/**", + "*.log", + "*.lock", + "pnpm-lock.yaml", + "package-lock.json", + "yarn.lock", + "log/**", + "tmp/**", + "instances/**", + "public/uploads/**", + "*.dump", + "*.rdb", + "*.mmdb", + ".DS_Store", + "*.swp", + "*.swo", + "*.un~", + ".jest-cache", + ".idea/**", + ".vscode/**", + ".yalc/**", + "yalc.lock", + "*.local", + "prisma/migrations/**", + "prisma/mysql-migrations/**", + "prisma/postgresql-migrations/**" + ] + }, + "search": { + "exclude_patterns": [ + "**/node_modules/**", + "**/dist/**", + "**/build/**", + "**/.git/**", + "**/coverage/**", + "**/log/**", + "**/tmp/**", + "**/instances/**", + "**/public/uploads/**", + "**/*.min.js", + "**/*.min.css", + "**/*.log", + "**/*.lock", + "**/pnpm-lock.yaml", + "**/package-lock.json", + "**/yarn.lock", + "**/*.dump", + "**/*.rdb", + "**/*.mmdb", + "**/.DS_Store", + "**/*.swp", + "**/*.swo", + "**/*.un~", + "**/.jest-cache", + "**/.idea/**", + "**/.vscode/**", + "**/.yalc/**", + "**/yalc.lock", + "**/*.local", + "**/prisma/migrations/**", + "**/prisma/mysql-migrations/**", + "**/prisma/postgresql-migrations/**" + ] + }, + "evolution_api": { + "project_type": "nodejs_typescript_api", + "backend_framework": "express_prisma", + "database": ["postgresql", "mysql"], + "cache": ["redis", "node_cache"], + "queue": ["rabbitmq", "sqs"], + "real_time": "socket_io", + "file_storage": ["aws_s3", "minio"], + "validation": "class_validator", + "logging": "pino", + "main_directories": { + "source": "src/", + "api": "src/api/", + "controllers": "src/api/controllers/", + "services": "src/api/services/", + "integrations": "src/api/integrations/", + "dto": "src/api/dto/", + "types": "src/api/types/", + "guards": "src/api/guards/", + "routes": "src/api/routes/", + "cache": "src/cache/", + "config": "src/config/", + "utils": "src/utils/", + "exceptions": "src/exceptions/", + "validate": "src/validate/", + "prisma": "prisma/", + "tests": "test/", + "docs": "docs/" + }, + "key_patterns": [ + "whatsapp_integration", + "multi_database_support", + "instance_management", + "event_driven_architecture", + "service_layer_pattern", + "dto_validation", + "webhook_processing", + "message_queuing", + "real_time_communication", + "file_storage_integration" + ], + "whatsapp_integrations": [ + "baileys", + "meta_business_api", + "whatsapp_cloud_api" + ], + "external_integrations": [ + "chatwoot", + "typebot", + "openai", + "dify", + "rabbitmq", + "sqs", + "s3", + "minio" + ] + } + } +} diff --git a/.cursor/rules/project-context.mdc b/.cursor/rules/project-context.mdc new file mode 100644 index 00000000..c3523e42 --- /dev/null +++ b/.cursor/rules/project-context.mdc @@ -0,0 +1,174 @@ +--- +description: Evolution API project-specific context and constraints +globs: +alwaysApply: true +--- + +# Evolution API Project Context + +## Cross-References +- **Core Development**: @core-development.mdc for fundamental development principles +- **Specialized Rules**: Reference specific specialized rules when working on: + - Services: @specialized-rules/service-rules.mdc + - Controllers: @specialized-rules/controller-rules.mdc + - DTOs: @specialized-rules/dto-rules.mdc + - Guards: @specialized-rules/guard-rules.mdc + - Routes: @specialized-rules/route-rules.mdc + - Types: @specialized-rules/type-rules.mdc + - Utils: @specialized-rules/util-rules.mdc + - Validation: @specialized-rules/validate-rules.mdc + - Channel Integrations: @specialized-rules/integration-channel-rules.mdc + - Chatbot Integrations: @specialized-rules/integration-chatbot-rules.mdc + - Storage Integrations: @specialized-rules/integration-storage-rules.mdc + - Event Integrations: @specialized-rules/integration-event-rules.mdc +- **TypeScript/Node.js**: Node.js 20+ + TypeScript 5+ backend standards +- **Express/Prisma**: Express.js + Prisma ORM patterns +- **WhatsApp Integrations**: Baileys, Meta Business API, and other messaging platforms + +## Technology Stack +- **Backend**: Node.js 20+ + TypeScript 5+ + Express.js +- **Database**: Prisma ORM (PostgreSQL/MySQL support) +- **Cache**: Redis + Node-cache for local fallback +- **Queue**: RabbitMQ + Amazon SQS for message processing +- **Real-time**: Socket.io for WebSocket connections +- **Storage**: AWS S3 + Minio for file storage +- **Validation**: class-validator for input validation +- **Logging**: Pino for structured logging +- **Architecture**: Multi-tenant API with WhatsApp integrations + +## Project-Specific Patterns + +### WhatsApp Integration Architecture +- **MANDATORY**: All WhatsApp integrations must follow established patterns +- **BAILEYS**: Use `whatsapp.baileys.service.ts` patterns for WhatsApp Web +- **META BUSINESS**: Use `whatsapp.business.service.ts` for official API +- **CONNECTION MANAGEMENT**: One connection per instance with proper lifecycle +- **EVENT HANDLING**: Proper event listeners and error handling + +### Multi-Database Architecture +- **CRITICAL**: Support both PostgreSQL and MySQL +- **SCHEMAS**: Use appropriate schema files (postgresql-schema.prisma / mysql-schema.prisma) +- **MIGRATIONS**: Keep migrations synchronized between databases +- **TYPES**: Use database-specific types (@db.JsonB vs @db.Json) +- **COMPATIBILITY**: Ensure feature parity between databases + +### API Integration Workflow +- **CORE FEATURE**: REST API for WhatsApp communication +- **COMPLEXITY**: High - involves webhook processing, message routing, and instance management +- **COMPONENTS**: Instance management, message handling, media processing +- **INTEGRATIONS**: Baileys, Meta Business API, Chatwoot, Typebot, OpenAI, Dify + +### Multi-Tenant Instance Architecture +- **CRITICAL**: All operations must be scoped by instance +- **ISOLATION**: Complete data isolation between instances +- **SECURITY**: Validate instance ownership before operations +- **SCALING**: Support thousands of concurrent instances +- **AUTHENTICATION**: API key-based authentication per instance + +## Documentation Requirements + +### Implementation Documentation +- **MANDATORY**: Document complex integration patterns +- **LOCATION**: Use inline comments for business logic +- **API DOCS**: Document all public endpoints +- **WEBHOOK DOCS**: Document webhook payloads and signatures + +### Change Documentation +- **CHANGELOG**: Document breaking changes +- **MIGRATION GUIDES**: Document database migrations +- **INTEGRATION GUIDES**: Document new integration patterns + +## Environment and Security + +### Environment Variables +- **CRITICAL**: Never hardcode sensitive values +- **VALIDATION**: Validate required environment variables on startup +- **SECURITY**: Use secure defaults and proper encryption +- **DOCUMENTATION**: Document all environment variables + +### File Organization - Node.js/TypeScript Structure +- **CONTROLLERS**: Organized by feature (`api/controllers/`) +- **SERVICES**: Business logic in service classes (`api/services/`) +- **INTEGRATIONS**: External integrations (`api/integrations/`) +- **DTOS**: Data transfer objects (`api/dto/`) +- **TYPES**: TypeScript types (`api/types/`) +- **UTILS**: Utility functions (`utils/`) + +## Integration Points + +### WhatsApp Providers +- **BAILEYS**: WhatsApp Web integration with QR code +- **META BUSINESS**: Official WhatsApp Business API +- **CLOUD API**: WhatsApp Cloud API integration +- **WEBHOOK PROCESSING**: Proper webhook validation and processing + +### External Integrations +- **CHATWOOT**: Customer support platform integration +- **TYPEBOT**: Chatbot flow integration +- **OPENAI**: AI-powered chat integration +- **DIFY**: AI workflow integration +- **STORAGE**: S3/Minio for media file storage + +### Event-Driven Communication +- **EVENTEMITTER2**: Internal event system +- **SOCKET.IO**: Real-time WebSocket communication +- **RABBITMQ**: Message queue for async processing +- **SQS**: Amazon SQS for cloud-based queuing +- **WEBHOOKS**: Outbound webhook system + +## Development Constraints + +### Language Requirements +- **USER COMMUNICATION**: Always respond in Portuguese (PT-BR) +- **CODE/COMMENTS**: English for code and technical documentation +- **API RESPONSES**: English for consistency +- **ERROR MESSAGES**: Portuguese for user-facing errors + +### Performance Constraints +- **MEMORY**: Efficient memory usage for multiple instances +- **DATABASE**: Optimized queries with proper indexing +- **CACHE**: Strategic caching for frequently accessed data +- **CONNECTIONS**: Proper connection pooling and management + +### Security Constraints +- **AUTHENTICATION**: API key validation for all endpoints +- **AUTHORIZATION**: Instance-based access control +- **INPUT VALIDATION**: Validate all inputs with class-validator +- **RATE LIMITING**: Prevent abuse with rate limiting +- **WEBHOOK SECURITY**: Validate webhook signatures + +## Quality Standards +- **TYPE SAFETY**: Full TypeScript coverage with strict mode +- **ERROR HANDLING**: Comprehensive error scenarios with proper logging +- **TESTING**: Unit and integration tests for critical paths +- **MONITORING**: Proper logging and error tracking +- **DOCUMENTATION**: Clear API documentation and code comments +- **PERFORMANCE**: Optimized for high-throughput message processing +- **SECURITY**: Secure by default with proper validation +- **SCALABILITY**: Design for horizontal scaling + +## Evolution API Specific Development Patterns + +### Instance Management +- **LIFECYCLE**: Proper instance creation, connection, and cleanup +- **STATE MANAGEMENT**: Track connection status and health +- **RECOVERY**: Automatic reconnection and error recovery +- **MONITORING**: Health checks and status reporting + +### Message Processing +- **QUEUE-BASED**: Use queues for message processing +- **RETRY LOGIC**: Implement exponential backoff for failures +- **MEDIA HANDLING**: Proper media upload and processing +- **WEBHOOK DELIVERY**: Reliable webhook delivery with retries + +### Integration Patterns +- **SERVICE LAYER**: Business logic in service classes +- **DTO VALIDATION**: Input validation with class-validator +- **ERROR HANDLING**: Consistent error responses +- **LOGGING**: Structured logging with correlation IDs + +### Database Patterns +- **PRISMA**: Use Prisma ORM for all database operations +- **TRANSACTIONS**: Use transactions for multi-step operations +- **MIGRATIONS**: Proper migration management +- **INDEXING**: Optimize queries with appropriate indexes \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/controller-rules.mdc b/.cursor/rules/specialized-rules/controller-rules.mdc new file mode 100644 index 00000000..4e4d666a --- /dev/null +++ b/.cursor/rules/specialized-rules/controller-rules.mdc @@ -0,0 +1,342 @@ +--- +description: Controller patterns for Evolution API +globs: + - "src/api/controllers/**/*.ts" + - "src/api/integrations/**/controllers/*.ts" +alwaysApply: false +--- + +# Evolution API Controller Rules + +## Controller Structure Pattern + +### Standard Controller Class +```typescript +export class ExampleController { + constructor(private readonly exampleService: ExampleService) {} + + public async createExample(instance: InstanceDto, data: ExampleDto) { + return this.exampleService.create(instance, data); + } + + public async findExample(instance: InstanceDto) { + return this.exampleService.find(instance); + } +} +``` + +## Dependency Injection Pattern + +### Service Injection +```typescript +// CORRECT - Evolution API pattern +export class ChatController { + constructor(private readonly waMonitor: WAMonitoringService) {} + + public async whatsappNumber({ instanceName }: InstanceDto, data: WhatsAppNumberDto) { + return await this.waMonitor.waInstances[instanceName].getWhatsAppNumbers(data); + } +} + +// INCORRECT - Don't inject multiple services when waMonitor is sufficient +export class ChatController { + constructor( + private readonly waMonitor: WAMonitoringService, + private readonly prismaRepository: PrismaRepository, // ❌ Unnecessary if waMonitor has access + private readonly configService: ConfigService, // ❌ Unnecessary if waMonitor has access + ) {} +} +``` + +## Method Signature Pattern + +### Instance Parameter Pattern +```typescript +// CORRECT - Evolution API pattern (destructuring instanceName) +public async fetchCatalog({ instanceName }: InstanceDto, data: getCatalogDto) { + return await this.waMonitor.waInstances[instanceName].fetchCatalog(instanceName, data); +} + +// CORRECT - Alternative pattern for full instance (when using services) +public async createTemplate(instance: InstanceDto, data: TemplateDto) { + return this.templateService.create(instance, data); +} + +// INCORRECT - Don't use generic method names +public async methodName(instance: InstanceDto, data: DataDto) { // ❌ Use specific names + return this.service.performAction(instance, data); +} +``` + +## WAMonitor Access Pattern + +### Direct WAMonitor Usage +```typescript +// CORRECT - Standard pattern in controllers +export class CallController { + constructor(private readonly waMonitor: WAMonitoringService) {} + + public async offerCall({ instanceName }: InstanceDto, data: OfferCallDto) { + return await this.waMonitor.waInstances[instanceName].offerCall(data); + } +} +``` + +## Controller Registration Pattern + +### Server Module Registration +```typescript +// In server.module.ts +export const templateController = new TemplateController(templateService); +export const businessController = new BusinessController(waMonitor); +export const chatController = new ChatController(waMonitor); +export const callController = new CallController(waMonitor); +``` + +## Error Handling in Controllers + +### Let Services Handle Errors +```typescript +// CORRECT - Let service handle errors +public async fetchCatalog(instance: InstanceDto, data: getCatalogDto) { + return await this.waMonitor.waInstances[instance.instanceName].fetchCatalog(instance.instanceName, data); +} + +// INCORRECT - Don't add try-catch in controllers unless specific handling needed +public async fetchCatalog(instance: InstanceDto, data: getCatalogDto) { + try { + return await this.waMonitor.waInstances[instance.instanceName].fetchCatalog(instance.instanceName, data); + } catch (error) { + throw error; // ❌ Unnecessary try-catch + } +} +``` + +## Complex Controller Pattern + +### Instance Controller Pattern +```typescript +export class InstanceController { + constructor( + private readonly waMonitor: WAMonitoringService, + private readonly configService: ConfigService, + private readonly prismaRepository: PrismaRepository, + private readonly eventEmitter: EventEmitter2, + private readonly chatwootService: ChatwootService, + private readonly settingsService: SettingsService, + private readonly proxyService: ProxyController, + private readonly cache: CacheService, + private readonly chatwootCache: CacheService, + private readonly baileysCache: CacheService, + private readonly providerFiles: ProviderFiles, + ) {} + + private readonly logger = new Logger('InstanceController'); + + // Multiple methods handling different aspects + public async createInstance(data: InstanceDto) { + // Complex instance creation logic + } + + public async deleteInstance({ instanceName }: InstanceDto) { + // Complex instance deletion logic + } +} +``` + +## Channel Controller Pattern + +### Base Channel Controller +```typescript +export class ChannelController { + public prismaRepository: PrismaRepository; + public waMonitor: WAMonitoringService; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + this.prisma = prismaRepository; + this.monitor = waMonitor; + } + + // Getters and setters for dependency access + public set prisma(prisma: PrismaRepository) { + this.prismaRepository = prisma; + } + + public get prisma() { + return this.prismaRepository; + } + + public set monitor(waMonitor: WAMonitoringService) { + this.waMonitor = waMonitor; + } + + public get monitor() { + return this.waMonitor; + } +} +``` + +### Extended Channel Controller +```typescript +export class EvolutionController extends ChannelController implements ChannelControllerInterface { + private readonly logger = new Logger('EvolutionController'); + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + } + + integrationEnabled: boolean; + + public async receiveWebhook(data: any) { + const numberId = data.numberId; + + if (!numberId) { + this.logger.error('WebhookService -> receiveWebhookEvolution -> numberId not found'); + return; + } + + const instance = await this.prismaRepository.instance.findFirst({ + where: { number: numberId }, + }); + + if (!instance) { + this.logger.error('WebhookService -> receiveWebhook -> instance not found'); + return; + } + + await this.waMonitor.waInstances[instance.name].connectToWhatsapp(data); + + return { + status: 'success', + }; + } +} +``` + +## Chatbot Controller Pattern + +### Base Chatbot Controller +```typescript +export abstract class BaseChatbotController + extends ChatbotController + implements ChatbotControllerInterface +{ + public readonly logger: Logger; + integrationEnabled: boolean; + + // Abstract methods to be implemented + protected abstract readonly integrationName: string; + protected abstract processBot(/* parameters */): Promise; + protected abstract getFallbackBotId(settings: any): string | undefined; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + } + + // Base implementation methods + public async createBot(instance: InstanceDto, data: BotData) { + // Common bot creation logic + } +} +``` + +## Method Naming Conventions + +### Standard Method Names +- `create*()` - Create operations +- `find*()` - Find operations +- `fetch*()` - Fetch from external APIs +- `send*()` - Send operations +- `receive*()` - Receive webhook/data +- `handle*()` - Handle specific actions +- `offer*()` - Offer services (like calls) + +## Return Patterns + +### Direct Return Pattern +```typescript +// CORRECT - Direct return from service +public async createTemplate(instance: InstanceDto, data: TemplateDto) { + return this.templateService.create(instance, data); +} + +// CORRECT - Direct return from waMonitor +public async offerCall({ instanceName }: InstanceDto, data: OfferCallDto) { + return await this.waMonitor.waInstances[instanceName].offerCall(data); +} +``` + +## Controller Testing Pattern + +### Unit Test Structure +```typescript +describe('ExampleController', () => { + let controller: ExampleController; + let service: jest.Mocked; + + beforeEach(() => { + const mockService = { + create: jest.fn(), + find: jest.fn(), + }; + + controller = new ExampleController(mockService as any); + service = mockService as any; + }); + + describe('createExample', () => { + it('should call service create method', async () => { + const instance = { instanceName: 'test' }; + const data = { test: 'data' }; + const expectedResult = { success: true }; + + service.create.mockResolvedValue(expectedResult); + + const result = await controller.createExample(instance, data); + + expect(service.create).toHaveBeenCalledWith(instance, data); + expect(result).toEqual(expectedResult); + }); + }); +}); +``` + +## Interface Implementation + +### Controller Interface Pattern +```typescript +export interface ChannelControllerInterface { + integrationEnabled: boolean; +} + +export interface ChatbotControllerInterface { + integrationEnabled: boolean; + createBot(instance: InstanceDto, data: any): Promise; + findBot(instance: InstanceDto): Promise; + // ... other methods +} +``` + +## Controller Organization + +### File Naming Convention +- `*.controller.ts` - Main controllers +- `*/*.controller.ts` - Integration-specific controllers + +### Method Organization +1. Constructor +2. Public methods (alphabetical order) +3. Private methods (if any) + +### Import Organization +```typescript +// DTOs first +import { InstanceDto } from '@api/dto/instance.dto'; +import { ExampleDto } from '@api/dto/example.dto'; + +// Services +import { ExampleService } from '@api/services/example.service'; + +// Types +import { WAMonitoringService } from '@api/services/monitor.service'; +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/dto-rules.mdc b/.cursor/rules/specialized-rules/dto-rules.mdc new file mode 100644 index 00000000..b1cae17d --- /dev/null +++ b/.cursor/rules/specialized-rules/dto-rules.mdc @@ -0,0 +1,433 @@ +--- +description: DTO patterns and validation for Evolution API +globs: + - "src/api/dto/**/*.ts" + - "src/api/integrations/**/dto/*.ts" +alwaysApply: false +--- + +# Evolution API DTO Rules + +## DTO Structure Pattern + +### Basic DTO Class +```typescript +export class ExampleDto { + name: string; + category: string; + allowCategoryChange: boolean; + language: string; + components: any; + webhookUrl?: string; +} +``` + +## Inheritance Pattern + +### DTO Inheritance +```typescript +// CORRECT - Evolution API pattern +export class InstanceDto extends IntegrationDto { + instanceName: string; + instanceId?: string; + qrcode?: boolean; + businessId?: string; + number?: string; + integration?: string; + token?: string; + status?: string; + ownerJid?: string; + profileName?: string; + profilePicUrl?: string; + + // Settings + rejectCall?: boolean; + msgCall?: string; + groupsIgnore?: boolean; + alwaysOnline?: boolean; + readMessages?: boolean; + readStatus?: boolean; + syncFullHistory?: boolean; + wavoipToken?: string; + + // Proxy settings + proxyHost?: string; + proxyPort?: string; + proxyProtocol?: string; + proxyUsername?: string; + proxyPassword?: string; + + // Webhook configuration + webhook?: { + enabled?: boolean; + events?: string[]; + headers?: JsonValue; + url?: string; + byEvents?: boolean; + base64?: boolean; + }; + + // Chatwoot integration + chatwootAccountId?: string; + chatwootConversationPending?: boolean; + chatwootAutoCreate?: boolean; + chatwootDaysLimitImportMessages?: number; + chatwootImportContacts?: boolean; + chatwootImportMessages?: boolean; + chatwootLogo?: string; + chatwootMergeBrazilContacts?: boolean; + chatwootNameInbox?: string; + chatwootOrganization?: string; + chatwootReopenConversation?: boolean; + chatwootSignMsg?: boolean; + chatwootToken?: string; + chatwootUrl?: string; +} +``` + +## Base DTO Pattern + +### Base Chatbot DTO +```typescript +/** + * Base DTO for all chatbot integrations + * Contains common properties shared by all chatbot types + */ +export class BaseChatbotDto { + enabled?: boolean; + description: string; + expire?: number; + keywordFinish?: string; + delayMessage?: number; + unknownMessage?: string; + listeningFromMe?: boolean; + stopBotFromMe?: boolean; + keepOpen?: boolean; + debounceTime?: number; + triggerType: TriggerType; + triggerOperator?: TriggerOperator; + triggerValue?: string; + ignoreJids?: string[]; + splitMessages?: boolean; + timePerChar?: number; +} + +/** + * Base settings DTO for all chatbot integrations + */ +export class BaseChatbotSettingDto { + expire?: number; + keywordFinish?: string; + delayMessage?: number; + unknownMessage?: string; + listeningFromMe?: boolean; + stopBotFromMe?: boolean; + keepOpen?: boolean; + debounceTime?: number; + ignoreJids?: string[]; + splitMessages?: boolean; + timePerChar?: number; +} +``` + +## Message DTO Patterns + +### Send Message DTOs +```typescript +export class Metadata { + number: string; + delay?: number; +} + +export class SendTextDto extends Metadata { + text: string; + linkPreview?: boolean; + mentionsEveryOne?: boolean; + mentioned?: string[]; +} + +export class SendListDto extends Metadata { + title: string; + description: string; + buttonText: string; + footerText?: string; + + sections: Section[]; +} + +export class ContactMessage { + fullName: string; + wuid: string; + phoneNumber: string; + organization?: string; + email?: string; + url?: string; +} + +export class SendTemplateDto extends Metadata { + name: string; + language: string; + components: any; +} +``` + +## Simple DTO Patterns + +### Basic DTOs +```typescript +export class NumberDto { + number: string; +} + +export class LabelDto { + id?: string; + name: string; + color: string; + predefinedId?: string; +} + +export class HandleLabelDto { + number: string; + labelId: string; +} + +export class ProfileNameDto { + name: string; +} + +export class WhatsAppNumberDto { + numbers: string[]; +} +``` + +## Complex DTO Patterns + +### Business DTOs +```typescript +export class getCatalogDto { + number?: string; + limit?: number; + cursor?: string; +} + +export class getCollectionsDto { + number?: string; + limit?: number; + cursor?: string; +} + +export class NumberBusiness { + number: string; + name?: string; + description?: string; + email?: string; + websites?: string[]; + latitude?: number; + longitude?: number; + address?: string; + profilehandle?: string; +} +``` + +## Settings DTO Pattern + +### Settings Configuration +```typescript +export class SettingsDto { + rejectCall?: boolean; + msgCall?: string; + groupsIgnore?: boolean; + alwaysOnline?: boolean; + readMessages?: boolean; + readStatus?: boolean; + syncFullHistory?: boolean; + wavoipToken?: string; +} + +export class ProxyDto { + host?: string; + port?: string; + protocol?: string; + username?: string; + password?: string; +} +``` + +## Presence DTO Pattern + +### WhatsApp Presence +```typescript +export class SetPresenceDto { + presence: WAPresence; +} + +export class SendPresenceDto { + number: string; + presence: WAPresence; +} +``` + +## DTO Structure (No Decorators) + +### Simple DTO Classes (Evolution API Pattern) +```typescript +// CORRECT - Evolution API pattern (no decorators) +export class ExampleDto { + name: string; + description?: string; + enabled: boolean; + items?: string[]; + timeout?: number; +} + +// INCORRECT - Don't use class-validator decorators +export class ValidatedDto { + @IsString() // ❌ Evolution API doesn't use decorators + name: string; +} +``` + +## Type Safety Patterns + +### Prisma Type Integration +```typescript +import { JsonValue } from '@prisma/client/runtime/library'; +import { WAPresence } from 'baileys'; +import { TriggerOperator, TriggerType } from '@prisma/client'; + +export class TypeSafeDto { + presence: WAPresence; + triggerType: TriggerType; + triggerOperator?: TriggerOperator; + metadata?: JsonValue; +} +``` + +## DTO Documentation + +### JSDoc Comments +```typescript +/** + * DTO for creating WhatsApp templates + * Used by Meta Business API integration + */ +export class TemplateDto { + /** Template name - must be unique */ + name: string; + + /** Template category (MARKETING, UTILITY, AUTHENTICATION) */ + category: string; + + /** Whether category can be changed after creation */ + allowCategoryChange: boolean; + + /** Language code (e.g., 'pt_BR', 'en_US') */ + language: string; + + /** Template components (header, body, footer, buttons) */ + components: any; + + /** Optional webhook URL for template status updates */ + webhookUrl?: string; +} +``` + +## DTO Naming Conventions + +### Standard Naming Patterns +- `*Dto` - Data transfer objects +- `Create*Dto` - Creation DTOs +- `Update*Dto` - Update DTOs +- `Send*Dto` - Message sending DTOs +- `Get*Dto` - Query DTOs +- `Handle*Dto` - Action DTOs + +## File Organization + +### DTO File Structure +``` +src/api/dto/ +├── instance.dto.ts # Main instance DTO +├── template.dto.ts # Template management +├── sendMessage.dto.ts # Message sending DTOs +├── chat.dto.ts # Chat operations +├── business.dto.ts # Business API DTOs +├── group.dto.ts # Group management +├── label.dto.ts # Label management +├── proxy.dto.ts # Proxy configuration +├── settings.dto.ts # Instance settings +└── call.dto.ts # Call operations +``` + +## Integration DTO Patterns + +### Chatbot Integration DTOs +```typescript +// Base for all chatbot DTOs +export class BaseChatbotDto { + enabled?: boolean; + description: string; + // ... common properties +} + +// Specific chatbot DTOs extend base +export class TypebotDto extends BaseChatbotDto { + url: string; + typebot: string; + // ... typebot-specific properties +} + +export class OpenaiDto extends BaseChatbotDto { + apiKey: string; + model: string; + // ... openai-specific properties +} +``` + +## DTO Testing Pattern + +### DTO Validation Tests +```typescript +describe('ExampleDto', () => { + it('should validate required fields', () => { + const dto = new ExampleDto(); + dto.name = 'test'; + dto.category = 'MARKETING'; + dto.allowCategoryChange = true; + dto.language = 'pt_BR'; + dto.components = {}; + + expect(dto.name).toBe('test'); + expect(dto.category).toBe('MARKETING'); + }); + + it('should handle optional fields', () => { + const dto = new ExampleDto(); + dto.name = 'test'; + dto.category = 'MARKETING'; + dto.allowCategoryChange = true; + dto.language = 'pt_BR'; + dto.components = {}; + dto.webhookUrl = 'https://example.com/webhook'; + + expect(dto.webhookUrl).toBe('https://example.com/webhook'); + }); +}); +``` + +## DTO Transformation + +### Request to DTO Mapping (Evolution API Pattern) +```typescript +// CORRECT - Evolution API uses RouterBroker dataValidate +const response = await this.dataValidate({ + request: req, + schema: exampleSchema, // JSONSchema7 + ClassRef: ExampleDto, + execute: (instance, data) => controller.method(instance, data), +}); + +// INCORRECT - Don't use class-validator +const dto = plainToClass(ExampleDto, req.body); // ❌ Not used in Evolution API +const errors = await validate(dto); // ❌ Not used in Evolution API +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/guard-rules.mdc b/.cursor/rules/specialized-rules/guard-rules.mdc new file mode 100644 index 00000000..d85215fe --- /dev/null +++ b/.cursor/rules/specialized-rules/guard-rules.mdc @@ -0,0 +1,416 @@ +--- +description: Guard patterns for authentication and authorization in Evolution API +globs: + - "src/api/guards/**/*.ts" +alwaysApply: false +--- + +# Evolution API Guard Rules + +## Guard Structure Pattern + +### Standard Guard Function +```typescript +import { NextFunction, Request, Response } from 'express'; +import { Logger } from '@config/logger.config'; +import { UnauthorizedException, ForbiddenException } from '@exceptions'; + +const logger = new Logger('GUARD'); + +async function guardFunction(req: Request, _: Response, next: NextFunction) { + // Guard logic here + + if (validationFails) { + throw new UnauthorizedException(); + } + + return next(); +} + +export const guardName = { guardFunction }; +``` + +## Authentication Guard Pattern + +### API Key Authentication +```typescript +async function apikey(req: Request, _: Response, next: NextFunction) { + const env = configService.get('AUTHENTICATION').API_KEY; + const key = req.get('apikey'); + const db = configService.get('DATABASE'); + + if (!key) { + throw new UnauthorizedException(); + } + + // Global API key check + if (env.KEY === key) { + return next(); + } + + // Special routes handling + if ((req.originalUrl.includes('/instance/create') || req.originalUrl.includes('/instance/fetchInstances')) && !key) { + throw new ForbiddenException('Missing global api key', 'The global api key must be set'); + } + + const param = req.params as unknown as InstanceDto; + + try { + if (param?.instanceName) { + const instance = await prismaRepository.instance.findUnique({ + where: { name: param.instanceName }, + }); + if (instance.token === key) { + return next(); + } + } else { + if (req.originalUrl.includes('/instance/fetchInstances') && db.SAVE_DATA.INSTANCE) { + const instanceByKey = await prismaRepository.instance.findFirst({ + where: { token: key }, + }); + if (instanceByKey) { + return next(); + } + } + } + } catch (error) { + logger.error(error); + } + + throw new UnauthorizedException(); +} + +export const authGuard = { apikey }; +``` + +## Instance Validation Guards + +### Instance Exists Guard +```typescript +async function getInstance(instanceName: string) { + try { + const cacheConf = configService.get('CACHE'); + + const exists = !!waMonitor.waInstances[instanceName]; + + if (cacheConf.REDIS.ENABLED && cacheConf.REDIS.SAVE_INSTANCES) { + const keyExists = await cache.has(instanceName); + return exists || keyExists; + } + + return exists || (await prismaRepository.instance.findMany({ where: { name: instanceName } })).length > 0; + } catch (error) { + throw new InternalServerErrorException(error?.toString()); + } +} + +export async function instanceExistsGuard(req: Request, _: Response, next: NextFunction) { + if (req.originalUrl.includes('/instance/create')) { + return next(); + } + + const param = req.params as unknown as InstanceDto; + if (!param?.instanceName) { + throw new BadRequestException('"instanceName" not provided.'); + } + + if (!(await getInstance(param.instanceName))) { + throw new NotFoundException(`The "${param.instanceName}" instance does not exist`); + } + + next(); +} +``` + +### Instance Logged Guard +```typescript +export async function instanceLoggedGuard(req: Request, _: Response, next: NextFunction) { + if (req.originalUrl.includes('/instance/create')) { + const instance = req.body as InstanceDto; + if (await getInstance(instance.instanceName)) { + throw new ForbiddenException(`This name "${instance.instanceName}" is already in use.`); + } + + if (waMonitor.waInstances[instance.instanceName]) { + delete waMonitor.waInstances[instance.instanceName]; + } + } + + next(); +} +``` + +## Telemetry Guard Pattern + +### Telemetry Collection +```typescript +class Telemetry { + public collectTelemetry(req: Request, res: Response, next: NextFunction): void { + // Collect telemetry data + const telemetryData = { + route: req.originalUrl, + method: req.method, + timestamp: new Date(), + userAgent: req.get('User-Agent'), + }; + + // Send telemetry asynchronously (don't block request) + setImmediate(() => { + this.sendTelemetry(telemetryData); + }); + + next(); + } + + private async sendTelemetry(data: any): Promise { + try { + // Send telemetry data + } catch (error) { + // Silently fail - don't affect main request + } + } +} + +export default Telemetry; +``` + +## Guard Composition Pattern + +### Multiple Guards Usage +```typescript +// In router setup +const guards = [instanceExistsGuard, instanceLoggedGuard, authGuard['apikey']]; + +router + .use('/instance', new InstanceRouter(configService, ...guards).router) + .use('/message', new MessageRouter(...guards).router) + .use('/chat', new ChatRouter(...guards).router); +``` + +## Error Handling in Guards + +### Proper Exception Throwing +```typescript +// CORRECT - Use proper HTTP exceptions +if (!apiKey) { + throw new UnauthorizedException('API key required'); +} + +if (instanceExists) { + throw new ForbiddenException('Instance already exists'); +} + +if (!instanceFound) { + throw new NotFoundException('Instance not found'); +} + +if (validationFails) { + throw new BadRequestException('Invalid request parameters'); +} + +// INCORRECT - Don't use generic Error +if (!apiKey) { + throw new Error('API key required'); // ❌ Use specific exceptions +} +``` + +## Configuration Access in Guards + +### Config Service Usage +```typescript +async function configAwareGuard(req: Request, _: Response, next: NextFunction) { + const authConfig = configService.get('AUTHENTICATION'); + const cacheConfig = configService.get('CACHE'); + const dbConfig = configService.get('DATABASE'); + + // Use configuration for guard logic + if (authConfig.API_KEY.KEY === providedKey) { + return next(); + } + + throw new UnauthorizedException(); +} +``` + +## Database Access in Guards + +### Prisma Repository Usage +```typescript +async function databaseGuard(req: Request, _: Response, next: NextFunction) { + try { + const param = req.params as unknown as InstanceDto; + + const instance = await prismaRepository.instance.findUnique({ + where: { name: param.instanceName }, + }); + + if (!instance) { + throw new NotFoundException('Instance not found'); + } + + // Additional validation logic + if (instance.status !== 'active') { + throw new ForbiddenException('Instance not active'); + } + + return next(); + } catch (error) { + logger.error('Database guard error:', error); + throw new InternalServerErrorException('Database access failed'); + } +} +``` + +## Cache Integration in Guards + +### Cache Service Usage +```typescript +async function cacheAwareGuard(req: Request, _: Response, next: NextFunction) { + const cacheConf = configService.get('CACHE'); + + if (cacheConf.REDIS.ENABLED) { + const cached = await cache.get(`guard:${req.params.instanceName}`); + if (cached) { + // Use cached validation result + return next(); + } + } + + // Perform validation and cache result + const isValid = await performValidation(req.params.instanceName); + + if (cacheConf.REDIS.ENABLED) { + await cache.set(`guard:${req.params.instanceName}`, isValid, 300); // 5 min TTL + } + + if (isValid) { + return next(); + } + + throw new UnauthorizedException(); +} +``` + +## Logging in Guards + +### Structured Logging +```typescript +const logger = new Logger('GUARD'); + +async function loggedGuard(req: Request, _: Response, next: NextFunction) { + logger.log(`Guard validation started for ${req.originalUrl}`); + + try { + // Guard logic + const isValid = await validateRequest(req); + + if (isValid) { + logger.log(`Guard validation successful for ${req.params.instanceName}`); + return next(); + } + + logger.warn(`Guard validation failed for ${req.params.instanceName}`); + throw new UnauthorizedException(); + } catch (error) { + logger.error(`Guard validation error: ${error.message}`, error.stack); + throw error; + } +} +``` + +## Guard Testing Pattern + +### Unit Test Structure +```typescript +describe('authGuard', () => { + let req: Partial; + let res: Partial; + let next: NextFunction; + + beforeEach(() => { + req = { + get: jest.fn(), + params: {}, + originalUrl: '/test', + }; + res = {}; + next = jest.fn(); + }); + + describe('apikey', () => { + it('should pass with valid global API key', async () => { + (req.get as jest.Mock).mockReturnValue('valid-global-key'); + + await authGuard.apikey(req as Request, res as Response, next); + + expect(next).toHaveBeenCalled(); + }); + + it('should throw UnauthorizedException with no API key', async () => { + (req.get as jest.Mock).mockReturnValue(undefined); + + await expect( + authGuard.apikey(req as Request, res as Response, next) + ).rejects.toThrow(UnauthorizedException); + }); + + it('should pass with valid instance token', async () => { + (req.get as jest.Mock).mockReturnValue('instance-token'); + req.params = { instanceName: 'test-instance' }; + + // Mock prisma repository + jest.spyOn(prismaRepository.instance, 'findUnique').mockResolvedValue({ + token: 'instance-token', + } as any); + + await authGuard.apikey(req as Request, res as Response, next); + + expect(next).toHaveBeenCalled(); + }); + }); +}); +``` + +## Guard Performance Considerations + +### Efficient Validation +```typescript +// CORRECT - Efficient guard with early returns +async function efficientGuard(req: Request, _: Response, next: NextFunction) { + // Quick checks first + if (req.originalUrl.includes('/public')) { + return next(); // Skip validation for public routes + } + + const apiKey = req.get('apikey'); + if (!apiKey) { + throw new UnauthorizedException(); // Fail fast + } + + // More expensive checks only if needed + if (apiKey === globalKey) { + return next(); // Skip database check + } + + // Database check only as last resort + const isValid = await validateInDatabase(apiKey); + if (isValid) { + return next(); + } + + throw new UnauthorizedException(); +} + +// INCORRECT - Inefficient guard +async function inefficientGuard(req: Request, _: Response, next: NextFunction) { + // Always do expensive database check first + const dbResult = await expensiveDatabaseQuery(); // ❌ Expensive operation first + + const apiKey = req.get('apikey'); + if (!apiKey && dbResult) { // ❌ Complex logic + throw new UnauthorizedException(); + } + + next(); +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-channel-rules.mdc b/.cursor/rules/specialized-rules/integration-channel-rules.mdc new file mode 100644 index 00000000..d2b94d96 --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-channel-rules.mdc @@ -0,0 +1,552 @@ +--- +description: Channel integration patterns for Evolution API +globs: + - "src/api/integrations/channel/**/*.ts" +alwaysApply: false +--- + +# Evolution API Channel Integration Rules + +## Channel Controller Pattern + +### Base Channel Controller +```typescript +export interface ChannelControllerInterface { + integrationEnabled: boolean; +} + +export class ChannelController { + public prismaRepository: PrismaRepository; + public waMonitor: WAMonitoringService; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + this.prisma = prismaRepository; + this.monitor = waMonitor; + } + + public set prisma(prisma: PrismaRepository) { + this.prismaRepository = prisma; + } + + public get prisma() { + return this.prismaRepository; + } + + public set monitor(waMonitor: WAMonitoringService) { + this.waMonitor = waMonitor; + } + + public get monitor() { + return this.waMonitor; + } + + public init(instanceData: InstanceDto, data: ChannelDataType) { + if (!instanceData.token && instanceData.integration === Integration.WHATSAPP_BUSINESS) { + throw new BadRequestException('token is required'); + } + + if (instanceData.integration === Integration.WHATSAPP_BUSINESS) { + return new BusinessStartupService(/* dependencies */); + } + + if (instanceData.integration === Integration.EVOLUTION) { + return new EvolutionStartupService(/* dependencies */); + } + + if (instanceData.integration === Integration.WHATSAPP_BAILEYS) { + return new BaileysStartupService(/* dependencies */); + } + + return null; + } +} +``` + +### Extended Channel Controller +```typescript +export class EvolutionController extends ChannelController implements ChannelControllerInterface { + private readonly logger = new Logger('EvolutionController'); + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + } + + integrationEnabled: boolean; + + public async receiveWebhook(data: any) { + const numberId = data.numberId; + + if (!numberId) { + this.logger.error('WebhookService -> receiveWebhookEvolution -> numberId not found'); + return; + } + + const instance = await this.prismaRepository.instance.findFirst({ + where: { number: numberId }, + }); + + if (!instance) { + this.logger.error('WebhookService -> receiveWebhook -> instance not found'); + return; + } + + await this.waMonitor.waInstances[instance.name].connectToWhatsapp(data); + + return { + status: 'success', + }; + } +} +``` + +## Channel Service Pattern + +### Base Channel Service +```typescript +export class ChannelStartupService { + constructor( + private readonly configService: ConfigService, + private readonly eventEmitter: EventEmitter2, + private readonly prismaRepository: PrismaRepository, + public readonly cache: CacheService, + public readonly chatwootCache: CacheService, + ) {} + + public readonly logger = new Logger('ChannelStartupService'); + + public client: WASocket; + public readonly instance: wa.Instance = {}; + public readonly localChatwoot: wa.LocalChatwoot = {}; + public readonly localProxy: wa.LocalProxy = {}; + public readonly localSettings: wa.LocalSettings = {}; + public readonly localWebhook: wa.LocalWebHook = {}; + + public setInstance(instance: InstanceDto) { + this.logger.setInstance(instance.instanceName); + + this.instance.name = instance.instanceName; + this.instance.id = instance.instanceId; + this.instance.integration = instance.integration; + this.instance.number = instance.number; + this.instance.token = instance.token; + this.instance.businessId = instance.businessId; + + if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { + this.chatwootService.eventWhatsapp( + Events.STATUS_INSTANCE, + { instanceName: this.instance.name }, + { + instance: this.instance.name, + status: 'created', + }, + ); + } + } + + public set instanceName(name: string) { + this.logger.setInstance(name); + this.instance.name = name; + } + + public get instanceName() { + return this.instance.name; + } +} +``` + +### Extended Channel Service +```typescript +export class EvolutionStartupService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache); + } + + public async sendMessage(data: SendTextDto): Promise { + // Evolution-specific message sending logic + const response = await this.evolutionApiCall('/send-message', data); + return response; + } + + public async connectToWhatsapp(data: any): Promise { + // Evolution-specific connection logic + this.logger.log('Connecting to Evolution API'); + + // Set up webhook listeners + this.setupWebhookHandlers(); + + // Initialize connection + await this.initializeConnection(data); + } + + private async evolutionApiCall(endpoint: string, data: any): Promise { + const config = this.configService.get('EVOLUTION'); + + try { + const response = await axios.post(`${config.API_URL}${endpoint}`, data, { + headers: { + 'Authorization': `Bearer ${this.instance.token}`, + 'Content-Type': 'application/json', + }, + }); + + return response.data; + } catch (error) { + this.logger.error(`Evolution API call failed: ${error.message}`); + throw new InternalServerErrorException('Evolution API call failed'); + } + } + + private setupWebhookHandlers(): void { + // Set up webhook event handlers + } + + private async initializeConnection(data: any): Promise { + // Initialize connection with Evolution API + } +} +``` + +## Business API Service Pattern + +### Meta Business Service +```typescript +export class BusinessStartupService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + baileysCache: CacheService, + providerFiles: ProviderFiles, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache); + } + + public async sendMessage(data: SendTextDto): Promise { + const businessConfig = this.configService.get('WA_BUSINESS'); + + const payload = { + messaging_product: 'whatsapp', + to: data.number, + type: 'text', + text: { + body: data.text, + }, + }; + + try { + const response = await axios.post( + `${businessConfig.URL}/${businessConfig.VERSION}/${this.instance.businessId}/messages`, + payload, + { + headers: { + 'Authorization': `Bearer ${this.instance.token}`, + 'Content-Type': 'application/json', + }, + } + ); + + return response.data; + } catch (error) { + this.logger.error(`Business API call failed: ${error.message}`); + throw new BadRequestException('Failed to send message via Business API'); + } + } + + public async receiveWebhook(data: any): Promise { + // Process incoming webhook from Meta Business API + const { entry } = data; + + for (const entryItem of entry) { + const { changes } = entryItem; + + for (const change of changes) { + if (change.field === 'messages') { + await this.processMessage(change.value); + } + } + } + } + + private async processMessage(messageData: any): Promise { + // Process incoming message from Business API + const { messages, contacts } = messageData; + + if (messages) { + for (const message of messages) { + await this.handleIncomingMessage(message, contacts); + } + } + } + + private async handleIncomingMessage(message: any, contacts: any[]): Promise { + // Handle individual message + const contact = contacts?.find(c => c.wa_id === message.from); + + // Emit event for message processing + this.eventEmitter.emit(Events.MESSAGES_UPSERT, { + instanceName: this.instance.name, + message, + contact, + }); + } +} +``` + +## Baileys Service Pattern + +### Baileys Integration Service +```typescript +export class BaileysStartupService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + baileysCache: CacheService, + providerFiles: ProviderFiles, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache); + } + + public async connectToWhatsapp(): Promise { + const authPath = path.join(INSTANCE_DIR, this.instance.name); + const { state, saveCreds } = await useMultiFileAuthState(authPath); + + this.client = makeWASocket({ + auth: state, + logger: P({ level: 'error' }), + printQRInTerminal: false, + browser: ['Evolution API', 'Chrome', '4.0.0'], + defaultQueryTimeoutMs: 60000, + }); + + this.setupEventHandlers(); + this.client.ev.on('creds.update', saveCreds); + } + + private setupEventHandlers(): void { + this.client.ev.on('connection.update', (update) => { + this.handleConnectionUpdate(update); + }); + + this.client.ev.on('messages.upsert', ({ messages, type }) => { + this.handleIncomingMessages(messages, type); + }); + + this.client.ev.on('messages.update', (updates) => { + this.handleMessageUpdates(updates); + }); + + this.client.ev.on('contacts.upsert', (contacts) => { + this.handleContactsUpdate(contacts); + }); + + this.client.ev.on('chats.upsert', (chats) => { + this.handleChatsUpdate(chats); + }); + } + + private async handleConnectionUpdate(update: ConnectionUpdate): Promise { + const { connection, lastDisconnect, qr } = update; + + if (qr) { + this.instance.qrcode = { + count: this.instance.qrcode?.count ? this.instance.qrcode.count + 1 : 1, + base64: qr, + }; + + this.eventEmitter.emit(Events.QRCODE_UPDATED, { + instanceName: this.instance.name, + qrcode: this.instance.qrcode, + }); + } + + if (connection === 'close') { + const shouldReconnect = (lastDisconnect?.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut; + + if (shouldReconnect) { + this.logger.log('Connection closed, reconnecting...'); + await this.connectToWhatsapp(); + } else { + this.logger.log('Connection closed, logged out'); + this.eventEmitter.emit(Events.LOGOUT_INSTANCE, { + instanceName: this.instance.name, + }); + } + } + + if (connection === 'open') { + this.logger.log('Connection opened successfully'); + this.instance.wuid = this.client.user?.id; + + this.eventEmitter.emit(Events.CONNECTION_UPDATE, { + instanceName: this.instance.name, + state: 'open', + }); + } + } + + public async sendMessage(data: SendTextDto): Promise { + const jid = createJid(data.number); + + const message = { + text: data.text, + }; + + if (data.linkPreview !== undefined) { + message.linkPreview = data.linkPreview; + } + + if (data.mentionsEveryOne) { + // Handle mentions + } + + try { + const response = await this.client.sendMessage(jid, message); + return response; + } catch (error) { + this.logger.error(`Failed to send message: ${error.message}`); + throw new BadRequestException('Failed to send message'); + } + } +} +``` + +## Channel Router Pattern + +### Channel Router Structure +```typescript +export class ChannelRouter { + public readonly router: Router; + + constructor(configService: any, ...guards: any[]) { + this.router = Router(); + + this.router.use('/', new EvolutionRouter(configService).router); + this.router.use('/', new MetaRouter(configService).router); + this.router.use('/baileys', new BaileysRouter(...guards).router); + } +} +``` + +### Specific Channel Router +```typescript +export class EvolutionRouter extends RouterBroker { + constructor(private readonly configService: ConfigService) { + super(); + this.router + .post(this.routerPath('webhook'), async (req, res) => { + const response = await evolutionController.receiveWebhook(req.body); + return res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router: Router = Router(); +} +``` + +## Integration Types + +### Channel Data Types +```typescript +type ChannelDataType = { + configService: ConfigService; + eventEmitter: EventEmitter2; + prismaRepository: PrismaRepository; + cache: CacheService; + chatwootCache: CacheService; + baileysCache: CacheService; + providerFiles: ProviderFiles; +}; + +export enum Integration { + WHATSAPP_BUSINESS = 'WHATSAPP-BUSINESS', + WHATSAPP_BAILEYS = 'WHATSAPP-BAILEYS', + EVOLUTION = 'EVOLUTION', +} +``` + +## Error Handling in Channels + +### Channel-Specific Error Handling +```typescript +// CORRECT - Channel-specific error handling +public async sendMessage(data: SendTextDto): Promise { + try { + const response = await this.channelSpecificSend(data); + return response; + } catch (error) { + this.logger.error(`${this.constructor.name} send failed: ${error.message}`); + + if (error.response?.status === 401) { + throw new UnauthorizedException('Invalid token for channel'); + } + + if (error.response?.status === 429) { + throw new BadRequestException('Rate limit exceeded'); + } + + throw new InternalServerErrorException('Channel communication failed'); + } +} +``` + +## Channel Testing Pattern + +### Channel Service Testing +```typescript +describe('EvolutionStartupService', () => { + let service: EvolutionStartupService; + let configService: jest.Mocked; + let eventEmitter: jest.Mocked; + + beforeEach(() => { + const mockConfig = { + get: jest.fn().mockReturnValue({ + API_URL: 'https://api.evolution.com', + }), + }; + + service = new EvolutionStartupService( + mockConfig as any, + eventEmitter, + prismaRepository, + cache, + chatwootCache, + ); + }); + + describe('sendMessage', () => { + it('should send message successfully', async () => { + const data = { number: '5511999999999', text: 'Test message' }; + + // Mock axios response + jest.spyOn(axios, 'post').mockResolvedValue({ + data: { success: true, messageId: '123' }, + }); + + const result = await service.sendMessage(data); + + expect(result.success).toBe(true); + expect(axios.post).toHaveBeenCalledWith( + expect.stringContaining('/send-message'), + data, + expect.objectContaining({ + headers: expect.objectContaining({ + 'Authorization': expect.stringContaining('Bearer'), + }), + }) + ); + }); + }); +}); +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-chatbot-rules.mdc b/.cursor/rules/specialized-rules/integration-chatbot-rules.mdc new file mode 100644 index 00000000..ff511754 --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-chatbot-rules.mdc @@ -0,0 +1,597 @@ +--- +description: Chatbot integration patterns for Evolution API +globs: + - "src/api/integrations/chatbot/**/*.ts" +alwaysApply: false +--- + +# Evolution API Chatbot Integration Rules + +## Base Chatbot Pattern + +### Base Chatbot DTO +```typescript +/** + * Base DTO for all chatbot integrations + * Contains common properties shared by all chatbot types + */ +export class BaseChatbotDto { + enabled?: boolean; + description: string; + expire?: number; + keywordFinish?: string; + delayMessage?: number; + unknownMessage?: string; + listeningFromMe?: boolean; + stopBotFromMe?: boolean; + keepOpen?: boolean; + debounceTime?: number; + triggerType: TriggerType; + triggerOperator?: TriggerOperator; + triggerValue?: string; + ignoreJids?: string[]; + splitMessages?: boolean; + timePerChar?: number; +} +``` + +### Base Chatbot Controller +```typescript +export abstract class BaseChatbotController + extends ChatbotController + implements ChatbotControllerInterface +{ + public readonly logger: Logger; + integrationEnabled: boolean; + botRepository: any; + settingsRepository: any; + sessionRepository: any; + userMessageDebounce: { [key: string]: { message: string; timeoutId: NodeJS.Timeout } } = {}; + + // Abstract methods to be implemented by specific chatbots + protected abstract readonly integrationName: string; + protected abstract processBot( + waInstance: any, + remoteJid: string, + bot: BotType, + session: any, + settings: ChatbotSettings, + content: string, + pushName?: string, + msg?: any, + ): Promise; + protected abstract getFallbackBotId(settings: any): string | undefined; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + this.sessionRepository = this.prismaRepository.integrationSession; + } + + // Base implementation methods + public async createBot(instance: InstanceDto, data: BotData) { + if (!data.enabled) { + throw new BadRequestException(`${this.integrationName} is disabled`); + } + + // Common bot creation logic + const bot = await this.botRepository.create({ + data: { + ...data, + instanceId: instance.instanceId, + }, + }); + + return bot; + } +} +``` + +### Base Chatbot Service +```typescript +/** + * Base class for all chatbot service implementations + * Contains common methods shared across different chatbot integrations + */ +export abstract class BaseChatbotService { + protected readonly logger: Logger; + protected readonly waMonitor: WAMonitoringService; + protected readonly prismaRepository: PrismaRepository; + protected readonly configService?: ConfigService; + + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + loggerName: string, + configService?: ConfigService, + ) { + this.waMonitor = waMonitor; + this.prismaRepository = prismaRepository; + this.logger = new Logger(loggerName); + this.configService = configService; + } + + /** + * Check if a message contains an image + */ + protected isImageMessage(content: string): boolean { + return content.includes('imageMessage'); + } + + /** + * Extract text content from message + */ + protected getMessageContent(msg: any): string { + return getConversationMessage(msg); + } + + /** + * Send typing indicator + */ + protected async sendTyping(instanceName: string, remoteJid: string): Promise { + await this.waMonitor.waInstances[instanceName].sendPresence(remoteJid, 'composing'); + } +} +``` + +## Typebot Integration Pattern + +### Typebot Service +```typescript +export class TypebotService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + configService: ConfigService, + prismaRepository: PrismaRepository, + private readonly openaiService: OpenaiService, + ) { + super(waMonitor, prismaRepository, 'TypebotService', configService); + } + + public async sendTypebotMessage( + instanceName: string, + remoteJid: string, + typebot: TypebotModel, + content: string, + ): Promise { + try { + const response = await axios.post( + `${typebot.url}/api/v1/typebots/${typebot.typebot}/startChat`, + { + message: content, + sessionId: `${instanceName}-${remoteJid}`, + }, + { + headers: { + 'Content-Type': 'application/json', + }, + } + ); + + const { messages } = response.data; + + for (const message of messages) { + await this.processTypebotMessage(instanceName, remoteJid, message); + } + } catch (error) { + this.logger.error(`Typebot API error: ${error.message}`); + throw new InternalServerErrorException('Typebot communication failed'); + } + } + + private async processTypebotMessage( + instanceName: string, + remoteJid: string, + message: any, + ): Promise { + const waInstance = this.waMonitor.waInstances[instanceName]; + + if (message.type === 'text') { + await waInstance.sendMessage({ + number: remoteJid.split('@')[0], + text: message.content.richText[0].children[0].text, + }); + } + + if (message.type === 'image') { + await waInstance.sendMessage({ + number: remoteJid.split('@')[0], + mediaMessage: { + mediatype: 'image', + media: message.content.url, + }, + }); + } + } +} +``` + +## OpenAI Integration Pattern + +### OpenAI Service +```typescript +export class OpenaiService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(waMonitor, prismaRepository, 'OpenaiService', configService); + } + + public async sendOpenaiMessage( + instanceName: string, + remoteJid: string, + openai: OpenaiModel, + content: string, + pushName?: string, + ): Promise { + try { + const openaiConfig = this.configService.get('OPENAI'); + + const response = await axios.post( + 'https://api.openai.com/v1/chat/completions', + { + model: openai.model || 'gpt-3.5-turbo', + messages: [ + { + role: 'system', + content: openai.systemMessage || 'You are a helpful assistant.', + }, + { + role: 'user', + content: content, + }, + ], + max_tokens: openai.maxTokens || 1000, + temperature: openai.temperature || 0.7, + }, + { + headers: { + 'Authorization': `Bearer ${openai.apiKey || openaiConfig.API_KEY}`, + 'Content-Type': 'application/json', + }, + } + ); + + const aiResponse = response.data.choices[0].message.content; + + await this.waMonitor.waInstances[instanceName].sendMessage({ + number: remoteJid.split('@')[0], + text: aiResponse, + }); + } catch (error) { + this.logger.error(`OpenAI API error: ${error.message}`); + + // Send fallback message + await this.waMonitor.waInstances[instanceName].sendMessage({ + number: remoteJid.split('@')[0], + text: openai.unknownMessage || 'Desculpe, não consegui processar sua mensagem.', + }); + } + } +} +``` + +## Chatwoot Integration Pattern + +### Chatwoot Service +```typescript +export class ChatwootService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + configService: ConfigService, + prismaRepository: PrismaRepository, + private readonly chatwootCache: CacheService, + ) { + super(waMonitor, prismaRepository, 'ChatwootService', configService); + } + + public async eventWhatsapp( + event: Events, + instanceName: { instanceName: string }, + data: any, + ): Promise { + const chatwootConfig = this.configService.get('CHATWOOT'); + + if (!chatwootConfig.ENABLED) { + return; + } + + try { + const instance = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName.instanceName }, + }); + + if (!instance?.chatwootAccountId) { + return; + } + + const webhook = { + event, + instance: instanceName.instanceName, + data, + timestamp: new Date().toISOString(), + }; + + await axios.post( + `${instance.chatwootUrl}/api/v1/accounts/${instance.chatwootAccountId}/webhooks`, + webhook, + { + headers: { + 'Authorization': `Bearer ${instance.chatwootToken}`, + 'Content-Type': 'application/json', + }, + } + ); + } catch (error) { + this.logger.error(`Chatwoot webhook error: ${error.message}`); + } + } + + public async createConversation( + instanceName: string, + contact: any, + message: any, + ): Promise { + // Create conversation in Chatwoot + const instance = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName }, + }); + + if (!instance?.chatwootAccountId) { + return; + } + + try { + const conversation = await axios.post( + `${instance.chatwootUrl}/api/v1/accounts/${instance.chatwootAccountId}/conversations`, + { + source_id: contact.id, + inbox_id: instance.chatwootInboxId, + contact_id: contact.chatwootContactId, + }, + { + headers: { + 'Authorization': `Bearer ${instance.chatwootToken}`, + 'Content-Type': 'application/json', + }, + } + ); + + // Cache conversation + await this.chatwootCache.set( + `conversation:${instanceName}:${contact.id}`, + conversation.data, + 3600 + ); + } catch (error) { + this.logger.error(`Chatwoot conversation creation error: ${error.message}`); + } + } +} +``` + +## Dify Integration Pattern + +### Dify Service +```typescript +export class DifyService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + configService: ConfigService, + private readonly openaiService: OpenaiService, + ) { + super(waMonitor, prismaRepository, 'DifyService', configService); + } + + public async sendDifyMessage( + instanceName: string, + remoteJid: string, + dify: DifyModel, + content: string, + ): Promise { + try { + const response = await axios.post( + `${dify.apiUrl}/v1/chat-messages`, + { + inputs: {}, + query: content, + user: remoteJid, + conversation_id: `${instanceName}-${remoteJid}`, + response_mode: 'blocking', + }, + { + headers: { + 'Authorization': `Bearer ${dify.apiKey}`, + 'Content-Type': 'application/json', + }, + } + ); + + const aiResponse = response.data.answer; + + await this.waMonitor.waInstances[instanceName].sendMessage({ + number: remoteJid.split('@')[0], + text: aiResponse, + }); + } catch (error) { + this.logger.error(`Dify API error: ${error.message}`); + + // Fallback to OpenAI if configured + if (dify.fallbackOpenai && this.openaiService) { + await this.openaiService.sendOpenaiMessage(instanceName, remoteJid, dify.openaiBot, content); + } + } + } +} +``` + +## Chatbot Router Pattern + +### Chatbot Router Structure (Evolution API Real Pattern) +```typescript +export class ChatbotRouter { + public readonly router: Router; + + constructor(...guards: any[]) { + this.router = Router(); + + // Real Evolution API chatbot integrations + this.router.use('/evolutionBot', new EvolutionBotRouter(...guards).router); + this.router.use('/chatwoot', new ChatwootRouter(...guards).router); + this.router.use('/typebot', new TypebotRouter(...guards).router); + this.router.use('/openai', new OpenaiRouter(...guards).router); + this.router.use('/dify', new DifyRouter(...guards).router); + this.router.use('/flowise', new FlowiseRouter(...guards).router); + this.router.use('/n8n', new N8nRouter(...guards).router); + this.router.use('/evoai', new EvoaiRouter(...guards).router); + } +} +``` + +## Chatbot Validation Patterns + +### Chatbot Schema Validation (Evolution API Pattern) +```typescript +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +const isNotEmpty = (...fields: string[]) => { + const properties = {}; + fields.forEach((field) => { + properties[field] = { + if: { properties: { [field]: { type: 'string' } } }, + then: { properties: { [field]: { minLength: 1 } } }, + }; + }); + + return { + allOf: Object.values(properties), + }; +}; + +export const evolutionBotSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean' }, + description: { type: 'string' }, + apiUrl: { type: 'string' }, + apiKey: { type: 'string' }, + triggerType: { type: 'string', enum: ['all', 'keyword', 'none', 'advanced'] }, + triggerOperator: { type: 'string', enum: ['equals', 'contains', 'startsWith', 'endsWith', 'regex'] }, + triggerValue: { type: 'string' }, + expire: { type: 'integer' }, + keywordFinish: { type: 'string' }, + delayMessage: { type: 'integer' }, + unknownMessage: { type: 'string' }, + listeningFromMe: { type: 'boolean' }, + stopBotFromMe: { type: 'boolean' }, + keepOpen: { type: 'boolean' }, + debounceTime: { type: 'integer' }, + ignoreJids: { type: 'array', items: { type: 'string' } }, + splitMessages: { type: 'boolean' }, + timePerChar: { type: 'integer' }, + }, + required: ['enabled', 'apiUrl', 'triggerType'], + ...isNotEmpty('enabled', 'apiUrl', 'triggerType'), +}; + +function validateKeywordTrigger( + content: string, + operator: TriggerOperator, + value: string, +): boolean { + const normalizedContent = content.toLowerCase().trim(); + const normalizedValue = value.toLowerCase().trim(); + + switch (operator) { + case TriggerOperator.EQUALS: + return normalizedContent === normalizedValue; + case TriggerOperator.CONTAINS: + return normalizedContent.includes(normalizedValue); + case TriggerOperator.STARTS_WITH: + return normalizedContent.startsWith(normalizedValue); + case TriggerOperator.ENDS_WITH: + return normalizedContent.endsWith(normalizedValue); + default: + return false; + } +} +``` + +## Session Management Pattern + +### Chatbot Session Handling +```typescript +export class ChatbotSessionManager { + constructor( + private readonly prismaRepository: PrismaRepository, + private readonly cache: CacheService, + ) {} + + public async getSession( + instanceName: string, + remoteJid: string, + botId: string, + ): Promise { + const cacheKey = `session:${instanceName}:${remoteJid}:${botId}`; + + // Try cache first + let session = await this.cache.get(cacheKey); + if (session) { + return session; + } + + // Query database + session = await this.prismaRepository.integrationSession.findFirst({ + where: { + instanceId: instanceName, + remoteJid, + botId, + status: 'opened', + }, + }); + + // Cache result + if (session) { + await this.cache.set(cacheKey, session, 300); // 5 min TTL + } + + return session; + } + + public async createSession( + instanceName: string, + remoteJid: string, + botId: string, + ): Promise { + const session = await this.prismaRepository.integrationSession.create({ + data: { + instanceId: instanceName, + remoteJid, + botId, + status: 'opened', + createdAt: new Date(), + }, + }); + + // Cache new session + const cacheKey = `session:${instanceName}:${remoteJid}:${botId}`; + await this.cache.set(cacheKey, session, 300); + + return session; + } + + public async closeSession(sessionId: string): Promise { + await this.prismaRepository.integrationSession.update({ + where: { id: sessionId }, + data: { status: 'closed', updatedAt: new Date() }, + }); + + // Invalidate cache + // Note: In a real implementation, you'd need to track cache keys by session ID + } +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-event-rules.mdc b/.cursor/rules/specialized-rules/integration-event-rules.mdc new file mode 100644 index 00000000..2687d72f --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-event-rules.mdc @@ -0,0 +1,851 @@ +--- +description: Event integration patterns for Evolution API +globs: + - "src/api/integrations/event/**/*.ts" +alwaysApply: false +--- + +# Evolution API Event Integration Rules + +## Event Manager Pattern + +### Event Manager Structure +```typescript +import { PrismaRepository } from '@api/repository/repository.service'; +import { ConfigService } from '@config/env.config'; +import { Logger } from '@config/logger.config'; +import { Server } from 'http'; + +export class EventManager { + private prismaRepository: PrismaRepository; + private configService: ConfigService; + private logger = new Logger('EventManager'); + + // Event integrations + private webhook: WebhookController; + private websocket: WebsocketController; + private rabbitmq: RabbitmqController; + private nats: NatsController; + private sqs: SqsController; + private pusher: PusherController; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + server?: Server, + ) { + this.prismaRepository = prismaRepository; + this.configService = configService; + + // Initialize event controllers + this.webhook = new WebhookController(prismaRepository, configService); + this.websocket = new WebsocketController(prismaRepository, configService, server); + this.rabbitmq = new RabbitmqController(prismaRepository, configService); + this.nats = new NatsController(prismaRepository, configService); + this.sqs = new SqsController(prismaRepository, configService); + this.pusher = new PusherController(prismaRepository, configService); + } + + public async emit(eventData: { + instanceName: string; + origin: string; + event: string; + data: Object; + serverUrl: string; + dateTime: string; + sender: string; + apiKey?: string; + local?: boolean; + integration?: string[]; + }): Promise { + this.logger.log(`Emitting event ${eventData.event} for instance ${eventData.instanceName}`); + + // Emit to all configured integrations + await Promise.allSettled([ + this.webhook.emit(eventData), + this.websocket.emit(eventData), + this.rabbitmq.emit(eventData), + this.nats.emit(eventData), + this.sqs.emit(eventData), + this.pusher.emit(eventData), + ]); + } + + public async setInstance(instanceName: string, data: any): Promise { + const promises = []; + + if (data.websocket) { + promises.push( + this.websocket.set(instanceName, { + websocket: { + enabled: true, + events: data.websocket?.events, + }, + }) + ); + } + + if (data.rabbitmq) { + promises.push( + this.rabbitmq.set(instanceName, { + rabbitmq: { + enabled: true, + events: data.rabbitmq?.events, + }, + }) + ); + } + + if (data.webhook) { + promises.push( + this.webhook.set(instanceName, { + webhook: { + enabled: true, + events: data.webhook?.events, + url: data.webhook?.url, + headers: data.webhook?.headers, + base64: data.webhook?.base64, + byEvents: data.webhook?.byEvents, + }, + }) + ); + } + + // Set other integrations... + + await Promise.allSettled(promises); + } +} +``` + +## Base Event Controller Pattern + +### Abstract Event Controller +```typescript +import { PrismaRepository } from '@api/repository/repository.service'; +import { ConfigService } from '@config/env.config'; +import { Logger } from '@config/logger.config'; + +export type EmitData = { + instanceName: string; + origin: string; + event: string; + data: Object; + serverUrl: string; + dateTime: string; + sender: string; + apiKey?: string; + local?: boolean; + integration?: string[]; +}; + +export interface EventControllerInterface { + integrationEnabled: boolean; + emit(data: EmitData): Promise; + set(instanceName: string, data: any): Promise; +} + +export abstract class EventController implements EventControllerInterface { + protected readonly logger: Logger; + protected readonly prismaRepository: PrismaRepository; + protected readonly configService: ConfigService; + + public integrationEnabled: boolean = false; + + // Available events for all integrations + public static readonly events = [ + 'APPLICATION_STARTUP', + 'INSTANCE_CREATE', + 'INSTANCE_DELETE', + 'QRCODE_UPDATED', + 'CONNECTION_UPDATE', + 'STATUS_INSTANCE', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_EDITED', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPDATE', + 'CHATS_UPSERT', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUPS_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CALL', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'LABELS_EDIT', + 'LABELS_ASSOCIATION', + 'CREDS_UPDATE', + 'MESSAGING_HISTORY_SET', + 'REMOVE_INSTANCE', + 'LOGOUT_INSTANCE', + ]; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + loggerName: string, + ) { + this.prismaRepository = prismaRepository; + this.configService = configService; + this.logger = new Logger(loggerName); + } + + // Abstract methods to be implemented by specific integrations + public abstract emit(data: EmitData): Promise; + public abstract set(instanceName: string, data: any): Promise; + + // Helper method to check if event should be processed + protected shouldProcessEvent(eventName: string, configuredEvents?: string[]): boolean { + if (!configuredEvents || configuredEvents.length === 0) { + return true; // Process all events if none specified + } + return configuredEvents.includes(eventName); + } + + // Helper method to get instance configuration + protected async getInstanceConfig(instanceName: string): Promise { + try { + const instance = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName }, + }); + return instance; + } catch (error) { + this.logger.error(`Failed to get instance config for ${instanceName}:`, error); + return null; + } + } +} +``` + +## Webhook Integration Pattern + +### Webhook Controller Implementation +```typescript +export class WebhookController extends EventController { + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(prismaRepository, configService, 'WebhookController'); + } + + public async emit(data: EmitData): Promise { + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.webhook?.enabled) { + return; + } + + const webhookConfig = instance.webhook; + + if (!this.shouldProcessEvent(data.event, webhookConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + server: { + version: process.env.npm_package_version, + url: data.serverUrl, + }, + }; + + // Encode data as base64 if configured + if (webhookConfig.base64) { + payload.data = Buffer.from(JSON.stringify(payload.data)).toString('base64'); + } + + const headers = { + 'Content-Type': 'application/json', + 'User-Agent': 'Evolution-API-Webhook', + ...webhookConfig.headers, + }; + + if (webhookConfig.byEvents) { + // Send to event-specific endpoint + const eventUrl = `${webhookConfig.url}/${data.event.toLowerCase()}`; + await this.sendWebhook(eventUrl, payload, headers); + } else { + // Send to main webhook URL + await this.sendWebhook(webhookConfig.url, payload, headers); + } + + this.logger.log(`Webhook sent for event ${data.event} to instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`Webhook emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const webhookData = data.webhook; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + webhook: webhookData, + }, + }); + + this.logger.log(`Webhook configuration set for instance ${instanceName}`); + return { webhook: webhookData }; + } catch (error) { + this.logger.error(`Failed to set webhook config for ${instanceName}:`, error); + throw error; + } + } + + private async sendWebhook(url: string, payload: any, headers: any): Promise { + try { + const response = await axios.post(url, payload, { + headers, + timeout: 30000, + maxRedirects: 3, + }); + + if (response.status >= 200 && response.status < 300) { + this.logger.log(`Webhook delivered successfully to ${url}`); + } else { + this.logger.warn(`Webhook returned status ${response.status} for ${url}`); + } + } catch (error) { + this.logger.error(`Webhook delivery failed to ${url}:`, error.message); + + // Implement retry logic here if needed + if (error.response?.status >= 500) { + // Server error - might be worth retrying + this.logger.log(`Server error detected, webhook might be retried later`); + } + } + } +} +``` + +## WebSocket Integration Pattern + +### WebSocket Controller Implementation +```typescript +import { Server as SocketIOServer } from 'socket.io'; +import { Server } from 'http'; + +export class WebsocketController extends EventController { + private io: SocketIOServer; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + server?: Server, + ) { + super(prismaRepository, configService, 'WebsocketController'); + + if (server) { + this.io = new SocketIOServer(server, { + cors: { + origin: "*", + methods: ["GET", "POST"], + }, + }); + + this.setupSocketHandlers(); + } + } + + private setupSocketHandlers(): void { + this.io.on('connection', (socket) => { + this.logger.log(`WebSocket client connected: ${socket.id}`); + + socket.on('join-instance', (instanceName: string) => { + socket.join(`instance:${instanceName}`); + this.logger.log(`Client ${socket.id} joined instance ${instanceName}`); + }); + + socket.on('leave-instance', (instanceName: string) => { + socket.leave(`instance:${instanceName}`); + this.logger.log(`Client ${socket.id} left instance ${instanceName}`); + }); + + socket.on('disconnect', () => { + this.logger.log(`WebSocket client disconnected: ${socket.id}`); + }); + }); + } + + public async emit(data: EmitData): Promise { + if (!this.io) { + return; + } + + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.websocket?.enabled) { + return; + } + + const websocketConfig = instance.websocket; + + if (!this.shouldProcessEvent(data.event, websocketConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + }; + + // Emit to specific instance room + this.io.to(`instance:${data.instanceName}`).emit('evolution-event', payload); + + // Also emit to global room for monitoring + this.io.emit('global-event', payload); + + this.logger.log(`WebSocket event ${data.event} emitted for instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`WebSocket emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const websocketData = data.websocket; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + websocket: websocketData, + }, + }); + + this.logger.log(`WebSocket configuration set for instance ${instanceName}`); + return { websocket: websocketData }; + } catch (error) { + this.logger.error(`Failed to set WebSocket config for ${instanceName}:`, error); + throw error; + } + } +} +``` + +## Queue Integration Patterns + +### RabbitMQ Controller Implementation +```typescript +import amqp from 'amqplib'; + +export class RabbitmqController extends EventController { + private connection: amqp.Connection | null = null; + private channel: amqp.Channel | null = null; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(prismaRepository, configService, 'RabbitmqController'); + this.initializeConnection(); + } + + private async initializeConnection(): Promise { + try { + const rabbitmqConfig = this.configService.get('RABBITMQ'); + if (!rabbitmqConfig?.ENABLED) { + return; + } + + this.connection = await amqp.connect(rabbitmqConfig.URI); + this.channel = await this.connection.createChannel(); + + // Declare exchange for Evolution API events + await this.channel.assertExchange('evolution-events', 'topic', { durable: true }); + + this.logger.log('RabbitMQ connection established'); + } catch (error) { + this.logger.error('Failed to initialize RabbitMQ connection:', error); + } + } + + public async emit(data: EmitData): Promise { + if (!this.channel) { + return; + } + + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.rabbitmq?.enabled) { + return; + } + + const rabbitmqConfig = instance.rabbitmq; + + if (!this.shouldProcessEvent(data.event, rabbitmqConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + }; + + const routingKey = `evolution.${data.instanceName}.${data.event.toLowerCase()}`; + + await this.channel.publish( + 'evolution-events', + routingKey, + Buffer.from(JSON.stringify(payload)), + { + persistent: true, + timestamp: Date.now(), + messageId: `${data.instanceName}-${Date.now()}`, + } + ); + + this.logger.log(`RabbitMQ message published for event ${data.event} to instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`RabbitMQ emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const rabbitmqData = data.rabbitmq; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + rabbitmq: rabbitmqData, + }, + }); + + this.logger.log(`RabbitMQ configuration set for instance ${instanceName}`); + return { rabbitmq: rabbitmqData }; + } catch (error) { + this.logger.error(`Failed to set RabbitMQ config for ${instanceName}:`, error); + throw error; + } + } +} +``` + +### SQS Controller Implementation +```typescript +import { SQSClient, SendMessageCommand } from '@aws-sdk/client-sqs'; + +export class SqsController extends EventController { + private sqsClient: SQSClient | null = null; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(prismaRepository, configService, 'SqsController'); + this.initializeSQSClient(); + } + + private initializeSQSClient(): void { + try { + const sqsConfig = this.configService.get('SQS'); + if (!sqsConfig?.ENABLED) { + return; + } + + this.sqsClient = new SQSClient({ + region: sqsConfig.REGION, + credentials: { + accessKeyId: sqsConfig.ACCESS_KEY_ID, + secretAccessKey: sqsConfig.SECRET_ACCESS_KEY, + }, + }); + + this.logger.log('SQS client initialized'); + } catch (error) { + this.logger.error('Failed to initialize SQS client:', error); + } + } + + public async emit(data: EmitData): Promise { + if (!this.sqsClient) { + return; + } + + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.sqs?.enabled) { + return; + } + + const sqsConfig = instance.sqs; + + if (!this.shouldProcessEvent(data.event, sqsConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + }; + + const command = new SendMessageCommand({ + QueueUrl: sqsConfig.queueUrl, + MessageBody: JSON.stringify(payload), + MessageAttributes: { + event: { + DataType: 'String', + StringValue: data.event, + }, + instance: { + DataType: 'String', + StringValue: data.instanceName, + }, + }, + MessageGroupId: data.instanceName, // For FIFO queues + MessageDeduplicationId: `${data.instanceName}-${Date.now()}`, // For FIFO queues + }); + + await this.sqsClient.send(command); + + this.logger.log(`SQS message sent for event ${data.event} to instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`SQS emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const sqsData = data.sqs; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + sqs: sqsData, + }, + }); + + this.logger.log(`SQS configuration set for instance ${instanceName}`); + return { sqs: sqsData }; + } catch (error) { + this.logger.error(`Failed to set SQS config for ${instanceName}:`, error); + throw error; + } + } +} +``` + +## Event DTO Pattern + +### Event Configuration DTO +```typescript +import { JsonValue } from '@prisma/client/runtime/library'; + +export class EventDto { + webhook?: { + enabled?: boolean; + events?: string[]; + url?: string; + headers?: JsonValue; + byEvents?: boolean; + base64?: boolean; + }; + + websocket?: { + enabled?: boolean; + events?: string[]; + }; + + sqs?: { + enabled?: boolean; + events?: string[]; + queueUrl?: string; + }; + + rabbitmq?: { + enabled?: boolean; + events?: string[]; + exchange?: string; + }; + + nats?: { + enabled?: boolean; + events?: string[]; + subject?: string; + }; + + pusher?: { + enabled?: boolean; + appId?: string; + key?: string; + secret?: string; + cluster?: string; + useTLS?: boolean; + events?: string[]; + }; +} +``` + +## Event Router Pattern + +### Event Router Structure +```typescript +import { NatsRouter } from '@api/integrations/event/nats/nats.router'; +import { PusherRouter } from '@api/integrations/event/pusher/pusher.router'; +import { RabbitmqRouter } from '@api/integrations/event/rabbitmq/rabbitmq.router'; +import { SqsRouter } from '@api/integrations/event/sqs/sqs.router'; +import { WebhookRouter } from '@api/integrations/event/webhook/webhook.router'; +import { WebsocketRouter } from '@api/integrations/event/websocket/websocket.router'; +import { Router } from 'express'; + +export class EventRouter { + public readonly router: Router; + + constructor(configService: any, ...guards: any[]) { + this.router = Router(); + + this.router.use('/webhook', new WebhookRouter(configService, ...guards).router); + this.router.use('/websocket', new WebsocketRouter(...guards).router); + this.router.use('/rabbitmq', new RabbitmqRouter(...guards).router); + this.router.use('/nats', new NatsRouter(...guards).router); + this.router.use('/pusher', new PusherRouter(...guards).router); + this.router.use('/sqs', new SqsRouter(...guards).router); + } +} +``` + +## Event Validation Schema + +### Event Configuration Validation +```typescript +import Joi from 'joi'; +import { EventController } from '@api/integrations/event/event.controller'; + +const eventListSchema = Joi.array().items( + Joi.string().valid(...EventController.events) +).optional(); + +export const webhookSchema = Joi.object({ + enabled: Joi.boolean().required(), + url: Joi.string().when('enabled', { + is: true, + then: Joi.required().uri({ scheme: ['http', 'https'] }), + otherwise: Joi.optional(), + }), + events: eventListSchema, + headers: Joi.object().pattern(Joi.string(), Joi.string()).optional(), + byEvents: Joi.boolean().optional().default(false), + base64: Joi.boolean().optional().default(false), +}).required(); + +export const websocketSchema = Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, +}).required(); + +export const rabbitmqSchema = Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, + exchange: Joi.string().optional().default('evolution-events'), +}).required(); + +export const sqsSchema = Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, + queueUrl: Joi.string().when('enabled', { + is: true, + then: Joi.required().uri(), + otherwise: Joi.optional(), + }), +}).required(); + +export const eventSchema = Joi.object({ + webhook: webhookSchema.optional(), + websocket: websocketSchema.optional(), + rabbitmq: rabbitmqSchema.optional(), + sqs: sqsSchema.optional(), + nats: Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, + subject: Joi.string().optional().default('evolution.events'), + }).optional(), + pusher: Joi.object({ + enabled: Joi.boolean().required(), + appId: Joi.string().when('enabled', { is: true, then: Joi.required() }), + key: Joi.string().when('enabled', { is: true, then: Joi.required() }), + secret: Joi.string().when('enabled', { is: true, then: Joi.required() }), + cluster: Joi.string().when('enabled', { is: true, then: Joi.required() }), + useTLS: Joi.boolean().optional().default(true), + events: eventListSchema, + }).optional(), +}).min(1).required(); +``` + +## Event Testing Pattern + +### Event Controller Testing +```typescript +describe('WebhookController', () => { + let controller: WebhookController; + let prismaRepository: jest.Mocked; + let configService: jest.Mocked; + + beforeEach(() => { + controller = new WebhookController(prismaRepository, configService); + }); + + describe('emit', () => { + it('should send webhook when enabled', async () => { + const mockInstance = { + webhook: { + enabled: true, + url: 'https://example.com/webhook', + events: ['MESSAGES_UPSERT'], + }, + }; + + prismaRepository.instance.findUnique.mockResolvedValue(mockInstance); + jest.spyOn(axios, 'post').mockResolvedValue({ status: 200 }); + + const eventData = { + instanceName: 'test-instance', + event: 'MESSAGES_UPSERT', + data: { message: 'test' }, + origin: 'test', + serverUrl: 'http://localhost', + dateTime: new Date().toISOString(), + sender: 'test', + }; + + await controller.emit(eventData); + + expect(axios.post).toHaveBeenCalledWith( + 'https://example.com/webhook', + expect.objectContaining({ + event: 'MESSAGES_UPSERT', + instance: 'test-instance', + }), + expect.objectContaining({ + headers: expect.objectContaining({ + 'Content-Type': 'application/json', + }), + }) + ); + }); + }); +}); +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-storage-rules.mdc b/.cursor/rules/specialized-rules/integration-storage-rules.mdc new file mode 100644 index 00000000..6456f5a4 --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-storage-rules.mdc @@ -0,0 +1,608 @@ +--- +description: Storage integration patterns for Evolution API +globs: + - "src/api/integrations/storage/**/*.ts" +alwaysApply: false +--- + +# Evolution API Storage Integration Rules + +## Storage Service Pattern + +### Base Storage Service Structure +```typescript +import { InstanceDto } from '@api/dto/instance.dto'; +import { PrismaRepository } from '@api/repository/repository.service'; +import { Logger } from '@config/logger.config'; +import { BadRequestException } from '@exceptions'; + +export class StorageService { + constructor(private readonly prismaRepository: PrismaRepository) {} + + private readonly logger = new Logger('StorageService'); + + public async getMedia(instance: InstanceDto, query?: MediaDto) { + try { + const where: any = { + instanceId: instance.instanceId, + ...query, + }; + + const media = await this.prismaRepository.media.findMany({ + where, + select: { + id: true, + fileName: true, + type: true, + mimetype: true, + createdAt: true, + Message: true, + }, + }); + + if (!media || media.length === 0) { + throw 'Media not found'; + } + + return media; + } catch (error) { + throw new BadRequestException(error); + } + } + + public async getMediaUrl(instance: InstanceDto, data: MediaDto) { + const media = (await this.getMedia(instance, { id: data.id }))[0]; + const mediaUrl = await this.generateUrl(media.fileName, data.expiry); + return { + mediaUrl, + ...media, + }; + } + + protected abstract generateUrl(fileName: string, expiry?: number): Promise; +} +``` + +## S3/MinIO Integration Pattern + +### MinIO Client Setup +```typescript +import { ConfigService, S3 } from '@config/env.config'; +import { Logger } from '@config/logger.config'; +import { BadRequestException } from '@exceptions'; +import * as MinIo from 'minio'; +import { join } from 'path'; +import { Readable, Transform } from 'stream'; + +const logger = new Logger('S3 Service'); +const BUCKET = new ConfigService().get('S3'); + +interface Metadata extends MinIo.ItemBucketMetadata { + instanceId: string; + messageId?: string; +} + +const minioClient = (() => { + if (BUCKET?.ENABLE) { + return new MinIo.Client({ + endPoint: BUCKET.ENDPOINT, + port: BUCKET.PORT, + useSSL: BUCKET.USE_SSL, + accessKey: BUCKET.ACCESS_KEY, + secretKey: BUCKET.SECRET_KEY, + region: BUCKET.REGION, + }); + } +})(); + +const bucketName = process.env.S3_BUCKET; +``` + +### Bucket Management Functions +```typescript +const bucketExists = async (): Promise => { + if (minioClient) { + try { + const list = await minioClient.listBuckets(); + return !!list.find((bucket) => bucket.name === bucketName); + } catch (error) { + logger.error('Error checking bucket existence:', error); + return false; + } + } + return false; +}; + +const setBucketPolicy = async (): Promise => { + if (minioClient && bucketName) { + try { + const policy = { + Version: '2012-10-17', + Statement: [ + { + Effect: 'Allow', + Principal: { AWS: ['*'] }, + Action: ['s3:GetObject'], + Resource: [`arn:aws:s3:::${bucketName}/*`], + }, + ], + }; + + await minioClient.setBucketPolicy(bucketName, JSON.stringify(policy)); + logger.log('Bucket policy set successfully'); + } catch (error) { + logger.error('Error setting bucket policy:', error); + } + } +}; + +const createBucket = async (): Promise => { + if (minioClient && bucketName) { + try { + const exists = await bucketExists(); + if (!exists) { + await minioClient.makeBucket(bucketName, BUCKET.REGION || 'us-east-1'); + await setBucketPolicy(); + logger.log(`Bucket ${bucketName} created successfully`); + } + } catch (error) { + logger.error('Error creating bucket:', error); + } + } +}; +``` + +### File Upload Functions +```typescript +export const uploadFile = async ( + fileName: string, + buffer: Buffer, + mimetype: string, + metadata?: Metadata, +): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + await createBucket(); + + const uploadMetadata = { + 'Content-Type': mimetype, + ...metadata, + }; + + await minioClient.putObject(bucketName, fileName, buffer, buffer.length, uploadMetadata); + + logger.log(`File ${fileName} uploaded successfully`); + return fileName; + } catch (error) { + logger.error(`Error uploading file ${fileName}:`, error); + throw new BadRequestException(`Failed to upload file: ${error.message}`); + } +}; + +export const uploadStream = async ( + fileName: string, + stream: Readable, + size: number, + mimetype: string, + metadata?: Metadata, +): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + await createBucket(); + + const uploadMetadata = { + 'Content-Type': mimetype, + ...metadata, + }; + + await minioClient.putObject(bucketName, fileName, stream, size, uploadMetadata); + + logger.log(`Stream ${fileName} uploaded successfully`); + return fileName; + } catch (error) { + logger.error(`Error uploading stream ${fileName}:`, error); + throw new BadRequestException(`Failed to upload stream: ${error.message}`); + } +}; +``` + +### File Download Functions +```typescript +export const getObject = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const stream = await minioClient.getObject(bucketName, fileName); + const chunks: Buffer[] = []; + + return new Promise((resolve, reject) => { + stream.on('data', (chunk) => chunks.push(chunk)); + stream.on('end', () => resolve(Buffer.concat(chunks))); + stream.on('error', reject); + }); + } catch (error) { + logger.error(`Error getting object ${fileName}:`, error); + throw new BadRequestException(`Failed to get object: ${error.message}`); + } +}; + +export const getObjectUrl = async (fileName: string, expiry: number = 3600): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const url = await minioClient.presignedGetObject(bucketName, fileName, expiry); + logger.log(`Generated URL for ${fileName} with expiry ${expiry}s`); + return url; + } catch (error) { + logger.error(`Error generating URL for ${fileName}:`, error); + throw new BadRequestException(`Failed to generate URL: ${error.message}`); + } +}; + +export const getObjectStream = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const stream = await minioClient.getObject(bucketName, fileName); + return stream; + } catch (error) { + logger.error(`Error getting object stream ${fileName}:`, error); + throw new BadRequestException(`Failed to get object stream: ${error.message}`); + } +}; +``` + +### File Management Functions +```typescript +export const deleteObject = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + await minioClient.removeObject(bucketName, fileName); + logger.log(`File ${fileName} deleted successfully`); + } catch (error) { + logger.error(`Error deleting file ${fileName}:`, error); + throw new BadRequestException(`Failed to delete file: ${error.message}`); + } +}; + +export const listObjects = async (prefix?: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const objects: MinIo.BucketItem[] = []; + const stream = minioClient.listObjects(bucketName, prefix, true); + + return new Promise((resolve, reject) => { + stream.on('data', (obj) => objects.push(obj)); + stream.on('end', () => resolve(objects)); + stream.on('error', reject); + }); + } catch (error) { + logger.error('Error listing objects:', error); + throw new BadRequestException(`Failed to list objects: ${error.message}`); + } +}; + +export const objectExists = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + return false; + } + + try { + await minioClient.statObject(bucketName, fileName); + return true; + } catch (error) { + return false; + } +}; +``` + +## Storage Controller Pattern + +### S3 Controller Implementation +```typescript +import { InstanceDto } from '@api/dto/instance.dto'; +import { MediaDto } from '@api/integrations/storage/s3/dto/media.dto'; +import { S3Service } from '@api/integrations/storage/s3/services/s3.service'; + +export class S3Controller { + constructor(private readonly s3Service: S3Service) {} + + public async getMedia(instance: InstanceDto, data: MediaDto) { + return this.s3Service.getMedia(instance, data); + } + + public async getMediaUrl(instance: InstanceDto, data: MediaDto) { + return this.s3Service.getMediaUrl(instance, data); + } + + public async uploadMedia(instance: InstanceDto, data: UploadMediaDto) { + return this.s3Service.uploadMedia(instance, data); + } + + public async deleteMedia(instance: InstanceDto, data: MediaDto) { + return this.s3Service.deleteMedia(instance, data); + } +} +``` + +## Storage Router Pattern + +### Storage Router Structure +```typescript +import { S3Router } from '@api/integrations/storage/s3/routes/s3.router'; +import { Router } from 'express'; + +export class StorageRouter { + public readonly router: Router; + + constructor(...guards: any[]) { + this.router = Router(); + + this.router.use('/s3', new S3Router(...guards).router); + // Add other storage providers here + // this.router.use('/gcs', new GCSRouter(...guards).router); + // this.router.use('/azure', new AzureRouter(...guards).router); + } +} +``` + +### S3 Specific Router +```typescript +import { RouterBroker } from '@api/abstract/abstract.router'; +import { MediaDto } from '@api/integrations/storage/s3/dto/media.dto'; +import { s3Schema, s3UrlSchema } from '@api/integrations/storage/s3/validate/s3.schema'; +import { HttpStatus } from '@api/routes/index.router'; +import { s3Controller } from '@api/server.module'; +import { RequestHandler, Router } from 'express'; + +export class S3Router extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('getMedia'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: s3Schema, + ClassRef: MediaDto, + execute: (instance, data) => s3Controller.getMedia(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('getMediaUrl'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: s3UrlSchema, + ClassRef: MediaDto, + execute: (instance, data) => s3Controller.getMediaUrl(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('uploadMedia'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: uploadSchema, + ClassRef: UploadMediaDto, + execute: (instance, data) => s3Controller.uploadMedia(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .delete(this.routerPath('deleteMedia'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: s3Schema, + ClassRef: MediaDto, + execute: (instance, data) => s3Controller.deleteMedia(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router: Router = Router(); +} +``` + +## Storage DTO Pattern + +### Media DTO +```typescript +export class MediaDto { + id?: string; + fileName?: string; + type?: string; + mimetype?: string; + expiry?: number; +} + +export class UploadMediaDto { + fileName: string; + mimetype: string; + buffer?: Buffer; + base64?: string; + url?: string; + metadata?: { + instanceId: string; + messageId?: string; + contactId?: string; + [key: string]: any; + }; +} +``` + +## Storage Validation Schema + +### S3 Validation Schemas +```typescript +import Joi from 'joi'; + +export const s3Schema = Joi.object({ + id: Joi.string().optional(), + fileName: Joi.string().optional(), + type: Joi.string().optional().valid('image', 'video', 'audio', 'document'), + mimetype: Joi.string().optional(), + expiry: Joi.number().optional().min(60).max(604800).default(3600), // 1 min to 7 days +}).min(1).required(); + +export const s3UrlSchema = Joi.object({ + id: Joi.string().required(), + expiry: Joi.number().optional().min(60).max(604800).default(3600), +}).required(); + +export const uploadSchema = Joi.object({ + fileName: Joi.string().required().max(255), + mimetype: Joi.string().required(), + buffer: Joi.binary().optional(), + base64: Joi.string().base64().optional(), + url: Joi.string().uri().optional(), + metadata: Joi.object({ + instanceId: Joi.string().required(), + messageId: Joi.string().optional(), + contactId: Joi.string().optional(), + }).optional(), +}).xor('buffer', 'base64', 'url').required(); // Exactly one of these must be present +``` + +## Error Handling in Storage + +### Storage-Specific Error Handling +```typescript +// CORRECT - Storage-specific error handling +public async uploadFile(fileName: string, buffer: Buffer): Promise { + try { + const result = await this.storageClient.upload(fileName, buffer); + return result; + } catch (error) { + this.logger.error(`Storage upload failed: ${error.message}`); + + if (error.code === 'NoSuchBucket') { + throw new BadRequestException('Storage bucket not found'); + } + + if (error.code === 'AccessDenied') { + throw new UnauthorizedException('Storage access denied'); + } + + if (error.code === 'EntityTooLarge') { + throw new BadRequestException('File too large'); + } + + throw new InternalServerErrorException('Storage operation failed'); + } +} +``` + +## Storage Configuration Pattern + +### Environment Configuration +```typescript +export interface S3Config { + ENABLE: boolean; + ENDPOINT: string; + PORT: number; + USE_SSL: boolean; + ACCESS_KEY: string; + SECRET_KEY: string; + REGION: string; + BUCKET: string; +} + +// Usage in service +const s3Config = this.configService.get('S3'); +if (!s3Config.ENABLE) { + throw new BadRequestException('S3 storage is disabled'); +} +``` + +## Storage Testing Pattern + +### Storage Service Testing +```typescript +describe('S3Service', () => { + let service: S3Service; + let prismaRepository: jest.Mocked; + + beforeEach(() => { + service = new S3Service(prismaRepository); + }); + + describe('getMedia', () => { + it('should return media list', async () => { + const instance = { instanceId: 'test-instance' }; + const mockMedia = [ + { id: '1', fileName: 'test.jpg', type: 'image', mimetype: 'image/jpeg' }, + ]; + + prismaRepository.media.findMany.mockResolvedValue(mockMedia); + + const result = await service.getMedia(instance); + + expect(result).toEqual(mockMedia); + expect(prismaRepository.media.findMany).toHaveBeenCalledWith({ + where: { instanceId: 'test-instance' }, + select: expect.objectContaining({ + id: true, + fileName: true, + type: true, + mimetype: true, + }), + }); + }); + + it('should throw error when no media found', async () => { + const instance = { instanceId: 'test-instance' }; + prismaRepository.media.findMany.mockResolvedValue([]); + + await expect(service.getMedia(instance)).rejects.toThrow(BadRequestException); + }); + }); +}); +``` + +## Storage Performance Considerations + +### Efficient File Handling +```typescript +// CORRECT - Stream-based upload for large files +public async uploadLargeFile(fileName: string, stream: Readable, size: number): Promise { + const uploadStream = new Transform({ + transform(chunk, encoding, callback) { + // Optional: Add compression, encryption, etc. + callback(null, chunk); + }, + }); + + return new Promise((resolve, reject) => { + stream + .pipe(uploadStream) + .on('error', reject) + .on('finish', () => resolve(fileName)); + }); +} + +// INCORRECT - Loading entire file into memory +public async uploadLargeFile(fileName: string, filePath: string): Promise { + const buffer = fs.readFileSync(filePath); // ❌ Memory intensive for large files + return await this.uploadFile(fileName, buffer); +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/route-rules.mdc b/.cursor/rules/specialized-rules/route-rules.mdc new file mode 100644 index 00000000..7be40849 --- /dev/null +++ b/.cursor/rules/specialized-rules/route-rules.mdc @@ -0,0 +1,416 @@ +--- +description: Router patterns for Evolution API +globs: + - "src/api/routes/**/*.ts" +alwaysApply: false +--- + +# Evolution API Route Rules + +## Router Base Pattern + +### RouterBroker Extension +```typescript +import { RouterBroker } from '@api/abstract/abstract.router'; +import { RequestHandler, Router } from 'express'; +import { HttpStatus } from './index.router'; + +export class ExampleRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .get(this.routerPath('findExample'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: null, + ClassRef: ExampleDto, + execute: (instance) => exampleController.find(instance), + }); + + return res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('createExample'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: exampleSchema, + ClassRef: ExampleDto, + execute: (instance, data) => exampleController.create(instance, data), + }); + + return res.status(HttpStatus.CREATED).json(response); + }); + } + + public readonly router: Router = Router(); +} +``` + +## Main Router Pattern + +### Index Router Structure +```typescript +import { Router } from 'express'; +import { authGuard } from '@api/guards/auth.guard'; +import { instanceExistsGuard, instanceLoggedGuard } from '@api/guards/instance.guard'; +import Telemetry from '@api/guards/telemetry.guard'; + +enum HttpStatus { + OK = 200, + CREATED = 201, + NOT_FOUND = 404, + FORBIDDEN = 403, + BAD_REQUEST = 400, + UNAUTHORIZED = 401, + INTERNAL_SERVER_ERROR = 500, +} + +const router: Router = Router(); +const guards = [instanceExistsGuard, instanceLoggedGuard, authGuard['apikey']]; +const telemetry = new Telemetry(); + +router + .use((req, res, next) => telemetry.collectTelemetry(req, res, next)) + .get('/', async (req, res) => { + res.status(HttpStatus.OK).json({ + status: HttpStatus.OK, + message: 'Welcome to the Evolution API, it is working!', + version: packageJson.version, + clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME, + manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined, + documentation: `https://doc.evolution-api.com`, + whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'), + }); + }) + .use('/instance', new InstanceRouter(configService, ...guards).router) + .use('/message', new MessageRouter(...guards).router) + .use('/chat', new ChatRouter(...guards).router) + .use('/business', new BusinessRouter(...guards).router); + +export { HttpStatus, router }; +``` + +## Data Validation Pattern + +### RouterBroker dataValidate Usage +```typescript +// CORRECT - Standard validation pattern +.post(this.routerPath('createTemplate'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: templateSchema, + ClassRef: TemplateDto, + execute: (instance, data) => templateController.create(instance, data), + }); + + return res.status(HttpStatus.CREATED).json(response); +}) + +// CORRECT - No schema validation (for simple DTOs) +.get(this.routerPath('findTemplate'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: null, + ClassRef: InstanceDto, + execute: (instance) => templateController.find(instance), + }); + + return res.status(HttpStatus.OK).json(response); +}) +``` + +## Error Handling in Routes + +### Try-Catch Pattern +```typescript +// CORRECT - Error handling with utility function +.post(this.routerPath('getCatalog'), ...guards, async (req, res) => { + try { + const response = await this.dataValidate({ + request: req, + schema: catalogSchema, + ClassRef: NumberDto, + execute: (instance, data) => businessController.fetchCatalog(instance, data), + }); + + return res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Business catalog error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'business_catalog'); + return res.status(errorResponse.status).json(errorResponse); + } +}) + +// INCORRECT - Let RouterBroker handle errors (when possible) +.post(this.routerPath('simpleOperation'), ...guards, async (req, res) => { + try { + const response = await this.dataValidate({ + request: req, + schema: simpleSchema, + ClassRef: SimpleDto, + execute: (instance, data) => controller.simpleOperation(instance, data), + }); + + return res.status(HttpStatus.OK).json(response); + } catch (error) { + throw error; // ❌ Unnecessary - RouterBroker handles this + } +}) +``` + +## Route Path Pattern + +### routerPath Usage +```typescript +// CORRECT - Use routerPath for consistent naming +.get(this.routerPath('findLabels'), ...guards, async (req, res) => { + // Implementation +}) +.post(this.routerPath('handleLabel'), ...guards, async (req, res) => { + // Implementation +}) + +// INCORRECT - Hardcoded paths +.get('/labels', ...guards, async (req, res) => { // ❌ Use routerPath + // Implementation +}) +``` + +## Guard Application Pattern + +### Guards Usage +```typescript +// CORRECT - Apply guards to protected routes +export class ProtectedRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .get(this.routerPath('protectedAction'), ...guards, async (req, res) => { + // Protected action + }) + .post(this.routerPath('anotherAction'), ...guards, async (req, res) => { + // Another protected action + }); + } +} + +// CORRECT - No guards for public routes +export class PublicRouter extends RouterBroker { + constructor() { + super(); + this.router + .get('/health', async (req, res) => { + res.status(HttpStatus.OK).json({ status: 'healthy' }); + }) + .get('/version', async (req, res) => { + res.status(HttpStatus.OK).json({ version: packageJson.version }); + }); + } +} +``` + +## Static File Serving Pattern + +### Static Assets Route +```typescript +// CORRECT - Secure static file serving +router.get('/assets/*', (req, res) => { + const fileName = req.params[0]; + + // Security: Reject paths containing traversal patterns + if (!fileName || fileName.includes('..') || fileName.includes('\\') || path.isAbsolute(fileName)) { + return res.status(403).send('Forbidden'); + } + + const basePath = path.join(process.cwd(), 'manager', 'dist'); + const assetsPath = path.join(basePath, 'assets'); + const filePath = path.join(assetsPath, fileName); + + // Security: Ensure the resolved path is within the assets directory + const resolvedPath = path.resolve(filePath); + const resolvedAssetsPath = path.resolve(assetsPath); + + if (!resolvedPath.startsWith(resolvedAssetsPath + path.sep) && resolvedPath !== resolvedAssetsPath) { + return res.status(403).send('Forbidden'); + } + + if (fs.existsSync(resolvedPath)) { + res.set('Content-Type', mimeTypes.lookup(resolvedPath) || 'text/css'); + res.send(fs.readFileSync(resolvedPath)); + } else { + res.status(404).send('File not found'); + } +}); +``` + +## Special Route Patterns + +### Manager Route Pattern +```typescript +export class ViewsRouter extends RouterBroker { + public readonly router: Router; + + constructor() { + super(); + this.router = Router(); + + const basePath = path.join(process.cwd(), 'manager', 'dist'); + const indexPath = path.join(basePath, 'index.html'); + + this.router.use(express.static(basePath)); + + this.router.get('*', (req, res) => { + res.sendFile(indexPath); + }); + } +} +``` + +### Webhook Route Pattern +```typescript +// CORRECT - Webhook without guards +.post('/webhook/evolution', async (req, res) => { + const response = await evolutionController.receiveWebhook(req.body); + return res.status(HttpStatus.OK).json(response); +}) + +// CORRECT - Webhook with signature validation +.post('/webhook/meta', validateWebhookSignature, async (req, res) => { + const response = await metaController.receiveWebhook(req.body); + return res.status(HttpStatus.OK).json(response); +}) +``` + +## Response Pattern + +### Standard Response Format +```typescript +// CORRECT - Standard success response +return res.status(HttpStatus.OK).json(response); + +// CORRECT - Created response +return res.status(HttpStatus.CREATED).json(response); + +// CORRECT - Custom response with additional data +return res.status(HttpStatus.OK).json({ + ...response, + timestamp: new Date().toISOString(), + instanceName: req.params.instanceName, +}); +``` + +## Route Organization + +### File Structure +``` +src/api/routes/ +├── index.router.ts # Main router with all route registrations +├── instance.router.ts # Instance management routes +├── sendMessage.router.ts # Message sending routes +├── chat.router.ts # Chat operations routes +├── business.router.ts # Business API routes +├── group.router.ts # Group management routes +├── label.router.ts # Label management routes +├── proxy.router.ts # Proxy configuration routes +├── settings.router.ts # Instance settings routes +├── template.router.ts # Template management routes +├── call.router.ts # Call operations routes +└── view.router.ts # Frontend views routes +``` + +## Route Testing Pattern + +### Router Testing +```typescript +describe('ExampleRouter', () => { + let app: express.Application; + let router: ExampleRouter; + + beforeEach(() => { + app = express(); + router = new ExampleRouter(); + app.use('/api', router.router); + app.use(express.json()); + }); + + describe('GET /findExample', () => { + it('should return example data', async () => { + const response = await request(app) + .get('/api/findExample/test-instance') + .set('apikey', 'test-key') + .expect(200); + + expect(response.body).toBeDefined(); + expect(response.body.instanceName).toBe('test-instance'); + }); + + it('should return 401 without API key', async () => { + await request(app) + .get('/api/findExample/test-instance') + .expect(401); + }); + }); + + describe('POST /createExample', () => { + it('should create example successfully', async () => { + const data = { + name: 'Test Example', + description: 'Test Description', + }; + + const response = await request(app) + .post('/api/createExample/test-instance') + .set('apikey', 'test-key') + .send(data) + .expect(201); + + expect(response.body.name).toBe(data.name); + }); + + it('should validate required fields', async () => { + const data = { + description: 'Test Description', + // Missing required 'name' field + }; + + await request(app) + .post('/api/createExample/test-instance') + .set('apikey', 'test-key') + .send(data) + .expect(400); + }); + }); +}); +``` + +## Route Documentation + +### JSDoc for Routes +```typescript +/** + * @route GET /api/template/findTemplate/:instanceName + * @description Find template for instance + * @param {string} instanceName - Instance name + * @returns {TemplateDto} Template data + * @throws {404} Template not found + * @throws {401} Unauthorized + */ +.get(this.routerPath('findTemplate'), ...guards, async (req, res) => { + // Implementation +}) + +/** + * @route POST /api/template/createTemplate/:instanceName + * @description Create new template + * @param {string} instanceName - Instance name + * @body {TemplateDto} Template data + * @returns {TemplateDto} Created template + * @throws {400} Validation error + * @throws {401} Unauthorized + */ +.post(this.routerPath('createTemplate'), ...guards, async (req, res) => { + // Implementation +}) +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/service-rules.mdc b/.cursor/rules/specialized-rules/service-rules.mdc new file mode 100644 index 00000000..0f516c55 --- /dev/null +++ b/.cursor/rules/specialized-rules/service-rules.mdc @@ -0,0 +1,294 @@ +--- +description: Service layer patterns for Evolution API +globs: + - "src/api/services/**/*.ts" + - "src/api/integrations/**/services/*.ts" +alwaysApply: false +--- + +# Evolution API Service Rules + +## Service Structure Pattern + +### Standard Service Class +```typescript +export class ExampleService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger('ExampleService'); + + public async create(instance: InstanceDto, data: ExampleDto) { + await this.waMonitor.waInstances[instance.instanceName].setData(data); + return { example: { ...instance, data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + const result = await this.waMonitor.waInstances[instance.instanceName].findData(); + + if (Object.keys(result).length === 0) { + throw new Error('Data not found'); + } + + return result; + } catch (error) { + return null; // Evolution pattern - return null on error + } + } +} +``` + +## Dependency Injection Pattern + +### Constructor Pattern +```typescript +// CORRECT - Evolution API pattern +constructor( + private readonly waMonitor: WAMonitoringService, + private readonly prismaRepository: PrismaRepository, + private readonly configService: ConfigService, +) {} + +// INCORRECT - Don't use +constructor(waMonitor, prismaRepository, configService) {} // ❌ No types +``` + +## Logger Pattern + +### Standard Logger Usage +```typescript +// CORRECT - Evolution API pattern +private readonly logger = new Logger('ServiceName'); + +// Usage +this.logger.log('Operation started'); +this.logger.error('Operation failed', error); + +// INCORRECT +console.log('Operation started'); // ❌ Use Logger +``` + +## WAMonitor Integration Pattern + +### Instance Access Pattern +```typescript +// CORRECT - Standard pattern +public async operation(instance: InstanceDto, data: DataDto) { + await this.waMonitor.waInstances[instance.instanceName].performAction(data); + return { result: { ...instance, data } }; +} + +// Instance validation +const waInstance = this.waMonitor.waInstances[instance.instanceName]; +if (!waInstance) { + throw new NotFoundException('Instance not found'); +} +``` + +## Error Handling Pattern + +### Try-Catch Pattern +```typescript +// CORRECT - Evolution API pattern +public async find(instance: InstanceDto): Promise { + try { + const result = await this.waMonitor.waInstances[instance.instanceName].findData(); + + if (Object.keys(result).length === 0) { + throw new Error('Data not found'); + } + + return result; + } catch (error) { + this.logger.error('Find operation failed', error); + return null; // Return null on error (Evolution pattern) + } +} +``` + +## Cache Integration Pattern + +### Cache Service Usage +```typescript +export class CacheAwareService { + constructor( + private readonly cache: CacheService, + private readonly chatwootCache: CacheService, + private readonly baileysCache: CacheService, + ) {} + + public async getCachedData(key: string): Promise { + const cached = await this.cache.get(key); + if (cached) return cached; + + const data = await this.fetchFromSource(key); + await this.cache.set(key, data, 300); // 5 min TTL + return data; + } +} +``` + +## Integration Service Patterns + +### Chatbot Service Base Pattern +```typescript +export class ChatbotService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(waMonitor, prismaRepository, 'ChatbotService', configService); + } + + protected async processBot( + waInstance: any, + remoteJid: string, + bot: BotType, + session: any, + settings: any, + content: string, + ): Promise { + // Implementation + } +} +``` + +### Channel Service Pattern +```typescript +export class ChannelService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + baileysCache: CacheService, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache, baileysCache); + } + + public readonly logger = new Logger('ChannelService'); + public client: WASocket; + public readonly instance: wa.Instance = {}; +} +``` + +## Service Initialization Pattern + +### Service Registration +```typescript +// In server.module.ts pattern +export const templateService = new TemplateService( + waMonitor, + prismaRepository, + configService, +); + +export const settingsService = new SettingsService(waMonitor); +``` + +## Async Operation Patterns + +### Promise Handling +```typescript +// CORRECT - Evolution API pattern +public async sendMessage(instance: InstanceDto, data: MessageDto) { + const waInstance = this.waMonitor.waInstances[instance.instanceName]; + return await waInstance.sendMessage(data); +} + +// INCORRECT - Don't use .then() +public sendMessage(instance: InstanceDto, data: MessageDto) { + return this.waMonitor.waInstances[instance.instanceName] + .sendMessage(data) + .then(result => result); // ❌ Use async/await +} +``` + +## Configuration Access Pattern + +### Config Service Usage +```typescript +// CORRECT - Evolution API pattern +const serverConfig = this.configService.get('SERVER'); +const authConfig = this.configService.get('AUTHENTICATION'); +const dbConfig = this.configService.get('DATABASE'); + +// Type-safe configuration access +if (this.configService.get('CHATWOOT').ENABLED) { + // Chatwoot logic +} +``` + +## Event Emission Pattern + +### EventEmitter2 Usage +```typescript +// CORRECT - Evolution API pattern +this.eventEmitter.emit(Events.INSTANCE_CREATE, { + instanceName: instance.name, + status: 'created', +}); + +// Chatwoot event pattern +if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { + this.chatwootService.eventWhatsapp( + Events.STATUS_INSTANCE, + { instanceName: this.instance.name }, + { + instance: this.instance.name, + status: 'created', + }, + ); +} +``` + +## Service Method Naming + +### Standard Method Names +- `create()` - Create new resource +- `find()` - Find single resource +- `findAll()` - Find multiple resources +- `update()` - Update resource +- `delete()` - Delete resource +- `fetch*()` - Fetch from external API +- `send*()` - Send data/messages +- `process*()` - Process data + +## Service Testing Pattern + +### Unit Test Structure +```typescript +describe('ExampleService', () => { + let service: ExampleService; + let waMonitor: jest.Mocked; + let prismaRepository: jest.Mocked; + + beforeEach(() => { + const mockWaMonitor = { + waInstances: { + 'test-instance': { + performAction: jest.fn(), + }, + }, + }; + + service = new ExampleService( + mockWaMonitor as any, + prismaRepository, + configService, + ); + }); + + it('should perform action successfully', async () => { + const instance = { instanceName: 'test-instance' }; + const data = { test: 'data' }; + + const result = await service.create(instance, data); + + expect(result).toBeDefined(); + expect(waMonitor.waInstances['test-instance'].performAction).toHaveBeenCalledWith(data); + }); +}); +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/type-rules.mdc b/.cursor/rules/specialized-rules/type-rules.mdc new file mode 100644 index 00000000..cf740067 --- /dev/null +++ b/.cursor/rules/specialized-rules/type-rules.mdc @@ -0,0 +1,490 @@ +--- +description: Type definitions and interfaces for Evolution API +globs: + - "src/api/types/**/*.ts" + - "src/@types/**/*.ts" +alwaysApply: false +--- + +# Evolution API Type Rules + +## Namespace Pattern + +### WhatsApp Types Namespace +```typescript +/* eslint-disable @typescript-eslint/no-namespace */ +import { JsonValue } from '@prisma/client/runtime/library'; +import { AuthenticationState, WAConnectionState } from 'baileys'; + +export declare namespace wa { + export type QrCode = { + count?: number; + pairingCode?: string; + base64?: string; + code?: string; + }; + + export type Instance = { + id?: string; + qrcode?: QrCode; + pairingCode?: string; + authState?: { state: AuthenticationState; saveCreds: () => void }; + name?: string; + wuid?: string; + profileName?: string; + profilePictureUrl?: string; + token?: string; + number?: string; + integration?: string; + businessId?: string; + }; + + export type LocalChatwoot = { + enabled?: boolean; + accountId?: string; + token?: string; + url?: string; + nameInbox?: string; + mergeBrazilContacts?: boolean; + importContacts?: boolean; + importMessages?: boolean; + daysLimitImportMessages?: number; + organization?: string; + logo?: string; + }; + + export type LocalProxy = { + enabled?: boolean; + host?: string; + port?: string; + protocol?: string; + username?: string; + password?: string; + }; + + export type LocalSettings = { + rejectCall?: boolean; + msgCall?: string; + groupsIgnore?: boolean; + alwaysOnline?: boolean; + readMessages?: boolean; + readStatus?: boolean; + syncFullHistory?: boolean; + }; + + export type LocalWebHook = { + enabled?: boolean; + url?: string; + events?: string[]; + headers?: JsonValue; + byEvents?: boolean; + base64?: boolean; + }; + + export type StatusMessage = 'ERROR' | 'PENDING' | 'SERVER_ACK' | 'DELIVERY_ACK' | 'READ' | 'DELETED' | 'PLAYED'; +} +``` + +## Enum Definitions + +### Events Enum +```typescript +export enum Events { + APPLICATION_STARTUP = 'application.startup', + INSTANCE_CREATE = 'instance.create', + INSTANCE_DELETE = 'instance.delete', + QRCODE_UPDATED = 'qrcode.updated', + CONNECTION_UPDATE = 'connection.update', + STATUS_INSTANCE = 'status.instance', + MESSAGES_SET = 'messages.set', + MESSAGES_UPSERT = 'messages.upsert', + MESSAGES_EDITED = 'messages.edited', + MESSAGES_UPDATE = 'messages.update', + MESSAGES_DELETE = 'messages.delete', + SEND_MESSAGE = 'send.message', + SEND_MESSAGE_UPDATE = 'send.message.update', + CONTACTS_SET = 'contacts.set', + CONTACTS_UPSERT = 'contacts.upsert', + CONTACTS_UPDATE = 'contacts.update', + PRESENCE_UPDATE = 'presence.update', + CHATS_SET = 'chats.set', + CHATS_UPDATE = 'chats.update', + CHATS_UPSERT = 'chats.upsert', + CHATS_DELETE = 'chats.delete', + GROUPS_UPSERT = 'groups.upsert', + GROUPS_UPDATE = 'groups.update', + GROUP_PARTICIPANTS_UPDATE = 'group-participants.update', + CALL = 'call', + TYPEBOT_START = 'typebot.start', + TYPEBOT_CHANGE_STATUS = 'typebot.change-status', + LABELS_EDIT = 'labels.edit', + LABELS_ASSOCIATION = 'labels.association', + CREDS_UPDATE = 'creds.update', + MESSAGING_HISTORY_SET = 'messaging-history.set', + REMOVE_INSTANCE = 'remove.instance', + LOGOUT_INSTANCE = 'logout.instance', +} +``` + +### Integration Types +```typescript +export const Integration = { + WHATSAPP_BUSINESS: 'WHATSAPP-BUSINESS', + WHATSAPP_BAILEYS: 'WHATSAPP-BAILEYS', + EVOLUTION: 'EVOLUTION', +} as const; + +export type IntegrationType = typeof Integration[keyof typeof Integration]; +``` + +## Constant Arrays + +### Message Type Constants +```typescript +export const TypeMediaMessage = [ + 'imageMessage', + 'documentMessage', + 'audioMessage', + 'videoMessage', + 'stickerMessage', + 'ptvMessage', // Evolution API includes this +]; + +export const MessageSubtype = [ + 'ephemeralMessage', + 'documentWithCaptionMessage', + 'viewOnceMessage', + 'viewOnceMessageV2', +]; + +export type MediaMessageType = typeof TypeMediaMessage[number]; +export type MessageSubtypeType = typeof MessageSubtype[number]; +``` + +## Interface Definitions + +### Service Interfaces +```typescript +export interface ServiceInterface { + create(instance: InstanceDto, data: any): Promise; + find(instance: InstanceDto): Promise; + update?(instance: InstanceDto, data: any): Promise; + delete?(instance: InstanceDto): Promise; +} + +export interface ChannelServiceInterface extends ServiceInterface { + sendMessage(data: SendMessageDto): Promise; + connectToWhatsapp(data?: any): Promise; + receiveWebhook?(data: any): Promise; +} + +export interface ChatbotServiceInterface extends ServiceInterface { + processMessage( + instanceName: string, + remoteJid: string, + message: any, + pushName?: string, + ): Promise; +} +``` + +## Configuration Types + +### Environment Configuration Types +```typescript +export interface DatabaseConfig { + CONNECTION: { + URI: string; + DB_PREFIX_NAME: string; + CLIENT_NAME?: string; + }; + ENABLED: boolean; + SAVE_DATA: { + INSTANCE: boolean; + NEW_MESSAGE: boolean; + MESSAGE_UPDATE: boolean; + CONTACTS: boolean; + CHATS: boolean; + }; +} + +export interface AuthConfig { + TYPE: 'apikey' | 'jwt'; + API_KEY: { + KEY: string; + }; + JWT?: { + EXPIRIN_IN: number; + SECRET: string; + }; +} + +export interface CacheConfig { + REDIS: { + ENABLED: boolean; + URI: string; + PREFIX_KEY: string; + SAVE_INSTANCES: boolean; + }; + LOCAL: { + ENABLED: boolean; + TTL: number; + }; +} +``` + +## Message Types + +### Message Structure Types +```typescript +export interface MessageContent { + text?: string; + caption?: string; + media?: Buffer | string; + mediatype?: 'image' | 'video' | 'audio' | 'document' | 'sticker'; + fileName?: string; + mimetype?: string; +} + +export interface MessageOptions { + delay?: number; + presence?: 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'; + linkPreview?: boolean; + mentionsEveryOne?: boolean; + mentioned?: string[]; + quoted?: { + key: { + remoteJid: string; + fromMe: boolean; + id: string; + }; + message: any; + }; +} + +export interface SendMessageRequest { + number: string; + content: MessageContent; + options?: MessageOptions; +} +``` + +## Webhook Types + +### Webhook Payload Types +```typescript +export interface WebhookPayload { + event: Events; + instance: string; + data: any; + timestamp: string; + server?: { + version: string; + host: string; + }; +} + +export interface WebhookConfig { + enabled: boolean; + url: string; + events: Events[]; + headers?: Record; + byEvents?: boolean; + base64?: boolean; +} +``` + +## Error Types + +### Custom Error Types +```typescript +export interface ApiError { + status: number; + message: string; + error?: string; + details?: any; + timestamp: string; + path: string; +} + +export interface ValidationError extends ApiError { + status: 400; + validationErrors: Array<{ + field: string; + message: string; + value?: any; + }>; +} + +export interface AuthenticationError extends ApiError { + status: 401; + message: 'Unauthorized' | 'Invalid API Key' | 'Token Expired'; +} +``` + +## Utility Types + +### Generic Utility Types +```typescript +export type Optional = Omit & Partial>; + +export type RequiredFields = T & Required>; + +export type DeepPartial = { + [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; +}; + +export type NonEmptyArray = [T, ...T[]]; + +export type StringKeys = { + [K in keyof T]: T[K] extends string ? K : never; +}[keyof T]; +``` + +## Response Types + +### API Response Types +```typescript +export interface ApiResponse { + success: boolean; + data?: T; + message?: string; + error?: string; + timestamp: string; +} + +export interface PaginatedResponse extends ApiResponse { + pagination: { + page: number; + limit: number; + total: number; + totalPages: number; + hasNext: boolean; + hasPrev: boolean; + }; +} + +export interface InstanceResponse extends ApiResponse { + instance: { + instanceName: string; + status: 'connecting' | 'open' | 'close' | 'qr'; + qrcode?: string; + profileName?: string; + profilePicUrl?: string; + }; +} +``` + +## Integration-Specific Types + +### Baileys Types Extension +```typescript +import { WASocket, ConnectionState, DisconnectReason } from 'baileys'; + +export interface BaileysInstance { + client: WASocket; + state: ConnectionState; + qrRetry: number; + authPath: string; +} + +export interface BaileysConfig { + qrTimeout: number; + maxQrRetries: number; + authTimeout: number; + reconnectInterval: number; +} +``` + +### Business API Types +```typescript +export interface BusinessApiConfig { + version: string; + baseUrl: string; + timeout: number; + retries: number; +} + +export interface BusinessApiMessage { + messaging_product: 'whatsapp'; + to: string; + type: 'text' | 'image' | 'document' | 'audio' | 'video' | 'template'; + text?: { + body: string; + preview_url?: boolean; + }; + image?: { + link?: string; + id?: string; + caption?: string; + }; + template?: { + name: string; + language: { + code: string; + }; + components?: any[]; + }; +} +``` + +## Type Guards + +### Type Guard Functions +```typescript +export function isMediaMessage(message: any): message is MediaMessage { + return message && TypeMediaMessage.some(type => message[type]); +} + +export function isTextMessage(message: any): message is TextMessage { + return message && message.conversation; +} + +export function isValidIntegration(integration: string): integration is IntegrationType { + return Object.values(Integration).includes(integration as IntegrationType); +} + +export function isValidEvent(event: string): event is Events { + return Object.values(Events).includes(event as Events); +} +``` + +## Module Augmentation + +### Express Request Extension +```typescript +declare global { + namespace Express { + interface Request { + instanceName?: string; + instanceData?: InstanceDto; + user?: { + id: string; + apiKey: string; + }; + } + } +} +``` + +## Type Documentation + +### JSDoc Type Documentation +```typescript +/** + * WhatsApp instance configuration + * @interface InstanceConfig + * @property {string} name - Unique instance name + * @property {IntegrationType} integration - Integration type + * @property {string} [token] - API token for business integrations + * @property {WebhookConfig} [webhook] - Webhook configuration + * @property {ProxyConfig} [proxy] - Proxy configuration + */ +export interface InstanceConfig { + name: string; + integration: IntegrationType; + token?: string; + webhook?: WebhookConfig; + proxy?: ProxyConfig; +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/util-rules.mdc b/.cursor/rules/specialized-rules/util-rules.mdc new file mode 100644 index 00000000..6bcf7dd1 --- /dev/null +++ b/.cursor/rules/specialized-rules/util-rules.mdc @@ -0,0 +1,653 @@ +--- +description: Utility functions and helpers for Evolution API +globs: + - "src/utils/**/*.ts" +alwaysApply: false +--- + +# Evolution API Utility Rules + +## Utility Function Structure + +### Standard Utility Pattern +```typescript +import { Logger } from '@config/logger.config'; + +const logger = new Logger('UtilityName'); + +export function utilityFunction(param: ParamType): ReturnType { + try { + // Utility logic + return result; + } catch (error) { + logger.error(`Utility function failed: ${error.message}`); + throw error; + } +} + +export default utilityFunction; +``` + +## Authentication Utilities + +### Multi-File Auth State Pattern +```typescript +import { AuthenticationState } from 'baileys'; +import { CacheService } from '@api/services/cache.service'; +import fs from 'fs/promises'; +import path from 'path'; + +export default async function useMultiFileAuthStatePrisma( + sessionId: string, + cache: CacheService, +): Promise<{ + state: AuthenticationState; + saveCreds: () => Promise; +}> { + const localFolder = path.join(INSTANCE_DIR, sessionId); + const localFile = (key: string) => path.join(localFolder, fixFileName(key) + '.json'); + await fs.mkdir(localFolder, { recursive: true }); + + async function writeData(data: any, key: string): Promise { + const dataString = JSON.stringify(data, BufferJSON.replacer); + + if (key !== 'creds') { + if (process.env.CACHE_REDIS_ENABLED === 'true') { + return await cache.hSet(sessionId, key, data); + } else { + await fs.writeFile(localFile(key), dataString); + return; + } + } + await saveKey(sessionId, dataString); + return; + } + + async function readData(key: string): Promise { + try { + let rawData; + + if (key !== 'creds') { + if (process.env.CACHE_REDIS_ENABLED === 'true') { + return await cache.hGet(sessionId, key); + } else { + if (!(await fileExists(localFile(key)))) return null; + rawData = await fs.readFile(localFile(key), { encoding: 'utf-8' }); + return JSON.parse(rawData, BufferJSON.reviver); + } + } else { + rawData = await getAuthKey(sessionId); + } + + const parsedData = JSON.parse(rawData, BufferJSON.reviver); + return parsedData; + } catch (error) { + return null; + } + } + + async function removeData(key: string): Promise { + try { + if (key !== 'creds') { + if (process.env.CACHE_REDIS_ENABLED === 'true') { + return await cache.hDelete(sessionId, key); + } else { + await fs.unlink(localFile(key)); + } + } else { + await deleteAuthKey(sessionId); + } + } catch (error) { + return; + } + } + + let creds = await readData('creds'); + if (!creds) { + creds = initAuthCreds(); + await writeData(creds, 'creds'); + } + + return { + state: { + creds, + keys: { + get: async (type, ids) => { + const data = {}; + await Promise.all( + ids.map(async (id) => { + let value = await readData(`${type}-${id}`); + if (type === 'app-state-sync-key' && value) { + value = proto.Message.AppStateSyncKeyData.fromObject(value); + } + data[id] = value; + }) + ); + return data; + }, + set: async (data) => { + const tasks = []; + for (const category in data) { + for (const id in data[category]) { + const value = data[category][id]; + const key = `${category}-${id}`; + tasks.push(value ? writeData(value, key) : removeData(key)); + } + } + await Promise.all(tasks); + }, + }, + }, + saveCreds: () => writeData(creds, 'creds'), + }; +} +``` + +## Message Processing Utilities + +### Message Content Extraction +```typescript +export const getConversationMessage = (msg: any): string => { + const types = getTypeMessage(msg); + const messageContent = getMessageContent(types); + return messageContent; +}; + +const getTypeMessage = (msg: any): any => { + return Object.keys(msg?.message || msg || {})[0]; +}; + +const getMessageContent = (type: string, msg?: any): string => { + const typeKey = type?.replace('Message', ''); + + const types = { + conversation: msg?.message?.conversation, + extendedTextMessage: msg?.message?.extendedTextMessage?.text, + imageMessage: msg?.message?.imageMessage?.caption || 'Image', + videoMessage: msg?.message?.videoMessage?.caption || 'Video', + audioMessage: 'Audio', + documentMessage: msg?.message?.documentMessage?.caption || 'Document', + stickerMessage: 'Sticker', + contactMessage: 'Contact', + locationMessage: 'Location', + liveLocationMessage: 'Live Location', + viewOnceMessage: 'View Once', + reactionMessage: 'Reaction', + pollCreationMessage: 'Poll', + pollUpdateMessage: 'Poll Update', + }; + + let result = types[typeKey] || types[type] || 'Unknown'; + + if (!result || result === 'Unknown') { + result = JSON.stringify(msg); + } + + return result; +}; +``` + +### JID Creation Utility +```typescript +export const createJid = (number: string): string => { + if (number.includes('@')) { + return number; + } + + // Remove any non-numeric characters except + + let cleanNumber = number.replace(/[^\d+]/g, ''); + + // Remove + if present + if (cleanNumber.startsWith('+')) { + cleanNumber = cleanNumber.substring(1); + } + + // Add country code if missing (assuming Brazil as default) + if (cleanNumber.length === 11 && cleanNumber.startsWith('11')) { + cleanNumber = '55' + cleanNumber; + } else if (cleanNumber.length === 10) { + cleanNumber = '5511' + cleanNumber; + } + + // Determine if it's a group or individual + const isGroup = cleanNumber.includes('-'); + const domain = isGroup ? 'g.us' : 's.whatsapp.net'; + + return `${cleanNumber}@${domain}`; +}; +``` + +## Cache Utilities + +### WhatsApp Number Cache +```typescript +interface ISaveOnWhatsappCacheParams { + remoteJid: string; + lid?: string; +} + +function getAvailableNumbers(remoteJid: string): string[] { + const numbersAvailable: string[] = []; + + if (remoteJid.startsWith('+')) { + remoteJid = remoteJid.slice(1); + } + + const [number, domain] = remoteJid.split('@'); + + // Brazilian numbers + if (remoteJid.startsWith('55')) { + const numberWithDigit = + number.slice(4, 5) === '9' && number.length === 13 ? number : `${number.slice(0, 4)}9${number.slice(4)}`; + const numberWithoutDigit = number.length === 12 ? number : number.slice(0, 4) + number.slice(5); + + numbersAvailable.push(numberWithDigit); + numbersAvailable.push(numberWithoutDigit); + } + // Mexican/Argentina numbers + else if (number.startsWith('52') || number.startsWith('54')) { + let prefix = ''; + if (number.startsWith('52')) { + prefix = '1'; + } + if (number.startsWith('54')) { + prefix = '9'; + } + + const numberWithDigit = + number.slice(2, 3) === prefix && number.length === 13 + ? number + : `${number.slice(0, 2)}${prefix}${number.slice(2)}`; + const numberWithoutDigit = number.length === 12 ? number : number.slice(0, 2) + number.slice(3); + + numbersAvailable.push(numberWithDigit); + numbersAvailable.push(numberWithoutDigit); + } + // Other countries + else { + numbersAvailable.push(remoteJid); + } + + return numbersAvailable.map((number) => `${number}@${domain}`); +} + +export async function saveOnWhatsappCache(params: ISaveOnWhatsappCacheParams): Promise { + const { remoteJid, lid } = params; + const db = configService.get('DATABASE'); + + if (!db.SAVE_DATA.CONTACTS) { + return; + } + + try { + const numbersAvailable = getAvailableNumbers(remoteJid); + + const existingContact = await prismaRepository.contact.findFirst({ + where: { + OR: numbersAvailable.map(number => ({ id: number })), + }, + }); + + if (!existingContact) { + await prismaRepository.contact.create({ + data: { + id: remoteJid, + pushName: '', + profilePicUrl: '', + isOnWhatsapp: true, + lid: lid || null, + createdAt: new Date(), + updatedAt: new Date(), + }, + }); + } else { + await prismaRepository.contact.update({ + where: { id: existingContact.id }, + data: { + isOnWhatsapp: true, + lid: lid || existingContact.lid, + updatedAt: new Date(), + }, + }); + } + } catch (error) { + console.error('Error saving WhatsApp cache:', error); + } +} +``` + +## Search Utilities + +### Advanced Search Operators +```typescript +function normalizeString(str: string): string { + return str + .toLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, ''); +} + +export function advancedOperatorsSearch(data: string, query: string): boolean { + const normalizedData = normalizeString(data); + const normalizedQuery = normalizeString(query); + + // Exact phrase search with quotes + if (normalizedQuery.startsWith('"') && normalizedQuery.endsWith('"')) { + const phrase = normalizedQuery.slice(1, -1); + return normalizedData.includes(phrase); + } + + // OR operator + if (normalizedQuery.includes(' OR ')) { + const terms = normalizedQuery.split(' OR '); + return terms.some(term => normalizedData.includes(term.trim())); + } + + // AND operator (default behavior) + if (normalizedQuery.includes(' AND ')) { + const terms = normalizedQuery.split(' AND '); + return terms.every(term => normalizedData.includes(term.trim())); + } + + // NOT operator + if (normalizedQuery.startsWith('NOT ')) { + const term = normalizedQuery.slice(4); + return !normalizedData.includes(term); + } + + // Wildcard search + if (normalizedQuery.includes('*')) { + const regex = new RegExp(normalizedQuery.replace(/\*/g, '.*'), 'i'); + return regex.test(normalizedData); + } + + // Default: simple contains search + return normalizedData.includes(normalizedQuery); +} +``` + +## Proxy Utilities + +### Proxy Agent Creation +```typescript +import { HttpsProxyAgent } from 'https-proxy-agent'; +import { SocksProxyAgent } from 'socks-proxy-agent'; + +type Proxy = { + host: string; + port: string; + protocol: 'http' | 'https' | 'socks4' | 'socks5'; + username?: string; + password?: string; +}; + +function selectProxyAgent(proxyUrl: string): HttpsProxyAgent | SocksProxyAgent { + const url = new URL(proxyUrl); + + if (url.protocol === 'socks4:' || url.protocol === 'socks5:') { + return new SocksProxyAgent(proxyUrl); + } else { + return new HttpsProxyAgent(proxyUrl); + } +} + +export function makeProxyAgent(proxy: Proxy): HttpsProxyAgent | SocksProxyAgent | null { + if (!proxy.host || !proxy.port) { + return null; + } + + let proxyUrl = `${proxy.protocol}://`; + + if (proxy.username && proxy.password) { + proxyUrl += `${proxy.username}:${proxy.password}@`; + } + + proxyUrl += `${proxy.host}:${proxy.port}`; + + try { + return selectProxyAgent(proxyUrl); + } catch (error) { + console.error('Failed to create proxy agent:', error); + return null; + } +} +``` + +## Telemetry Utilities + +### Telemetry Data Collection +```typescript +export interface TelemetryData { + route: string; + apiVersion: string; + timestamp: Date; + method?: string; + statusCode?: number; + responseTime?: number; + userAgent?: string; + instanceName?: string; +} + +export const sendTelemetry = async (route: string): Promise => { + try { + const telemetryData: TelemetryData = { + route, + apiVersion: packageJson.version, + timestamp: new Date(), + }; + + // Only send telemetry if enabled + if (process.env.DISABLE_TELEMETRY === 'true') { + return; + } + + // Send to telemetry service (implement as needed) + await axios.post('https://telemetry.evolution-api.com/collect', telemetryData, { + timeout: 5000, + }); + } catch (error) { + // Silently fail - don't affect main application + console.debug('Telemetry failed:', error.message); + } +}; +``` + +## Internationalization Utilities + +### i18n Setup +```typescript +import { ConfigService, Language } from '@config/env.config'; +import fs from 'fs'; +import i18next from 'i18next'; +import path from 'path'; + +const __dirname = path.resolve(process.cwd(), 'src', 'utils'); +const languages = ['en', 'pt-BR', 'es']; +const translationsPath = path.join(__dirname, 'translations'); +const configService: ConfigService = new ConfigService(); + +const resources: any = {}; + +languages.forEach((language) => { + const languagePath = path.join(translationsPath, `${language}.json`); + if (fs.existsSync(languagePath)) { + const translationContent = fs.readFileSync(languagePath, 'utf8'); + resources[language] = { + translation: JSON.parse(translationContent), + }; + } +}); + +i18next.init({ + resources, + fallbackLng: 'en', + lng: configService.get('LANGUAGE') || 'pt-BR', + interpolation: { + escapeValue: false, + }, +}); + +export const t = i18next.t.bind(i18next); +export default i18next; +``` + +## Bot Trigger Utilities + +### Bot Trigger Matching +```typescript +import { TriggerOperator, TriggerType } from '@prisma/client'; + +export function findBotByTrigger( + bots: any[], + content: string, + remoteJid: string, +): any | null { + for (const bot of bots) { + if (!bot.enabled) continue; + + // Check ignore list + if (bot.ignoreJids && bot.ignoreJids.includes(remoteJid)) { + continue; + } + + // Check trigger + if (matchesTrigger(content, bot.triggerType, bot.triggerOperator, bot.triggerValue)) { + return bot; + } + } + + return null; +} + +function matchesTrigger( + content: string, + triggerType: TriggerType, + triggerOperator: TriggerOperator, + triggerValue: string, +): boolean { + const normalizedContent = content.toLowerCase().trim(); + const normalizedValue = triggerValue.toLowerCase().trim(); + + switch (triggerType) { + case TriggerType.ALL: + return true; + + case TriggerType.KEYWORD: + return matchesKeyword(normalizedContent, triggerOperator, normalizedValue); + + case TriggerType.REGEX: + try { + const regex = new RegExp(triggerValue, 'i'); + return regex.test(content); + } catch { + return false; + } + + default: + return false; + } +} + +function matchesKeyword( + content: string, + operator: TriggerOperator, + value: string, +): boolean { + switch (operator) { + case TriggerOperator.EQUALS: + return content === value; + case TriggerOperator.CONTAINS: + return content.includes(value); + case TriggerOperator.STARTS_WITH: + return content.startsWith(value); + case TriggerOperator.ENDS_WITH: + return content.endsWith(value); + default: + return false; + } +} +``` + +## Server Utilities + +### Server Status Check +```typescript +export class ServerUP { + private static instance: ServerUP; + private isServerUp: boolean = false; + + private constructor() {} + + public static getInstance(): ServerUP { + if (!ServerUP.instance) { + ServerUP.instance = new ServerUP(); + } + return ServerUP.instance; + } + + public setServerStatus(status: boolean): void { + this.isServerUp = status; + } + + public getServerStatus(): boolean { + return this.isServerUp; + } + + public async waitForServer(timeout: number = 30000): Promise { + const startTime = Date.now(); + + while (!this.isServerUp && (Date.now() - startTime) < timeout) { + await new Promise(resolve => setTimeout(resolve, 100)); + } + + return this.isServerUp; + } +} +``` + +## Error Response Utilities + +### Standardized Error Responses +```typescript +export function createMetaErrorResponse(error: any, context: string) { + const timestamp = new Date().toISOString(); + + if (error.response?.data) { + return { + status: error.response.status || 500, + error: { + message: error.response.data.error?.message || 'External API error', + type: error.response.data.error?.type || 'api_error', + code: error.response.data.error?.code || 'unknown_error', + context, + timestamp, + }, + }; + } + + return { + status: 500, + error: { + message: error.message || 'Internal server error', + type: 'internal_error', + code: 'server_error', + context, + timestamp, + }, + }; +} + +export function createValidationErrorResponse(errors: any[], context: string) { + return { + status: 400, + error: { + message: 'Validation failed', + type: 'validation_error', + code: 'invalid_input', + context, + details: errors, + timestamp: new Date().toISOString(), + }, + }; +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/validate-rules.mdc b/.cursor/rules/specialized-rules/validate-rules.mdc new file mode 100644 index 00000000..f6baea1b --- /dev/null +++ b/.cursor/rules/specialized-rules/validate-rules.mdc @@ -0,0 +1,498 @@ +--- +description: Validation schemas and patterns for Evolution API +globs: + - "src/validate/**/*.ts" +alwaysApply: false +--- + +# Evolution API Validation Rules + +## Validation Schema Structure + +### JSONSchema7 Pattern (Evolution API Standard) +```typescript +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +const isNotEmpty = (...fields: string[]) => { + const properties = {}; + fields.forEach((field) => { + properties[field] = { + if: { properties: { [field]: { type: 'string' } } }, + then: { properties: { [field]: { minLength: 1 } } }, + }; + }); + + return { + allOf: Object.values(properties), + }; +}; + +export const exampleSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + name: { type: 'string' }, + description: { type: 'string' }, + enabled: { type: 'boolean' }, + settings: { + type: 'object', + properties: { + timeout: { type: 'number', minimum: 1000, maximum: 60000 }, + retries: { type: 'number', minimum: 0, maximum: 5 }, + }, + }, + tags: { + type: 'array', + items: { type: 'string' }, + }, + }, + required: ['name', 'enabled'], + ...isNotEmpty('name'), +}; +``` + +## Message Validation Schemas + +### Send Message Validation +```typescript +const numberDefinition = { + type: 'string', + pattern: '^\\d+[\\.@\\w-]+', + description: 'Invalid number', +}; + +export const sendTextSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + number: numberDefinition, + text: { type: 'string', minLength: 1, maxLength: 4096 }, + delay: { type: 'number', minimum: 0, maximum: 60000 }, + linkPreview: { type: 'boolean' }, + mentionsEveryOne: { type: 'boolean' }, + mentioned: { + type: 'array', + items: { type: 'string' }, + }, + }, + required: ['number', 'text'], + ...isNotEmpty('number', 'text'), +}; + +export const sendMediaSchema = Joi.object({ + number: Joi.string().required().pattern(/^\d+$/), + mediatype: Joi.string().required().valid('image', 'video', 'audio', 'document'), + media: Joi.alternatives().try( + Joi.string().uri(), + Joi.string().base64(), + ).required(), + caption: Joi.string().optional().max(1024), + fileName: Joi.string().optional().max(255), + delay: Joi.number().optional().min(0).max(60000), +}).required(); + +export const sendButtonsSchema = Joi.object({ + number: Joi.string().required().pattern(/^\d+$/), + title: Joi.string().required().max(1024), + description: Joi.string().optional().max(1024), + footer: Joi.string().optional().max(60), + buttons: Joi.array().items( + Joi.object({ + type: Joi.string().required().valid('replyButton', 'urlButton', 'callButton'), + displayText: Joi.string().required().max(20), + id: Joi.string().when('type', { + is: 'replyButton', + then: Joi.required().max(256), + otherwise: Joi.optional(), + }), + url: Joi.string().when('type', { + is: 'urlButton', + then: Joi.required().uri(), + otherwise: Joi.optional(), + }), + phoneNumber: Joi.string().when('type', { + is: 'callButton', + then: Joi.required().pattern(/^\+?\d+$/), + otherwise: Joi.optional(), + }), + }) + ).min(1).max(3).required(), +}).required(); +``` + +## Instance Validation Schemas + +### Instance Creation Validation +```typescript +export const instanceSchema = Joi.object({ + instanceName: Joi.string().required().min(1).max(100).pattern(/^[a-zA-Z0-9_-]+$/), + integration: Joi.string().required().valid('WHATSAPP-BAILEYS', 'WHATSAPP-BUSINESS', 'EVOLUTION'), + token: Joi.string().when('integration', { + is: Joi.valid('WHATSAPP-BUSINESS', 'EVOLUTION'), + then: Joi.required().min(10), + otherwise: Joi.optional(), + }), + qrcode: Joi.boolean().optional().default(false), + number: Joi.string().optional().pattern(/^\d+$/), + businessId: Joi.string().when('integration', { + is: 'WHATSAPP-BUSINESS', + then: Joi.required(), + otherwise: Joi.optional(), + }), +}).required(); + +export const settingsSchema = Joi.object({ + rejectCall: Joi.boolean().optional(), + msgCall: Joi.string().optional().max(500), + groupsIgnore: Joi.boolean().optional(), + alwaysOnline: Joi.boolean().optional(), + readMessages: Joi.boolean().optional(), + readStatus: Joi.boolean().optional(), + syncFullHistory: Joi.boolean().optional(), + wavoipToken: Joi.string().optional(), +}).optional(); + +export const proxySchema = Joi.object({ + host: Joi.string().required().hostname(), + port: Joi.string().required().pattern(/^\d+$/).custom((value) => { + const port = parseInt(value); + if (port < 1 || port > 65535) { + throw new Error('Port must be between 1 and 65535'); + } + return value; + }), + protocol: Joi.string().required().valid('http', 'https', 'socks4', 'socks5'), + username: Joi.string().optional(), + password: Joi.string().optional(), +}).optional(); +``` + +## Webhook Validation Schemas + +### Webhook Configuration Validation +```typescript +export const webhookSchema = Joi.object({ + enabled: Joi.boolean().required(), + url: Joi.string().when('enabled', { + is: true, + then: Joi.required().uri({ scheme: ['http', 'https'] }), + otherwise: Joi.optional(), + }), + events: Joi.array().items( + Joi.string().valid( + 'APPLICATION_STARTUP', + 'INSTANCE_CREATE', + 'INSTANCE_DELETE', + 'QRCODE_UPDATED', + 'CONNECTION_UPDATE', + 'STATUS_INSTANCE', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'CHATS_SET', + 'CHATS_UPDATE', + 'CHATS_UPSERT', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUPS_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CALL' + ) + ).min(1).when('enabled', { + is: true, + then: Joi.required(), + otherwise: Joi.optional(), + }), + headers: Joi.object().pattern( + Joi.string(), + Joi.string() + ).optional(), + byEvents: Joi.boolean().optional().default(false), + base64: Joi.boolean().optional().default(false), +}).required(); +``` + +## Chatbot Validation Schemas + +### Base Chatbot Validation +```typescript +export const baseChatbotSchema = Joi.object({ + enabled: Joi.boolean().required(), + description: Joi.string().required().min(1).max(500), + expire: Joi.number().optional().min(0).max(86400), // 24 hours in seconds + keywordFinish: Joi.string().optional().max(100), + delayMessage: Joi.number().optional().min(0).max(10000), + unknownMessage: Joi.string().optional().max(1000), + listeningFromMe: Joi.boolean().optional().default(false), + stopBotFromMe: Joi.boolean().optional().default(false), + keepOpen: Joi.boolean().optional().default(false), + debounceTime: Joi.number().optional().min(0).max(60000), + triggerType: Joi.string().required().valid('ALL', 'KEYWORD', 'REGEX'), + triggerOperator: Joi.string().when('triggerType', { + is: 'KEYWORD', + then: Joi.required().valid('EQUALS', 'CONTAINS', 'STARTS_WITH', 'ENDS_WITH'), + otherwise: Joi.optional(), + }), + triggerValue: Joi.string().when('triggerType', { + is: Joi.valid('KEYWORD', 'REGEX'), + then: Joi.required().min(1).max(500), + otherwise: Joi.optional(), + }), + ignoreJids: Joi.array().items(Joi.string()).optional(), + splitMessages: Joi.boolean().optional().default(false), + timePerChar: Joi.number().optional().min(10).max(1000).default(100), +}).required(); + +export const typebotSchema = baseChatbotSchema.keys({ + url: Joi.string().required().uri({ scheme: ['http', 'https'] }), + typebot: Joi.string().required().min(1).max(100), + apiVersion: Joi.string().optional().valid('v1', 'v2').default('v1'), +}).required(); + +export const openaiSchema = baseChatbotSchema.keys({ + apiKey: Joi.string().required().min(10), + model: Joi.string().optional().valid( + 'gpt-3.5-turbo', + 'gpt-3.5-turbo-16k', + 'gpt-4', + 'gpt-4-32k', + 'gpt-4-turbo-preview' + ).default('gpt-3.5-turbo'), + systemMessage: Joi.string().optional().max(2000), + maxTokens: Joi.number().optional().min(1).max(4000).default(1000), + temperature: Joi.number().optional().min(0).max(2).default(0.7), +}).required(); +``` + +## Business API Validation Schemas + +### Template Validation +```typescript +export const templateSchema = Joi.object({ + name: Joi.string().required().min(1).max(512).pattern(/^[a-z0-9_]+$/), + category: Joi.string().required().valid('MARKETING', 'UTILITY', 'AUTHENTICATION'), + allowCategoryChange: Joi.boolean().required(), + language: Joi.string().required().pattern(/^[a-z]{2}_[A-Z]{2}$/), // e.g., pt_BR, en_US + components: Joi.array().items( + Joi.object({ + type: Joi.string().required().valid('HEADER', 'BODY', 'FOOTER', 'BUTTONS'), + format: Joi.string().when('type', { + is: 'HEADER', + then: Joi.valid('TEXT', 'IMAGE', 'VIDEO', 'DOCUMENT'), + otherwise: Joi.optional(), + }), + text: Joi.string().when('type', { + is: Joi.valid('HEADER', 'BODY', 'FOOTER'), + then: Joi.required().min(1).max(1024), + otherwise: Joi.optional(), + }), + buttons: Joi.array().when('type', { + is: 'BUTTONS', + then: Joi.items( + Joi.object({ + type: Joi.string().required().valid('QUICK_REPLY', 'URL', 'PHONE_NUMBER'), + text: Joi.string().required().min(1).max(25), + url: Joi.string().when('type', { + is: 'URL', + then: Joi.required().uri(), + otherwise: Joi.optional(), + }), + phone_number: Joi.string().when('type', { + is: 'PHONE_NUMBER', + then: Joi.required().pattern(/^\+?\d+$/), + otherwise: Joi.optional(), + }), + }) + ).min(1).max(10), + otherwise: Joi.optional(), + }), + }) + ).min(1).required(), + webhookUrl: Joi.string().optional().uri({ scheme: ['http', 'https'] }), +}).required(); + +export const catalogSchema = Joi.object({ + number: Joi.string().optional().pattern(/^\d+$/), + limit: Joi.number().optional().min(1).max(1000).default(10), + cursor: Joi.string().optional(), +}).optional(); +``` + +## Group Validation Schemas + +### Group Management Validation +```typescript +export const createGroupSchema = Joi.object({ + subject: Joi.string().required().min(1).max(100), + description: Joi.string().optional().max(500), + participants: Joi.array().items( + Joi.string().pattern(/^\d+$/) + ).min(1).max(256).required(), + promoteParticipants: Joi.boolean().optional().default(false), +}).required(); + +export const updateGroupSchema = Joi.object({ + subject: Joi.string().optional().min(1).max(100), + description: Joi.string().optional().max(500), +}).min(1).required(); + +export const groupParticipantsSchema = Joi.object({ + participants: Joi.array().items( + Joi.string().pattern(/^\d+$/) + ).min(1).max(50).required(), + action: Joi.string().required().valid('add', 'remove', 'promote', 'demote'), +}).required(); +``` + +## Label Validation Schemas + +### Label Management Validation +```typescript +export const labelSchema = Joi.object({ + name: Joi.string().required().min(1).max(100), + color: Joi.string().required().pattern(/^#[0-9A-Fa-f]{6}$/), // Hex color + predefinedId: Joi.string().optional(), +}).required(); + +export const handleLabelSchema = Joi.object({ + number: Joi.string().required().pattern(/^\d+$/), + labelId: Joi.string().required(), + action: Joi.string().required().valid('add', 'remove'), +}).required(); +``` + +## Custom Validation Functions + +### Phone Number Validation +```typescript +export function validatePhoneNumber(number: string): boolean { + // Remove any non-digit characters + const cleaned = number.replace(/\D/g, ''); + + // Check minimum and maximum length + if (cleaned.length < 10 || cleaned.length > 15) { + return false; + } + + // Check for valid country codes (basic validation) + const validCountryCodes = ['1', '7', '20', '27', '30', '31', '32', '33', '34', '36', '39', '40', '41', '43', '44', '45', '46', '47', '48', '49', '51', '52', '53', '54', '55', '56', '57', '58', '60', '61', '62', '63', '64', '65', '66', '81', '82', '84', '86', '90', '91', '92', '93', '94', '95', '98']; + + // Check if starts with valid country code + const startsWithValidCode = validCountryCodes.some(code => cleaned.startsWith(code)); + + return startsWithValidCode; +} + +export const phoneNumberValidator = Joi.string().custom((value, helpers) => { + if (!validatePhoneNumber(value)) { + return helpers.error('any.invalid'); + } + return value; +}, 'Phone number validation'); +``` + +### Base64 Validation +```typescript +export function validateBase64(base64: string): boolean { + try { + // Check if it's a valid base64 string + const decoded = Buffer.from(base64, 'base64').toString('base64'); + return decoded === base64; + } catch { + return false; + } +} + +export const base64Validator = Joi.string().custom((value, helpers) => { + if (!validateBase64(value)) { + return helpers.error('any.invalid'); + } + return value; +}, 'Base64 validation'); +``` + +### URL Validation with Protocol Check +```typescript +export function validateWebhookUrl(url: string): boolean { + try { + const parsed = new URL(url); + return ['http:', 'https:'].includes(parsed.protocol); + } catch { + return false; + } +} + +export const webhookUrlValidator = Joi.string().custom((value, helpers) => { + if (!validateWebhookUrl(value)) { + return helpers.error('any.invalid'); + } + return value; +}, 'Webhook URL validation'); +``` + +## Validation Error Handling + +### Error Message Customization +```typescript +export const validationMessages = { + 'any.required': 'O campo {#label} é obrigatório', + 'string.empty': 'O campo {#label} não pode estar vazio', + 'string.min': 'O campo {#label} deve ter pelo menos {#limit} caracteres', + 'string.max': 'O campo {#label} deve ter no máximo {#limit} caracteres', + 'string.pattern.base': 'O campo {#label} possui formato inválido', + 'number.min': 'O campo {#label} deve ser maior ou igual a {#limit}', + 'number.max': 'O campo {#label} deve ser menor ou igual a {#limit}', + 'array.min': 'O campo {#label} deve ter pelo menos {#limit} itens', + 'array.max': 'O campo {#label} deve ter no máximo {#limit} itens', + 'any.only': 'O campo {#label} deve ser um dos valores: {#valids}', +}; + +export function formatValidationError(error: Joi.ValidationError): any { + return { + message: 'Dados de entrada inválidos', + details: error.details.map(detail => ({ + field: detail.path.join('.'), + message: detail.message, + value: detail.context?.value, + })), + }; +} +``` + +## Schema Composition + +### Reusable Schema Components +```typescript +export const commonFields = { + instanceName: Joi.string().required().min(1).max(100).pattern(/^[a-zA-Z0-9_-]+$/), + number: phoneNumberValidator.required(), + delay: Joi.number().optional().min(0).max(60000), + enabled: Joi.boolean().optional().default(true), +}; + +export const mediaFields = { + mediatype: Joi.string().required().valid('image', 'video', 'audio', 'document'), + media: Joi.alternatives().try( + Joi.string().uri(), + base64Validator, + ).required(), + caption: Joi.string().optional().max(1024), + fileName: Joi.string().optional().max(255), +}; + +// Compose schemas using common fields +export const quickMessageSchema = Joi.object({ + ...commonFields, + text: Joi.string().required().min(1).max(4096), +}).required(); + +export const quickMediaSchema = Joi.object({ + ...commonFields, + ...mediaFields, +}).required(); +``` \ No newline at end of file diff --git a/.gitignore b/.gitignore index 634c6cb0..768d8afa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,8 @@ Baileys /dist /node_modules -.cursor* - /Docker/.env -.vscode - # Logs logs/**.json *.log diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..da708130 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,41 @@ +# Repository Guidelines + +## Project Structure & Module Organization +- `src/` – TypeScript source. Key areas: `api/controllers`, `api/routes`, `api/services`, `api/integrations/{channel,chatbot,event,storage}`, `config`, `utils`, `exceptions`. +- `prisma/` – Prisma schema and migrations. Provider folders: `postgresql-migrations/`, `mysql-migrations/`. Use `DATABASE_PROVIDER` to target the provider. +- `dist/` – Build output; do not edit. +- `public/` – Static assets. +- `Docker*`, `docker-compose*.yaml` – Local stack and deployment helpers. + +## Build, Test, and Development Commands +- `npm run build` – Type-check (tsc) and bundle with `tsup` to `dist/`. +- `npm run start` – Run dev server via `tsx src/main.ts`. +- `npm run dev:server` – Watch mode for local development. +- `npm run start:prod` – Run compiled app from `dist/`. +- `npm run lint` / `npm run lint:check` – Auto-fix and check linting. +- Database (choose provider): `export DATABASE_PROVIDER=postgresql` (or `mysql`), then: + - `npm run db:generate` – Generate Prisma client. + - `npm run db:migrate:dev` – Apply dev migrations and sync provider folder. + - `npm run db:deploy` – Apply migrations in non-dev environments. + - `npm run db:studio` – Open Prisma Studio. +- Docker: `docker-compose up -d` to start local services. + +## Coding Style & Naming Conventions +- TypeScript, 2-space indent, single quotes, trailing commas, 120-char max (Prettier). +- Enforced by ESLint + Prettier; import order via `simple-import-sort`. +- File names follow `feature.kind.ts` (e.g., `chat.router.ts`, `whatsapp.baileys.service.ts`). +- Classes: PascalCase; functions/variables: camelCase; constants: UPPER_SNAKE_CASE. + +## Testing Guidelines +- No formal suite yet. Place tests under `test/` as `*.test.ts`. +- Run `npm test` (watches `test/all.test.ts` if present). Prefer fast, isolated unit tests. + +## Commit & Pull Request Guidelines +- Conventional Commits enforced by commitlint. Use `npm run commit` (Commitizen). + - Examples: `feat(api): add message status`, `fix(route): handle 404 on send`. +- PRs: include clear description, linked issues, migration impact (provider), local run steps, and screenshots/logs where relevant. + +## Security & Configuration +- Copy `.env.example` to `.env`; never commit secrets. +- Set `DATABASE_PROVIDER` before DB commands; see `SECURITY.md` for reporting vulnerabilities. + diff --git a/CLAUDE.md b/CLAUDE.md index e452214b..949045d8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,77 +2,163 @@ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. -## Development Commands +## Project Overview -### Core Commands -- **Run development server**: `npm run dev:server` - Starts the server with hot reload using tsx watch -- **Build project**: `npm run build` - Runs TypeScript check and builds with tsup -- **Start production**: `npm run start:prod` - Runs the compiled application from dist/ -- **Lint code**: `npm run lint` - Runs ESLint with auto-fix on TypeScript files -- **Check lint**: `npm run lint:check` - Runs ESLint without auto-fix +Evolution API is a REST API for WhatsApp communication that supports both Baileys (WhatsApp Web) and official WhatsApp Business API. It's built with TypeScript/Node.js and provides extensive integrations with various platforms. -### Database Commands -The project uses Prisma with support for multiple database providers (PostgreSQL, MySQL, psql_bouncer). Commands automatically use the DATABASE_PROVIDER from .env: +## Common Development Commands -- **Generate Prisma client**: `npm run db:generate` -- **Deploy migrations**: `npm run db:deploy` (Unix/Mac) or `npm run db:deploy:win` (Windows) -- **Open Prisma Studio**: `npm run db:studio` -- **Create new migration**: `npm run db:migrate:dev` (Unix/Mac) or `npm run db:migrate:dev:win` (Windows) +### Build and Run +```bash +# Development +npm run dev:server # Run in development with hot reload (tsx watch) + +# Production +npm run build # TypeScript check + tsup build +npm run start:prod # Run production build + +# Direct execution +npm start # Run with tsx +``` + +### Code Quality +```bash +npm run lint # ESLint with auto-fix +npm run lint:check # ESLint check only +npm run commit # Interactive commit with commitizen +``` + +### Database Management +```bash +# Generate Prisma client (automatically uses DATABASE_PROVIDER env) +npm run db:generate + +# Deploy migrations +npm run db:deploy # Unix/Mac +npm run db:deploy:win # Windows + +# Open Prisma Studio +npm run db:studio + +# Development migrations +npm run db:migrate:dev # Unix/Mac +npm run db:migrate:dev:win # Windows +``` + +### Testing +```bash +npm test # Run tests with watch mode +``` ## Architecture Overview -### Project Structure -Evolution API is a WhatsApp integration platform built with TypeScript and Express, supporting both Baileys (WhatsApp Web) and WhatsApp Cloud API connections. +### Core Structure +- **Multi-provider database support**: PostgreSQL and MySQL via Prisma ORM with provider-specific schemas +- **Connection management**: Each WhatsApp instance maintains its own connection state and session +- **Event-driven architecture**: Uses EventEmitter2 for internal events and supports multiple external event systems -### Core Components +### Directory Layout +``` +src/ +├── api/ +│ ├── controllers/ # HTTP route handlers +│ ├── services/ # Business logic +│ ├── repository/ # Data access layer (Prisma) +│ ├── dto/ # Data validation schemas +│ ├── guards/ # Authentication/authorization +│ ├── integrations/ # External service integrations +│ └── routes/ # Express route definitions +├── config/ # Environment and app configuration +├── cache/ # Redis and local cache implementations +├── exceptions/ # Custom exception classes +├── utils/ # Shared utilities +└── validate/ # Validation schemas +``` -**API Layer** (`src/api/`) -- **Controllers**: Handle HTTP requests for different resources (instance, chat, group, sendMessage, etc.) -- **Services**: Business logic layer containing auth, cache, channel, monitor, proxy services -- **Routes**: RESTful API endpoints with authentication guards -- **DTOs**: Data transfer objects for request/response validation using class-validator -- **Repository**: Database access layer using Prisma ORM +### Key Services Integration Points -**Integrations** (`src/api/integrations/`) -- **Chatbot**: Supports multiple chatbot platforms (Typebot, Chatwoot, Dify, OpenAI, Flowise, N8N) -- **Event**: WebSocket, RabbitMQ, Amazon SQS event systems -- **Storage**: S3/Minio file storage integration -- **Channel**: Multi-channel messaging support +**WhatsApp Service** (`src/api/integrations/channel/whatsapp/`): +- Manages Baileys connections and Meta Business API +- Handles message sending, receiving, and status updates +- Connection lifecycle management per instance -**Configuration** (`src/config/`) -- Environment configuration management -- Database provider switching (PostgreSQL/MySQL/PgBouncer) -- Multi-tenant support via DATABASE_CONNECTION_CLIENT_NAME +**Integration Services** (`src/api/integrations/`): +- Chatwoot: Customer service platform integration +- Typebot: Conversational bot builder +- OpenAI: AI capabilities including audio transcription +- Dify: AI agent platform +- RabbitMQ/SQS: Message queue integrations +- S3/Minio: Media storage -### Key Design Patterns - -1. **Multi-Provider Database**: Uses `runWithProvider.js` to dynamically select database provider and migrations -2. **Module System**: Path aliases configured in tsconfig.json (@api, @cache, @config, @utils, @validate) -3. **Event-Driven**: EventEmitter2 for internal events, supports multiple external event systems -4. **Instance Management**: Each WhatsApp connection is managed as an instance with memory lifecycle (DEL_INSTANCE config) - -### Database Schema -- Supports multiple providers with provider-specific schemas in `prisma/` -- Separate migration folders for each provider (postgresql-migrations, mysql-migrations) -- psql_bouncer uses PostgreSQL migrations but with connection pooling +### Database Schema Management +- Separate schema files: `postgresql-schema.prisma` and `mysql-schema.prisma` +- Environment variable `DATABASE_PROVIDER` determines active database +- Migration folders are provider-specific and auto-selected during deployment ### Authentication & Security -- JWT-based authentication -- API key support -- Instance-specific authentication -- Configurable CORS settings +- API key-based authentication via `apikey` header +- Instance-specific authentication for WhatsApp connections +- Guards system for route protection +- Input validation using `class-validator` -### Messaging Features -- WhatsApp Web (Baileys library) and WhatsApp Cloud API support -- Message queue support (RabbitMQ, SQS) -- Real-time updates via WebSocket -- Media file handling with S3/Minio storage -- Multiple chatbot integrations with trigger management +## Important Implementation Details -### Environment Variables -Critical configuration in `.env`: -- SERVER_TYPE, SERVER_PORT, SERVER_URL -- DATABASE_PROVIDER and DATABASE_CONNECTION_URI -- Log levels and Baileys-specific logging -- Instance lifecycle management (DEL_INSTANCE) -- Feature toggles for data persistence (DATABASE_SAVE_*) \ No newline at end of file +### WhatsApp Instance Management +- Each WhatsApp connection is an "instance" with unique name +- Instance data stored in database with connection state +- Session persistence in database or file system (configurable) +- Automatic reconnection handling with exponential backoff + +### Message Queue Architecture +- Supports RabbitMQ, Amazon SQS, and WebSocket for events +- Event types: message.received, message.sent, connection.update, etc. +- Configurable per instance which events to send + +### Media Handling +- Local storage or S3/Minio for media files +- Automatic media download from WhatsApp +- Media URL generation for external access +- Support for audio transcription via OpenAI + +### Multi-tenancy Support +- Instance isolation at database level +- Separate webhook configurations per instance +- Independent integration settings per instance + +## Environment Configuration + +Key environment variables are defined in `.env.example`. The system uses a strongly-typed configuration system via `src/config/env.config.ts`. + +Critical configurations: +- `DATABASE_PROVIDER`: postgresql or mysql +- `DATABASE_CONNECTION_URI`: Database connection string +- `AUTHENTICATION_API_KEY`: Global API authentication +- `REDIS_ENABLED`: Enable Redis cache +- `RABBITMQ_ENABLED`/`SQS_ENABLED`: Message queue options + +## Development Guidelines from Cursor Instructions + +The project includes specific development instructions in `.cursor/instructions`: +- Always respond in Portuguese Brazilian +- Follow established architecture patterns +- Robust error handling with retry logic +- Multi-database compatibility requirements +- Security validations and rate limiting +- Performance optimizations with caching +- Minimum 70% test coverage target + +## Testing Approach + +Tests are located alongside source files or in dedicated test directories. The project uses: +- Unit tests for services +- Integration tests for critical APIs +- Mock external dependencies +- Test command runs with watch mode for development + +## Deployment Considerations + +- Docker support with `Dockerfile` and `docker-compose.yaml` +- Graceful shutdown handling for connections +- Health check endpoints for monitoring +- Sentry integration for error tracking +- Telemetry for usage analytics (non-sensitive data only) \ No newline at end of file From a721beda3cca9ed587f22e85edbb57474b7b102e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 15:47:26 -0300 Subject: [PATCH 084/129] chore(rules): update input validation standards to use JSONSchema7 and add commit standards --- .cursor/rules/README.md | 3 ++- .cursor/rules/core-development.mdc | 27 +++++++++++++++++++++++++-- .cursor/rules/project-context.mdc | 6 +++--- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.cursor/rules/README.md b/.cursor/rules/README.md index fdc82a68..31959fe7 100644 --- a/.cursor/rules/README.md +++ b/.cursor/rules/README.md @@ -50,6 +50,7 @@ Cada arquivo de regras contém: - **Exemplos práticos** - Código de exemplo - **Anti-padrões** - O que evitar - **Testes** - Como testar o código +- **Padrões de Commit** - Conventional Commits com commitlint ## Configuração do Cursor @@ -75,7 +76,7 @@ Para manter as regras atualizadas: - **Queue**: RabbitMQ + Amazon SQS - **Real-time**: Socket.io - **Storage**: AWS S3 + Minio -- **Validation**: class-validator + Joi +- **Validation**: JSONSchema7 - **Logging**: Pino - **WhatsApp**: Baileys + Meta Business API - **Integrations**: Chatwoot, Typebot, OpenAI, Dify diff --git a/.cursor/rules/core-development.mdc b/.cursor/rules/core-development.mdc index f245b99d..53038579 100644 --- a/.cursor/rules/core-development.mdc +++ b/.cursor/rules/core-development.mdc @@ -51,7 +51,7 @@ alwaysApply: true ### File and Function Organization - Node.js/TypeScript Structure - **Services**: Keep services focused and under 200 lines - **Controllers**: Keep controllers thin - only routing and validation -- **DTOs**: Use class-validator for all input validation +- **DTOs**: Use JSONSchema7 for all input validation - **Integrations**: Follow `src/api/integrations/` structure for new integrations - **Utils**: Extract common functionality into well-named utilities - **Types**: Define clear TypeScript interfaces and types @@ -78,7 +78,7 @@ alwaysApply: true - **Graceful Degradation**: Handle service failures gracefully ### Security Standards -- **Input Validation**: Validate all inputs with class-validator +- **Input Validation**: Validate all inputs with JSONSchema7 - **Authentication**: Use API keys and JWT tokens - **Rate Limiting**: Implement rate limiting for APIs - **Data Sanitization**: Sanitize sensitive data in logs @@ -117,6 +117,29 @@ alwaysApply: true - **Security Review**: Check for security vulnerabilities - **Performance Review**: Check for performance issues +### Commit Standards (Conventional Commits) +- **Format**: `type(scope): subject` (max 100 characters) +- **Types**: + - `feat` - New feature + - `fix` - Bug fix + - `docs` - Documentation changes + - `style` - Code style changes (formatting, etc) + - `refactor` - Code refactoring + - `perf` - Performance improvements + - `test` - Adding or updating tests + - `chore` - Maintenance tasks + - `ci` - CI/CD changes + - `build` - Build system changes + - `revert` - Reverting changes + - `security` - Security fixes +- **Examples**: + - `feat(api): add WhatsApp message status endpoint` + - `fix(baileys): resolve connection timeout issue` + - `docs(readme): update installation instructions` + - `refactor(service): extract common message validation logic` +- **Tools**: Use `npm run commit` (Commitizen) for guided commits +- **Validation**: Enforced by commitlint on commit-msg hook + ## Evolution API Specific Patterns ### WhatsApp Integration Patterns diff --git a/.cursor/rules/project-context.mdc b/.cursor/rules/project-context.mdc index c3523e42..0a4da37e 100644 --- a/.cursor/rules/project-context.mdc +++ b/.cursor/rules/project-context.mdc @@ -32,7 +32,7 @@ alwaysApply: true - **Queue**: RabbitMQ + Amazon SQS for message processing - **Real-time**: Socket.io for WebSocket connections - **Storage**: AWS S3 + Minio for file storage -- **Validation**: class-validator for input validation +- **Validation**: JSONSchema7 for input validation - **Logging**: Pino for structured logging - **Architecture**: Multi-tenant API with WhatsApp integrations @@ -133,7 +133,7 @@ alwaysApply: true ### Security Constraints - **AUTHENTICATION**: API key validation for all endpoints - **AUTHORIZATION**: Instance-based access control -- **INPUT VALIDATION**: Validate all inputs with class-validator +- **INPUT VALIDATION**: Validate all inputs with JSONSchema7 - **RATE LIMITING**: Prevent abuse with rate limiting - **WEBHOOK SECURITY**: Validate webhook signatures @@ -163,7 +163,7 @@ alwaysApply: true ### Integration Patterns - **SERVICE LAYER**: Business logic in service classes -- **DTO VALIDATION**: Input validation with class-validator +- **DTO VALIDATION**: Input validation with JSONSchema7 - **ERROR HANDLING**: Consistent error responses - **LOGGING**: Structured logging with correlation IDs From 81a991a62ead00403050ada98357086c2eecc284 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 15:54:39 -0300 Subject: [PATCH 085/129] docs(agents.md and claude.md): update and expand AI Agent guidelines in AGENTS.md and CLAUDE.md Revise AGENTS.md to provide comprehensive guidelines for AI agents working with the Evolution API. Enhance CLAUDE.md with detailed project overview, common development commands, and integration points. Include architecture patterns, coding standards, and testing strategies for better clarity and consistency. --- AGENTS.md | 372 +++++++++++++++++++++++++++++++++++++++++++++++++----- CLAUDE.md | 147 ++++++++++++++------- 2 files changed, 446 insertions(+), 73 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index da708130..143e6c74 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,41 +1,355 @@ -# Repository Guidelines +# Evolution API - AI Agent Guidelines + +This document provides comprehensive guidelines for AI agents (Claude, GPT, Cursor, etc.) working with the Evolution API codebase. + +## Project Overview + +**Evolution API** is a production-ready, multi-tenant WhatsApp API platform built with Node.js, TypeScript, and Express.js. It supports multiple WhatsApp providers and extensive integrations with chatbots, CRM systems, and messaging platforms. ## Project Structure & Module Organization -- `src/` – TypeScript source. Key areas: `api/controllers`, `api/routes`, `api/services`, `api/integrations/{channel,chatbot,event,storage}`, `config`, `utils`, `exceptions`. -- `prisma/` – Prisma schema and migrations. Provider folders: `postgresql-migrations/`, `mysql-migrations/`. Use `DATABASE_PROVIDER` to target the provider. -- `dist/` – Build output; do not edit. -- `public/` – Static assets. -- `Docker*`, `docker-compose*.yaml` – Local stack and deployment helpers. + +### Core Directories +- **`src/`** – TypeScript source code with modular architecture + - `api/controllers/` – HTTP route handlers (thin layer) + - `api/services/` – Business logic (core functionality) + - `api/routes/` – Express route definitions (RouterBroker pattern) + - `api/integrations/` – External service integrations + - `channel/` – WhatsApp providers (Baileys, Business API, Evolution) + - `chatbot/` – AI/Bot integrations (OpenAI, Dify, Typebot, Chatwoot) + - `event/` – Event systems (WebSocket, RabbitMQ, SQS, NATS, Pusher) + - `storage/` – File storage (S3, MinIO) + - `dto/` – Data Transfer Objects (simple classes, no decorators) + - `guards/` – Authentication/authorization middleware + - `types/` – TypeScript type definitions + - `repository/` – Data access layer (Prisma) +- **`prisma/`** – Database schemas and migrations + - `postgresql-schema.prisma` / `mysql-schema.prisma` – Provider-specific schemas + - `postgresql-migrations/` / `mysql-migrations/` – Provider-specific migrations +- **`config/`** – Environment and application configuration +- **`utils/`** – Shared utilities and helper functions +- **`validate/`** – JSONSchema7 validation schemas +- **`exceptions/`** – Custom HTTP exception classes +- **`cache/`** – Redis and local cache implementations + +### Build & Deployment +- **`dist/`** – Build output (do not edit directly) +- **`public/`** – Static assets and media files +- **`Docker*`**, **`docker-compose*.yaml`** – Containerization and local development stack ## Build, Test, and Development Commands -- `npm run build` – Type-check (tsc) and bundle with `tsup` to `dist/`. -- `npm run start` – Run dev server via `tsx src/main.ts`. -- `npm run dev:server` – Watch mode for local development. -- `npm run start:prod` – Run compiled app from `dist/`. -- `npm run lint` / `npm run lint:check` – Auto-fix and check linting. -- Database (choose provider): `export DATABASE_PROVIDER=postgresql` (or `mysql`), then: - - `npm run db:generate` – Generate Prisma client. - - `npm run db:migrate:dev` – Apply dev migrations and sync provider folder. - - `npm run db:deploy` – Apply migrations in non-dev environments. - - `npm run db:studio` – Open Prisma Studio. -- Docker: `docker-compose up -d` to start local services. -## Coding Style & Naming Conventions -- TypeScript, 2-space indent, single quotes, trailing commas, 120-char max (Prettier). -- Enforced by ESLint + Prettier; import order via `simple-import-sort`. -- File names follow `feature.kind.ts` (e.g., `chat.router.ts`, `whatsapp.baileys.service.ts`). -- Classes: PascalCase; functions/variables: camelCase; constants: UPPER_SNAKE_CASE. +### Development Workflow +```bash +# Development server with hot reload +npm run dev:server + +# Direct execution for testing +npm start + +# Production build and run +npm run build +npm run start:prod +``` + +### Code Quality +```bash +# Linting and formatting +npm run lint # ESLint with auto-fix +npm run lint:check # ESLint check only + +# Commit with conventional commits +npm run commit # Interactive commit with Commitizen +``` + +### Database Management +```bash +# Set database provider first (CRITICAL) +export DATABASE_PROVIDER=postgresql # or mysql + +# Generate Prisma client +npm run db:generate + +# Development migrations (with provider sync) +npm run db:migrate:dev # Unix/Mac +npm run db:migrate:dev:win # Windows + +# Production deployment +npm run db:deploy # Unix/Mac +npm run db:deploy:win # Windows + +# Database tools +npm run db:studio # Open Prisma Studio +``` + +### Docker Development +```bash +# Start local services (Redis, PostgreSQL, etc.) +docker-compose up -d + +# Full development stack +docker-compose -f docker-compose.dev.yaml up -d +``` + +## Coding Standards & Architecture Patterns + +### Code Style (Enforced by ESLint + Prettier) +- **TypeScript strict mode** with full type coverage +- **2-space indentation**, single quotes, trailing commas +- **120-character line limit** +- **Import order** via `simple-import-sort` +- **File naming**: `feature.kind.ts` (e.g., `whatsapp.baileys.service.ts`) +- **Naming conventions**: + - Classes: `PascalCase` + - Functions/variables: `camelCase` + - Constants: `UPPER_SNAKE_CASE` + - Files: `kebab-case.type.ts` + +### Architecture Patterns + +#### Service Layer Pattern +```typescript +export class ExampleService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger('ExampleService'); + + public async create(instance: InstanceDto, data: ExampleDto) { + // Business logic here + return { example: { ...instance, data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + const result = await this.waMonitor.waInstances[instance.instanceName].findData(); + return result || null; // Return null on not found (Evolution pattern) + } catch (error) { + this.logger.error('Error finding data:', error); + return null; // Return null on error (Evolution pattern) + } + } +} +``` + +#### Controller Pattern (Thin Layer) +```typescript +export class ExampleController { + constructor(private readonly exampleService: ExampleService) {} + + public async createExample(instance: InstanceDto, data: ExampleDto) { + return this.exampleService.create(instance, data); + } +} +``` + +#### RouterBroker Pattern +```typescript +export class ExampleRouter extends RouterBroker { + constructor(...guards: any[]) { + super(); + this.router.post(this.routerPath('create'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: exampleSchema, // JSONSchema7 + ClassRef: ExampleDto, + execute: (instance, data) => controller.createExample(instance, data), + }); + res.status(201).json(response); + }); + } +} +``` + +#### DTO Pattern (Simple Classes) +```typescript +// CORRECT - Evolution API pattern (no decorators) +export class ExampleDto { + name: string; + description?: string; + enabled: boolean; +} + +// INCORRECT - Don't use class-validator decorators +export class BadExampleDto { + @IsString() // ❌ Evolution API doesn't use decorators + name: string; +} +``` + +#### Validation Pattern (JSONSchema7) +```typescript +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +export const exampleSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + name: { type: 'string' }, + description: { type: 'string' }, + enabled: { type: 'boolean' }, + }, + required: ['name', 'enabled'], +}; +``` + +## Multi-Tenant Architecture + +### Instance Isolation +- **CRITICAL**: All operations must be scoped by `instanceName` or `instanceId` +- **Database queries**: Always include `where: { instanceId: ... }` +- **Authentication**: Validate instance ownership before operations +- **Data isolation**: Complete separation between tenant instances + +### WhatsApp Instance Management +```typescript +// Access instance via WAMonitoringService +const waInstance = this.waMonitor.waInstances[instance.instanceName]; +if (!waInstance) { + throw new NotFoundException(`Instance ${instance.instanceName} not found`); +} +``` + +## Database Patterns + +### Multi-Provider Support +- **PostgreSQL**: Uses `@db.Integer`, `@db.JsonB`, `@default(now())` +- **MySQL**: Uses `@db.Int`, `@db.Json`, `@default(now())` +- **Environment**: Set `DATABASE_PROVIDER=postgresql` or `mysql` +- **Migrations**: Provider-specific folders auto-selected + +### Prisma Repository Pattern +```typescript +// Always use PrismaRepository for database operations +const result = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName }, +}); +``` + +## Integration Patterns + +### Channel Integration (WhatsApp Providers) +- **Baileys**: WhatsApp Web with QR code authentication +- **Business API**: Official Meta WhatsApp Business API +- **Evolution API**: Custom WhatsApp integration +- **Pattern**: Extend base channel service classes + +### Chatbot Integration +- **Base classes**: Extend `BaseChatbotService` and `BaseChatbotController` +- **Trigger system**: Support keyword, regex, and advanced triggers +- **Session management**: Handle conversation state per user +- **Available integrations**: EvolutionBot, OpenAI, Dify, Typebot, Chatwoot, Flowise, N8N, EvoAI + +### Event Integration +- **Internal events**: EventEmitter2 for application events +- **External events**: WebSocket, RabbitMQ, SQS, NATS, Pusher +- **Webhook delivery**: Reliable delivery with retry logic ## Testing Guidelines -- No formal suite yet. Place tests under `test/` as `*.test.ts`. -- Run `npm test` (watches `test/all.test.ts` if present). Prefer fast, isolated unit tests. + +### Current State +- **No formal test suite** currently implemented +- **Manual testing** is the primary approach +- **Integration testing** in development environment + +### Testing Strategy +```typescript +// Place tests in test/ directory as *.test.ts +// Run: npm test (watches test/all.test.ts) + +describe('ExampleService', () => { + it('should create example', async () => { + // Mock external dependencies + // Test business logic + // Assert expected behavior + }); +}); +``` + +### Recommended Approach +- Focus on **critical business logic** in services +- **Mock external dependencies** (WhatsApp APIs, databases) +- **Integration tests** for API endpoints +- **Manual testing** for WhatsApp connection flows ## Commit & Pull Request Guidelines -- Conventional Commits enforced by commitlint. Use `npm run commit` (Commitizen). - - Examples: `feat(api): add message status`, `fix(route): handle 404 on send`. -- PRs: include clear description, linked issues, migration impact (provider), local run steps, and screenshots/logs where relevant. + +### Conventional Commits (Enforced by commitlint) +```bash +# Use interactive commit tool +npm run commit + +# Commit format: type(scope): subject (max 100 chars) +# Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert, security +``` + +### Examples +- `feat(api): add WhatsApp message status endpoint` +- `fix(baileys): resolve connection timeout issue` +- `docs(readme): update installation instructions` +- `refactor(service): extract common message validation logic` + +### Pull Request Requirements +- **Clear description** of changes and motivation +- **Linked issues** if applicable +- **Migration impact** (specify database provider) +- **Local testing steps** with screenshots/logs +- **Breaking changes** clearly documented ## Security & Configuration -- Copy `.env.example` to `.env`; never commit secrets. -- Set `DATABASE_PROVIDER` before DB commands; see `SECURITY.md` for reporting vulnerabilities. + +### Environment Setup +```bash +# Copy example environment file +cp .env.example .env + +# NEVER commit secrets to version control +# Set DATABASE_PROVIDER before database commands +export DATABASE_PROVIDER=postgresql # or mysql +``` + +### Security Best Practices +- **API key authentication** via `apikey` header +- **Input validation** with JSONSchema7 +- **Rate limiting** on all endpoints +- **Webhook signature validation** +- **Instance-based access control** +- **Secure defaults** for all configurations + +### Vulnerability Reporting +- See `SECURITY.md` for security vulnerability reporting process +- Contact: `contato@evolution-api.com` + +## Communication Standards + +### Language Requirements +- **User communication**: Always respond in Portuguese (PT-BR) +- **Code/comments**: English for technical documentation +- **API responses**: English for consistency +- **Error messages**: Portuguese for user-facing errors + +### Documentation Standards +- **Inline comments**: Document complex business logic +- **API documentation**: Document all public endpoints +- **Integration guides**: Document new integration patterns +- **Migration guides**: Document database schema changes + +## Performance & Scalability + +### Caching Strategy +- **Redis primary**: Distributed caching for production +- **Node-cache fallback**: Local caching when Redis unavailable +- **TTL strategy**: Appropriate cache expiration per data type +- **Cache invalidation**: Proper invalidation on data changes + +### Connection Management +- **Database**: Prisma connection pooling +- **WhatsApp**: One connection per instance with lifecycle management +- **Redis**: Connection pooling and retry logic +- **External APIs**: Rate limiting and retry with exponential backoff + +### Monitoring & Observability +- **Structured logging**: Pino logger with correlation IDs +- **Error tracking**: Comprehensive error scenarios +- **Health checks**: Instance status and connection monitoring +- **Telemetry**: Usage analytics (non-sensitive data only) diff --git a/CLAUDE.md b/CLAUDE.md index 949045d8..7c0e87a0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,10 +1,15 @@ # CLAUDE.md -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +This file provides comprehensive guidance to Claude AI when working with the Evolution API codebase. ## Project Overview -Evolution API is a REST API for WhatsApp communication that supports both Baileys (WhatsApp Web) and official WhatsApp Business API. It's built with TypeScript/Node.js and provides extensive integrations with various platforms. +**Evolution API** is a powerful, production-ready REST API for WhatsApp communication that supports multiple WhatsApp providers: +- **Baileys** (WhatsApp Web) - Open-source WhatsApp Web client +- **Meta Business API** - Official WhatsApp Business API +- **Evolution API** - Custom WhatsApp integration + +Built with **Node.js 20+**, **TypeScript 5+**, and **Express.js**, it provides extensive integrations with chatbots, CRM systems, and messaging platforms in a **multi-tenant architecture**. ## Common Development Commands @@ -30,13 +35,20 @@ npm run commit # Interactive commit with commitizen ### Database Management ```bash +# Set database provider first +export DATABASE_PROVIDER=postgresql # or mysql + # Generate Prisma client (automatically uses DATABASE_PROVIDER env) npm run db:generate -# Deploy migrations +# Deploy migrations (production) npm run db:deploy # Unix/Mac npm run db:deploy:win # Windows +# Development migrations (with sync to provider folder) +npm run db:migrate:dev # Unix/Mac +npm run db:migrate:dev:win # Windows + # Open Prisma Studio npm run db:studio @@ -53,42 +65,64 @@ npm test # Run tests with watch mode ## Architecture Overview ### Core Structure -- **Multi-provider database support**: PostgreSQL and MySQL via Prisma ORM with provider-specific schemas -- **Connection management**: Each WhatsApp instance maintains its own connection state and session -- **Event-driven architecture**: Uses EventEmitter2 for internal events and supports multiple external event systems +- **Multi-tenant SaaS**: Complete instance isolation with per-tenant authentication +- **Multi-provider database**: PostgreSQL and MySQL via Prisma ORM with provider-specific schemas and migrations +- **WhatsApp integrations**: Baileys, Meta Business API, and Evolution API with unified interface +- **Event-driven architecture**: EventEmitter2 for internal events + WebSocket, RabbitMQ, SQS, NATS, Pusher for external events +- **Microservices pattern**: Modular integrations for chatbots, storage, and external services ### Directory Layout ``` src/ ├── api/ -│ ├── controllers/ # HTTP route handlers -│ ├── services/ # Business logic +│ ├── controllers/ # HTTP route handlers (thin layer) +│ ├── services/ # Business logic (core functionality) │ ├── repository/ # Data access layer (Prisma) -│ ├── dto/ # Data validation schemas -│ ├── guards/ # Authentication/authorization +│ ├── dto/ # Data Transfer Objects (simple classes) +│ ├── guards/ # Authentication/authorization middleware │ ├── integrations/ # External service integrations -│ └── routes/ # Express route definitions +│ │ ├── channel/ # WhatsApp providers (Baileys, Business API, Evolution) +│ │ ├── chatbot/ # AI/Bot integrations (OpenAI, Dify, Typebot, Chatwoot) +│ │ ├── event/ # Event systems (WebSocket, RabbitMQ, SQS, NATS, Pusher) +│ │ └── storage/ # File storage (S3, MinIO) +│ ├── routes/ # Express route definitions (RouterBroker pattern) +│ └── types/ # TypeScript type definitions ├── config/ # Environment and app configuration ├── cache/ # Redis and local cache implementations -├── exceptions/ # Custom exception classes -├── utils/ # Shared utilities -└── validate/ # Validation schemas +├── exceptions/ # Custom HTTP exception classes +├── utils/ # Shared utilities and helpers +└── validate/ # JSONSchema7 validation schemas ``` -### Key Services Integration Points +### Key Integration Points -**WhatsApp Service** (`src/api/integrations/channel/whatsapp/`): -- Manages Baileys connections and Meta Business API -- Handles message sending, receiving, and status updates -- Connection lifecycle management per instance +**Channel Integrations** (`src/api/integrations/channel/`): +- **Baileys**: WhatsApp Web client with QR code authentication +- **Business API**: Official Meta WhatsApp Business API +- **Evolution API**: Custom WhatsApp integration +- Connection lifecycle management per instance with automatic reconnection -**Integration Services** (`src/api/integrations/`): -- Chatwoot: Customer service platform integration -- Typebot: Conversational bot builder -- OpenAI: AI capabilities including audio transcription -- Dify: AI agent platform -- RabbitMQ/SQS: Message queue integrations -- S3/Minio: Media storage +**Chatbot Integrations** (`src/api/integrations/chatbot/`): +- **EvolutionBot**: Native chatbot with trigger system +- **Chatwoot**: Customer service platform integration +- **Typebot**: Visual chatbot flow builder +- **OpenAI**: AI capabilities including GPT and Whisper (audio transcription) +- **Dify**: AI agent workflow platform +- **Flowise**: LangChain visual builder +- **N8N**: Workflow automation platform +- **EvoAI**: Custom AI integration + +**Event Integrations** (`src/api/integrations/event/`): +- **WebSocket**: Real-time Socket.io connections +- **RabbitMQ**: Message queue for async processing +- **Amazon SQS**: Cloud-based message queuing +- **NATS**: High-performance messaging system +- **Pusher**: Real-time push notifications + +**Storage Integrations** (`src/api/integrations/storage/`): +- **AWS S3**: Cloud object storage +- **MinIO**: Self-hosted S3-compatible storage +- Media file management and URL generation ### Database Schema Management - Separate schema files: `postgresql-schema.prisma` and `mysql-schema.prisma` @@ -96,10 +130,12 @@ src/ - Migration folders are provider-specific and auto-selected during deployment ### Authentication & Security -- API key-based authentication via `apikey` header -- Instance-specific authentication for WhatsApp connections -- Guards system for route protection -- Input validation using `class-validator` +- **API key-based authentication** via `apikey` header (global or per-instance) +- **Instance-specific tokens** for WhatsApp connection authentication +- **Guards system** for route protection and authorization +- **Input validation** using JSONSchema7 with RouterBroker `dataValidate` +- **Rate limiting** and security middleware +- **Webhook signature validation** for external integrations ## Important Implementation Details @@ -136,24 +172,47 @@ Critical configurations: - `REDIS_ENABLED`: Enable Redis cache - `RABBITMQ_ENABLED`/`SQS_ENABLED`: Message queue options -## Development Guidelines from Cursor Instructions +## Development Guidelines -The project includes specific development instructions in `.cursor/instructions`: -- Always respond in Portuguese Brazilian -- Follow established architecture patterns -- Robust error handling with retry logic -- Multi-database compatibility requirements -- Security validations and rate limiting -- Performance optimizations with caching -- Minimum 70% test coverage target +The project follows comprehensive development standards defined in `.cursor/rules/`: + +### Core Principles +- **Always respond in Portuguese (PT-BR)** for user communication +- **Follow established architecture patterns** (Service Layer, RouterBroker, etc.) +- **Robust error handling** with retry logic and graceful degradation +- **Multi-database compatibility** (PostgreSQL and MySQL) +- **Security-first approach** with input validation and rate limiting +- **Performance optimizations** with Redis caching and connection pooling + +### Code Standards +- **TypeScript strict mode** with full type coverage +- **JSONSchema7** for input validation (not class-validator) +- **Conventional Commits** enforced by commitlint +- **ESLint + Prettier** for code formatting +- **Service Object pattern** for business logic +- **RouterBroker pattern** for route handling with `dataValidate` + +### Architecture Patterns +- **Multi-tenant isolation** at database and instance level +- **Event-driven communication** with EventEmitter2 +- **Microservices integration** pattern for external services +- **Connection pooling** and lifecycle management +- **Caching strategy** with Redis primary and Node-cache fallback ## Testing Approach -Tests are located alongside source files or in dedicated test directories. The project uses: -- Unit tests for services -- Integration tests for critical APIs -- Mock external dependencies -- Test command runs with watch mode for development +Currently, the project has minimal formal testing infrastructure: +- **Manual testing** is the primary approach +- **Integration testing** in development environment +- **No unit test suite** currently implemented +- Test files can be placed in `test/` directory as `*.test.ts` +- Run `npm test` for watch mode development testing + +### Recommended Testing Strategy +- Focus on **critical business logic** in services +- **Mock external dependencies** (WhatsApp APIs, databases) +- **Integration tests** for API endpoints +- **Manual testing** for WhatsApp connection flows ## Deployment Considerations From 3ddbd6a7fb4c4ca9b951cfeae0570a17a137e356 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 16:50:36 -0300 Subject: [PATCH 086/129] feat(config): add telemetry and metrics configuration options - Introduce new environment variables for telemetry and Prometheus metrics in .env.example - Create example configuration files for Prometheus and Grafana dashboards - Update main application to utilize new configuration settings for Sentry, audio converter, and proxy - Enhance channel services to support audio conversion API integration - Implement middleware for metrics IP whitelisting and basic authentication in routes --- .env.example | 22 ++ grafana-dashboard.json.example | 238 ++++++++++++++++++ prometheus.yml.example | 76 ++++++ .../evolution/evolution.channel.service.ts | 9 +- .../channel/meta/whatsapp.business.service.ts | 9 +- .../whatsapp/whatsapp.baileys.service.ts | 8 +- .../event/websocket/websocket.controller.ts | 4 +- .../storage/s3/libs/minio.server.ts | 2 +- src/api/routes/index.router.ts | 72 +++++- src/api/services/channel.service.ts | 15 +- src/config/env.config.ts | 82 ++++++ src/config/event.config.ts | 5 +- src/main.ts | 13 +- src/utils/instrumentSentry.ts | 7 +- src/utils/sendTelemetry.ts | 9 +- src/utils/use-multi-file-auth-state-prisma.ts | 11 +- 16 files changed, 538 insertions(+), 44 deletions(-) create mode 100644 grafana-dashboard.json.example create mode 100644 prometheus.yml.example diff --git a/.env.example b/.env.example index 07dbac77..52644bea 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,28 @@ SSL_CONF_FULLCHAIN=/path/to/cert.crt SENTRY_DSN= +# Telemetry - Set to false to disable telemetry +TELEMETRY_ENABLED=true +TELEMETRY_URL= + +# Prometheus metrics - Set to true to enable Prometheus metrics +PROMETHEUS_METRICS=false +METRICS_AUTH_REQUIRED=true +METRICS_USER=prometheus +METRICS_PASSWORD=secure_random_password_here +METRICS_ALLOWED_IPS=127.0.0.1,10.0.0.100,192.168.1.50 + +# Proxy configuration (optional) +PROXY_HOST= +PROXY_PORT= +PROXY_PROTOCOL= +PROXY_USERNAME= +PROXY_PASSWORD= + +# Audio converter API (optional) +API_AUDIO_CONVERTER= +API_AUDIO_CONVERTER_KEY= + # Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com' CORS_ORIGIN=* CORS_METHODS=GET,POST,PUT,DELETE diff --git a/grafana-dashboard.json.example b/grafana-dashboard.json.example new file mode 100644 index 00000000..f85eb9d6 --- /dev/null +++ b/grafana-dashboard.json.example @@ -0,0 +1,238 @@ +{ + "dashboard": { + "id": null, + "title": "Evolution API Monitoring", + "tags": ["evolution-api", "whatsapp", "monitoring"], + "style": "dark", + "timezone": "browser", + "panels": [ + { + "id": 1, + "title": "API Status", + "type": "stat", + "targets": [ + { + "expr": "up{job=\"evolution-api\"}", + "legendFormat": "API Status" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + { + "options": { + "0": { + "text": "DOWN", + "color": "red" + }, + "1": { + "text": "UP", + "color": "green" + } + }, + "type": "value" + } + ] + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + } + }, + { + "id": 2, + "title": "Total Instances", + "type": "stat", + "targets": [ + { + "expr": "evolution_instances_total", + "legendFormat": "Total Instances" + } + ], + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + } + }, + { + "id": 3, + "title": "Instance Status Overview", + "type": "piechart", + "targets": [ + { + "expr": "sum by (state) (evolution_instance_state)", + "legendFormat": "{{ state }}" + } + ], + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 8 + } + }, + { + "id": 4, + "title": "Instances by Integration Type", + "type": "piechart", + "targets": [ + { + "expr": "sum by (integration) (evolution_instance_up)", + "legendFormat": "{{ integration }}" + } + ], + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 8 + } + }, + { + "id": 5, + "title": "Instance Uptime", + "type": "table", + "targets": [ + { + "expr": "evolution_instance_up", + "format": "table", + "instant": true + } + ], + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true + }, + "renameByName": { + "instance": "Instance Name", + "integration": "Integration Type", + "Value": "Status" + } + } + } + ], + "fieldConfig": { + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "0": { + "text": "DOWN", + "color": "red" + }, + "1": { + "text": "UP", + "color": "green" + } + }, + "type": "value" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 17 + } + }, + { + "id": 6, + "title": "Instance Status Timeline", + "type": "timeseries", + "targets": [ + { + "expr": "evolution_instance_up", + "legendFormat": "{{ instance }} ({{ integration }})" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "stepAfter", + "lineWidth": 2, + "fillOpacity": 10, + "gradientMode": "none", + "spanNulls": false, + "insertNulls": false, + "showPoints": "never", + "pointSize": 5, + "stacking": { + "mode": "none", + "group": "A" + }, + "axisPlacement": "auto", + "axisLabel": "", + "scaleDistribution": { + "type": "linear" + }, + "hideFrom": { + "legend": false, + "tooltip": false, + "vis": false + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "min": 0, + "max": 1 + } + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 26 + } + } + ], + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "templating": { + "list": [] + }, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "refresh": "30s", + "schemaVersion": 27, + "version": 0, + "links": [] + } +} diff --git a/prometheus.yml.example b/prometheus.yml.example new file mode 100644 index 00000000..bcb3b332 --- /dev/null +++ b/prometheus.yml.example @@ -0,0 +1,76 @@ +# Prometheus configuration example for Evolution API +# Copy this file to prometheus.yml and adjust the settings + +global: + scrape_interval: 15s + evaluation_interval: 15s + +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +scrape_configs: + # Evolution API metrics + - job_name: 'evolution-api' + static_configs: + - targets: ['localhost:8080'] # Adjust to your Evolution API URL + + # Metrics endpoint path + metrics_path: '/metrics' + + # Scrape interval for this job + scrape_interval: 30s + + # Basic authentication (if METRICS_AUTH_REQUIRED=true) + basic_auth: + username: 'prometheus' # Should match METRICS_USER + password: 'secure_random_password_here' # Should match METRICS_PASSWORD + + # Optional: Add custom labels + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: localhost:8080 # Evolution API address + +# Alerting configuration (optional) +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Example alert rules for Evolution API +# Create a file called evolution_alerts.yml with these rules: +# +# groups: +# - name: evolution-api +# rules: +# - alert: EvolutionAPIDown +# expr: up{job="evolution-api"} == 0 +# for: 1m +# labels: +# severity: critical +# annotations: +# summary: "Evolution API is down" +# description: "Evolution API has been down for more than 1 minute." +# +# - alert: EvolutionInstanceDown +# expr: evolution_instance_up == 0 +# for: 2m +# labels: +# severity: warning +# annotations: +# summary: "Evolution instance {{ $labels.instance }} is down" +# description: "Instance {{ $labels.instance }} has been down for more than 2 minutes." +# +# - alert: HighInstanceCount +# expr: evolution_instances_total > 100 +# for: 5m +# labels: +# severity: warning +# annotations: +# summary: "High number of Evolution instances" +# description: "Evolution API is managing {{ $value }} instances." diff --git a/src/api/integrations/channel/evolution/evolution.channel.service.ts b/src/api/integrations/channel/evolution/evolution.channel.service.ts index 1b4773ce..820218b1 100644 --- a/src/api/integrations/channel/evolution/evolution.channel.service.ts +++ b/src/api/integrations/channel/evolution/evolution.channel.service.ts @@ -13,7 +13,7 @@ import { chatbotController } from '@api/server.module'; import { CacheService } from '@api/services/cache.service'; import { ChannelStartupService } from '@api/services/channel.service'; import { Events, wa } from '@api/types/wa.types'; -import { Chatwoot, ConfigService, Openai, S3 } from '@config/env.config'; +import { AudioConverter, Chatwoot, ConfigService, Openai, S3 } from '@config/env.config'; import { BadRequestException, InternalServerErrorException } from '@exceptions'; import { createJid } from '@utils/createJid'; import axios from 'axios'; @@ -622,7 +622,8 @@ export class EvolutionStartupService extends ChannelStartupService { number = number.replace(/\D/g, ''); const hash = `${number}-${new Date().getTime()}`; - if (process.env.API_AUDIO_CONVERTER) { + const audioConverterConfig = this.configService.get('AUDIO_CONVERTER'); + if (audioConverterConfig.API_URL) { try { this.logger.verbose('Using audio converter API'); const formData = new FormData(); @@ -640,10 +641,10 @@ export class EvolutionStartupService extends ChannelStartupService { formData.append('format', 'mp4'); - const response = await axios.post(process.env.API_AUDIO_CONVERTER, formData, { + const response = await axios.post(audioConverterConfig.API_URL, formData, { headers: { ...formData.getHeaders(), - apikey: process.env.API_AUDIO_CONVERTER_KEY, + apikey: audioConverterConfig.API_KEY, }, }); diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index 66847f82..a88f85e9 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -20,7 +20,7 @@ import { chatbotController } from '@api/server.module'; import { CacheService } from '@api/services/cache.service'; import { ChannelStartupService } from '@api/services/channel.service'; import { Events, wa } from '@api/types/wa.types'; -import { Chatwoot, ConfigService, Database, Openai, S3, WaBusiness } from '@config/env.config'; +import { AudioConverter, Chatwoot, ConfigService, Database, Openai, S3, WaBusiness } from '@config/env.config'; import { BadRequestException, InternalServerErrorException } from '@exceptions'; import { createJid } from '@utils/createJid'; import { status } from '@utils/renderStatus'; @@ -1300,7 +1300,8 @@ export class BusinessStartupService extends ChannelStartupService { number = number.replace(/\D/g, ''); const hash = `${number}-${new Date().getTime()}`; - if (process.env.API_AUDIO_CONVERTER) { + const audioConverterConfig = this.configService.get('AUDIO_CONVERTER'); + if (audioConverterConfig.API_URL) { this.logger.verbose('Using audio converter API'); const formData = new FormData(); @@ -1317,10 +1318,10 @@ export class BusinessStartupService extends ChannelStartupService { formData.append('format', 'mp3'); - const response = await axios.post(process.env.API_AUDIO_CONVERTER, formData, { + const response = await axios.post(audioConverterConfig.API_URL, formData, { headers: { ...formData.getHeaders(), - apikey: process.env.API_AUDIO_CONVERTER_KEY, + apikey: audioConverterConfig.API_KEY, }, }); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 44c66434..acacb9b7 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -62,6 +62,7 @@ import { ChannelStartupService } from '@api/services/channel.service'; import { Events, MessageSubtype, TypeMediaMessage, wa } from '@api/types/wa.types'; import { CacheEngine } from '@cache/cacheengine'; import { + AudioConverter, CacheConf, Chatwoot, ConfigService, @@ -2837,7 +2838,8 @@ export class BaileysStartupService extends ChannelStartupService { } public async processAudio(audio: string): Promise { - if (process.env.API_AUDIO_CONVERTER) { + const audioConverterConfig = this.configService.get('AUDIO_CONVERTER'); + if (audioConverterConfig.API_URL) { this.logger.verbose('Using audio converter API'); const formData = new FormData(); @@ -2847,8 +2849,8 @@ export class BaileysStartupService extends ChannelStartupService { formData.append('base64', audio); } - const { data } = await axios.post(process.env.API_AUDIO_CONVERTER, formData, { - headers: { ...formData.getHeaders(), apikey: process.env.API_AUDIO_CONVERTER_KEY }, + const { data } = await axios.post(audioConverterConfig.API_URL, formData, { + headers: { ...formData.getHeaders(), apikey: audioConverterConfig.API_KEY }, }); if (!data.audio) { diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index 728c7644..72435234 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -31,7 +31,9 @@ export class WebsocketController extends EventController implements EventControl const params = new URLSearchParams(url.search); const { remoteAddress } = req.socket; - const isAllowedHost = (process.env.WEBSOCKET_ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1') + const websocketConfig = configService.get('WEBSOCKET'); + const allowedHosts = websocketConfig.ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1'; + const isAllowedHost = allowedHosts .split(',') .map((h) => h.trim()) .includes(remoteAddress); diff --git a/src/api/integrations/storage/s3/libs/minio.server.ts b/src/api/integrations/storage/s3/libs/minio.server.ts index 30c81876..8d296fdc 100644 --- a/src/api/integrations/storage/s3/libs/minio.server.ts +++ b/src/api/integrations/storage/s3/libs/minio.server.ts @@ -26,7 +26,7 @@ const minioClient = (() => { } })(); -const bucketName = process.env.S3_BUCKET; +const bucketName = BUCKET.BUCKET_NAME; const bucketExists = async () => { if (minioClient) { diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index f1a86393..7ef197de 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -6,9 +6,9 @@ import { ChatbotRouter } from '@api/integrations/chatbot/chatbot.router'; import { EventRouter } from '@api/integrations/event/event.router'; import { StorageRouter } from '@api/integrations/storage/storage.router'; import { waMonitor } from '@api/server.module'; -import { configService } from '@config/env.config'; +import { configService, Database, Facebook } from '@config/env.config'; import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion'; -import { Router } from 'express'; +import { NextFunction, Request, Response, Router } from 'express'; import fs from 'fs'; import mimeTypes from 'mime-types'; import path from 'path'; @@ -37,15 +37,68 @@ enum HttpStatus { const router: Router = Router(); const serverConfig = configService.get('SERVER'); +const databaseConfig = configService.get('DATABASE'); const guards = [instanceExistsGuard, instanceLoggedGuard, authGuard['apikey']]; const telemetry = new Telemetry(); const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); +// Middleware for metrics IP whitelist +const metricsIPWhitelist = (req: Request, res: Response, next: NextFunction) => { + const metricsConfig = configService.get('METRICS'); + const allowedIPs = metricsConfig.ALLOWED_IPS?.split(',').map((ip) => ip.trim()) || ['127.0.0.1']; + const clientIP = req.ip || req.connection.remoteAddress || req.socket.remoteAddress; + + if (!allowedIPs.includes(clientIP)) { + return res.status(403).send('Forbidden: IP not allowed'); + } + + next(); +}; + +// Middleware for metrics Basic Authentication +const metricsBasicAuth = (req: Request, res: Response, next: NextFunction) => { + const metricsConfig = configService.get('METRICS'); + const metricsUser = metricsConfig.USER; + const metricsPass = metricsConfig.PASSWORD; + + if (!metricsUser || !metricsPass) { + return res.status(500).send('Metrics authentication not configured'); + } + + const auth = req.get('Authorization'); + if (!auth || !auth.startsWith('Basic ')) { + res.set('WWW-Authenticate', 'Basic realm="Evolution API Metrics"'); + return res.status(401).send('Authentication required'); + } + + const credentials = Buffer.from(auth.slice(6), 'base64').toString(); + const [user, pass] = credentials.split(':'); + + if (user !== metricsUser || pass !== metricsPass) { + return res.status(401).send('Invalid credentials'); + } + + next(); +}; + // Expose Prometheus metrics when enabled by env flag -if (process.env.PROMETHEUS_METRICS === 'true') { - router.get('/metrics', async (req, res) => { +const metricsConfig = configService.get('METRICS'); +if (metricsConfig.ENABLED) { + const metricsMiddleware = []; + + // Add IP whitelist if configured + if (metricsConfig.ALLOWED_IPS) { + metricsMiddleware.push(metricsIPWhitelist); + } + + // Add Basic Auth if required + if (metricsConfig.AUTH_REQUIRED) { + metricsMiddleware.push(metricsBasicAuth); + } + + router.get('/metrics', ...metricsMiddleware, async (req, res) => { res.set('Content-Type', 'text/plain; version=0.0.4; charset=utf-8'); res.set('Cache-Control', 'no-cache, no-store, must-revalidate'); @@ -57,7 +110,7 @@ if (process.env.PROMETHEUS_METRICS === 'true') { const lines: string[] = []; - const clientName = process.env.DATABASE_CONNECTION_CLIENT_NAME || 'unknown'; + const clientName = databaseConfig.CONNECTION.CLIENT_NAME || 'unknown'; const serverUrl = serverConfig.URL || ''; // environment info @@ -140,19 +193,20 @@ router status: HttpStatus.OK, message: 'Welcome to the Evolution API, it is working!', version: packageJson.version, - clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME, + clientName: databaseConfig.CONNECTION.CLIENT_NAME, manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined, documentation: `https://doc.evolution-api.com`, whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'), }); }) .post('/verify-creds', authGuard['apikey'], async (req, res) => { + const facebookConfig = configService.get('FACEBOOK'); return res.status(HttpStatus.OK).json({ status: HttpStatus.OK, message: 'Credentials are valid', - facebookAppId: process.env.FACEBOOK_APP_ID, - facebookConfigId: process.env.FACEBOOK_CONFIG_ID, - facebookUserToken: process.env.FACEBOOK_USER_TOKEN, + facebookAppId: facebookConfig.APP_ID, + facebookConfigId: facebookConfig.CONFIG_ID, + facebookUserToken: facebookConfig.USER_TOKEN, }); }) .use('/instance', new InstanceRouter(configService, ...guards).router) diff --git a/src/api/services/channel.service.ts b/src/api/services/channel.service.ts index dc754ab6..4b39520e 100644 --- a/src/api/services/channel.service.ts +++ b/src/api/services/channel.service.ts @@ -9,7 +9,7 @@ import { TypebotService } from '@api/integrations/chatbot/typebot/services/typeb import { PrismaRepository, Query } from '@api/repository/repository.service'; import { eventManager, waMonitor } from '@api/server.module'; import { Events, wa } from '@api/types/wa.types'; -import { Auth, Chatwoot, ConfigService, HttpServer } from '@config/env.config'; +import { Auth, Chatwoot, ConfigService, HttpServer, Proxy } from '@config/env.config'; import { Logger } from '@config/logger.config'; import { NotFoundException } from '@exceptions'; import { Contact, Message, Prisma } from '@prisma/client'; @@ -364,13 +364,14 @@ export class ChannelStartupService { public async loadProxy() { this.localProxy.enabled = false; - if (process.env.PROXY_HOST) { + const proxyConfig = this.configService.get('PROXY'); + if (proxyConfig.HOST) { this.localProxy.enabled = true; - this.localProxy.host = process.env.PROXY_HOST; - this.localProxy.port = process.env.PROXY_PORT || '80'; - this.localProxy.protocol = process.env.PROXY_PROTOCOL || 'http'; - this.localProxy.username = process.env.PROXY_USERNAME; - this.localProxy.password = process.env.PROXY_PASSWORD; + this.localProxy.host = proxyConfig.HOST; + this.localProxy.port = proxyConfig.PORT || '80'; + this.localProxy.protocol = proxyConfig.PROTOCOL || 'http'; + this.localProxy.username = proxyConfig.USERNAME; + this.localProxy.password = proxyConfig.PASSWORD; } const data = await this.prismaRepository.proxy.findUnique({ diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 98ffc1de..66e0b000 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -156,6 +156,7 @@ export type Sqs = { export type Websocket = { ENABLED: boolean; GLOBAL_EVENTS: boolean; + ALLOWED_HOSTS?: string; }; export type WaBusiness = { @@ -320,6 +321,46 @@ export type S3 = { }; export type CacheConf = { REDIS: CacheConfRedis; LOCAL: CacheConfLocal }; +export type Metrics = { + ENABLED: boolean; + AUTH_REQUIRED: boolean; + USER?: string; + PASSWORD?: string; + ALLOWED_IPS?: string; +}; + +export type Telemetry = { + ENABLED: boolean; + URL?: string; +}; + +export type Proxy = { + HOST?: string; + PORT?: string; + PROTOCOL?: string; + USERNAME?: string; + PASSWORD?: string; +}; + +export type AudioConverter = { + API_URL?: string; + API_KEY?: string; +}; + +export type Facebook = { + APP_ID?: string; + CONFIG_ID?: string; + USER_TOKEN?: string; +}; + +export type Sentry = { + DSN?: string; +}; + +export type EventEmitter = { + MAX_LISTENERS: number; +}; + export type Production = boolean; export interface Env { @@ -351,6 +392,13 @@ export interface Env { CACHE: CacheConf; S3?: S3; AUTHENTICATION: Auth; + METRICS: Metrics; + TELEMETRY: Telemetry; + PROXY: Proxy; + AUDIO_CONVERTER: AudioConverter; + FACEBOOK: Facebook; + SENTRY: Sentry; + EVENT_EMITTER: EventEmitter; PRODUCTION?: Production; } @@ -542,6 +590,7 @@ export class ConfigService { WEBSOCKET: { ENABLED: process.env?.WEBSOCKET_ENABLED === 'true', GLOBAL_EVENTS: process.env?.WEBSOCKET_GLOBAL_EVENTS === 'true', + ALLOWED_HOSTS: process.env?.WEBSOCKET_ALLOWED_HOSTS, }, PUSHER: { ENABLED: process.env?.PUSHER_ENABLED === 'true', @@ -730,6 +779,39 @@ export class ConfigService { }, EXPOSE_IN_FETCH_INSTANCES: process.env?.AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES === 'true', }, + METRICS: { + ENABLED: process.env?.PROMETHEUS_METRICS === 'true', + AUTH_REQUIRED: process.env?.METRICS_AUTH_REQUIRED === 'true', + USER: process.env?.METRICS_USER, + PASSWORD: process.env?.METRICS_PASSWORD, + ALLOWED_IPS: process.env?.METRICS_ALLOWED_IPS, + }, + TELEMETRY: { + ENABLED: process.env?.TELEMETRY_ENABLED === undefined || process.env?.TELEMETRY_ENABLED === 'true', + URL: process.env?.TELEMETRY_URL, + }, + PROXY: { + HOST: process.env?.PROXY_HOST, + PORT: process.env?.PROXY_PORT, + PROTOCOL: process.env?.PROXY_PROTOCOL, + USERNAME: process.env?.PROXY_USERNAME, + PASSWORD: process.env?.PROXY_PASSWORD, + }, + AUDIO_CONVERTER: { + API_URL: process.env?.API_AUDIO_CONVERTER, + API_KEY: process.env?.API_AUDIO_CONVERTER_KEY, + }, + FACEBOOK: { + APP_ID: process.env?.FACEBOOK_APP_ID, + CONFIG_ID: process.env?.FACEBOOK_CONFIG_ID, + USER_TOKEN: process.env?.FACEBOOK_USER_TOKEN, + }, + SENTRY: { + DSN: process.env?.SENTRY_DSN, + }, + EVENT_EMITTER: { + MAX_LISTENERS: Number.parseInt(process.env?.EVENT_EMITTER_MAX_LISTENERS) || 50, + }, }; } } diff --git a/src/config/event.config.ts b/src/config/event.config.ts index 20cd1e40..ab9d05a8 100644 --- a/src/config/event.config.ts +++ b/src/config/event.config.ts @@ -1,10 +1,11 @@ +import { configService, EventEmitter as EventEmitterConfig } from '@config/env.config'; import EventEmitter2 from 'eventemitter2'; -const maxListeners = parseInt(process.env.EVENT_EMITTER_MAX_LISTENERS, 10) || 50; +const eventEmitterConfig = configService.get('EVENT_EMITTER'); export const eventEmitter = new EventEmitter2({ delimiter: '.', newListener: false, ignoreErrors: false, - maxListeners: maxListeners, + maxListeners: eventEmitterConfig.MAX_LISTENERS, }); diff --git a/src/main.ts b/src/main.ts index cf787f32..44a6187b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,7 +6,15 @@ import { ProviderFiles } from '@api/provider/sessions'; import { PrismaRepository } from '@api/repository/repository.service'; import { HttpStatus, router } from '@api/routes/index.router'; import { eventManager, waMonitor } from '@api/server.module'; -import { Auth, configService, Cors, HttpServer, ProviderSession, Webhook } from '@config/env.config'; +import { + Auth, + configService, + Cors, + HttpServer, + ProviderSession, + Sentry as SentryConfig, + Webhook, +} from '@config/env.config'; import { onUnexpectedError } from '@config/error.config'; import { Logger } from '@config/logger.config'; import { ROOT_DIR } from '@config/path.config'; @@ -140,7 +148,8 @@ async function bootstrap() { eventManager.init(server); - if (process.env.SENTRY_DSN) { + const sentryConfig = configService.get('SENTRY'); + if (sentryConfig.DSN) { logger.info('Sentry - ON'); // Add this after all routes, diff --git a/src/utils/instrumentSentry.ts b/src/utils/instrumentSentry.ts index 1a87086f..a91eb772 100644 --- a/src/utils/instrumentSentry.ts +++ b/src/utils/instrumentSentry.ts @@ -1,10 +1,11 @@ +import { configService, Sentry as SentryConfig } from '@config/env.config'; import * as Sentry from '@sentry/node'; -const dsn = process.env.SENTRY_DSN; +const sentryConfig = configService.get('SENTRY'); -if (dsn) { +if (sentryConfig.DSN) { Sentry.init({ - dsn: dsn, + dsn: sentryConfig.DSN, environment: process.env.NODE_ENV || 'development', tracesSampleRate: 1.0, profilesSampleRate: 1.0, diff --git a/src/utils/sendTelemetry.ts b/src/utils/sendTelemetry.ts index 037ca55d..b2ebe05a 100644 --- a/src/utils/sendTelemetry.ts +++ b/src/utils/sendTelemetry.ts @@ -1,3 +1,4 @@ +import { configService, Telemetry } from '@config/env.config'; import axios from 'axios'; import fs from 'fs'; @@ -10,9 +11,9 @@ export interface TelemetryData { } export const sendTelemetry = async (route: string): Promise => { - const enabled = process.env.TELEMETRY_ENABLED === undefined || process.env.TELEMETRY_ENABLED === 'true'; + const telemetryConfig = configService.get('TELEMETRY'); - if (!enabled) { + if (!telemetryConfig.ENABLED) { return; } @@ -27,9 +28,7 @@ export const sendTelemetry = async (route: string): Promise => { }; const url = - process.env.TELEMETRY_URL && process.env.TELEMETRY_URL !== '' - ? process.env.TELEMETRY_URL - : 'https://log.evolution-api.com/telemetry'; + telemetryConfig.URL && telemetryConfig.URL !== '' ? telemetryConfig.URL : 'https://log.evolution-api.com/telemetry'; axios .post(url, telemetry) diff --git a/src/utils/use-multi-file-auth-state-prisma.ts b/src/utils/use-multi-file-auth-state-prisma.ts index 84d38fe4..7278c056 100644 --- a/src/utils/use-multi-file-auth-state-prisma.ts +++ b/src/utils/use-multi-file-auth-state-prisma.ts @@ -1,5 +1,6 @@ import { prismaRepository } from '@api/server.module'; import { CacheService } from '@api/services/cache.service'; +import { CacheConf, configService } from '@config/env.config'; import { INSTANCE_DIR } from '@config/path.config'; import { AuthenticationState, BufferJSON, initAuthCreds, WAProto as proto } from 'baileys'; import fs from 'fs/promises'; @@ -85,9 +86,10 @@ export default async function useMultiFileAuthStatePrisma( async function writeData(data: any, key: string): Promise { const dataString = JSON.stringify(data, BufferJSON.replacer); + const cacheConfig = configService.get('CACHE'); if (key != 'creds') { - if (process.env.CACHE_REDIS_ENABLED === 'true') { + if (cacheConfig.REDIS.ENABLED) { return await cache.hSet(sessionId, key, data); } else { await fs.writeFile(localFile(key), dataString); @@ -101,9 +103,10 @@ export default async function useMultiFileAuthStatePrisma( async function readData(key: string): Promise { try { let rawData; + const cacheConfig = configService.get('CACHE'); if (key != 'creds') { - if (process.env.CACHE_REDIS_ENABLED === 'true') { + if (cacheConfig.REDIS.ENABLED) { return await cache.hGet(sessionId, key); } else { if (!(await fileExists(localFile(key)))) return null; @@ -123,8 +126,10 @@ export default async function useMultiFileAuthStatePrisma( async function removeData(key: string): Promise { try { + const cacheConfig = configService.get('CACHE'); + if (key != 'creds') { - if (process.env.CACHE_REDIS_ENABLED === 'true') { + if (cacheConfig.REDIS.ENABLED) { return await cache.hDelete(sessionId, key); } else { await fs.unlink(localFile(key)); From 0a357089b3fd270afe8fe8a97688935fee8b6470 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 16:51:46 -0300 Subject: [PATCH 087/129] chore(commitlint): update line length rules for body and footer to 120 characters - Adjust body-max-line-length and footer-max-line-length in commitlint configuration to allow for longer lines, improving readability and accommodating more detailed commit messages. --- commitlint.config.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index 81322258..f234108b 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -27,8 +27,8 @@ module.exports = { 'subject-full-stop': [2, 'never', '.'], 'header-max-length': [2, 'always', 100], 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], + 'body-max-line-length': [2, 'always', 120], 'footer-leading-blank': [1, 'always'], - 'footer-max-line-length': [2, 'always', 100], + 'footer-max-line-length': [2, 'always', 120], }, }; diff --git a/package.json b/package.json index ebca32d0..e2bb16c1 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "eslint --fix" ], "src/**/*.ts": [ - "tsc --noEmit --incremental" + "sh -c 'npm run build'" ] }, "config": { From deb4494fc0dc9b1805bb0663f5499702c623835c Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 17 Sep 2025 16:52:03 -0300 Subject: [PATCH 088/129] chore(commitlint): increase body and footer line length limits to 150 characters - Update body-max-line-length and footer-max-line-length in commitlint configuration to allow for longer lines, enhancing readability and accommodating more detailed commit messages. --- commitlint.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index f234108b..9beb860b 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -27,8 +27,8 @@ module.exports = { 'subject-full-stop': [2, 'never', '.'], 'header-max-length': [2, 'always', 100], 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 120], + 'body-max-line-length': [0, 'always', 150], 'footer-leading-blank': [1, 'always'], - 'footer-max-line-length': [2, 'always', 120], + 'footer-max-line-length': [0, 'always', 150], }, }; From c6a7e2368bb71dc6f84cf9922d712f3b66a06a33 Mon Sep 17 00:00:00 2001 From: ricael Date: Thu, 18 Sep 2025 09:22:40 -0300 Subject: [PATCH 089/129] =?UTF-8?q?fix:=20ajustar=20a=20manipula=C3=A7?= =?UTF-8?q?=C3=A3o=20da=20chave=20remota=20da=20mensagem=20no=20servi?= =?UTF-8?q?=C3=A7o=20WhatsApp=20para=20incluir=20JID=20alternativo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index ace12e16..bc2b4643 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1349,6 +1349,10 @@ export class BaileysStartupService extends ChannelStartupService { } } + if (messageRaw.key.remoteJid?.includes('@lid') && messageRaw.key.remoteJidAlt) { + messageRaw.key.remoteJid = messageRaw.key.remoteJidAlt; + } + this.logger.log(messageRaw); this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw); From 250cb617481d100aaf0e42e47638b7b2498de3ec Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 14:17:39 -0300 Subject: [PATCH 090/129] chore(changelog): update version date for release 2.3.3 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbffdefa..9e78a762 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 2.3.3 (develop) +# 2.3.3 (2025-09-18) ### Features From 55125856fe41d43cc85d721744139ed3683b2f90 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 14:45:02 -0300 Subject: [PATCH 091/129] chore(docker): upgrade Node.js version in Dockerfile and update dependencies - Change base image from node:20-alpine to node:24-alpine in Dockerfile for both builder and final stages. - Update package dependencies in package.json and package-lock.json, including @aws-sdk/client-sqs, @prisma/client, @sentry/node, multer, pino, and others to their latest versions. - Adjust GitHub Actions workflows to use updated action versions for better performance and security. --- .github/dependabot.yml | 3 + .github/workflows/check_code_quality.yml | 6 +- .github/workflows/publish_docker_image.yml | 4 +- .../publish_docker_image_homolog.yml | 4 +- .../workflows/publish_docker_image_latest.yml | 4 +- .github/workflows/security.yml | 4 +- Dockerfile | 4 +- package-lock.json | 1722 +++++++---------- package.json | 23 +- 9 files changed, 775 insertions(+), 999 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2cfb925d..916a903b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,7 @@ updates: # Enable version updates for npm - package-ecosystem: "npm" directory: "/" + target-branch: "develop" schedule: interval: "weekly" day: "monday" @@ -16,6 +17,7 @@ updates: # Enable version updates for GitHub Actions - package-ecosystem: "github-actions" directory: "/" + target-branch: "develop" schedule: interval: "weekly" day: "monday" @@ -28,6 +30,7 @@ updates: # Enable version updates for Docker - package-ecosystem: "docker" directory: "/" + target-branch: "develop" schedule: interval: "weekly" day: "monday" diff --git a/.github/workflows/check_code_quality.yml b/.github/workflows/check_code_quality.yml index c530bd8f..6bb3f0c3 100644 --- a/.github/workflows/check_code_quality.yml +++ b/.github/workflows/check_code_quality.yml @@ -12,15 +12,15 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: 20.x - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml index 09d09390..9b63941a 100644 --- a/.github/workflows/publish_docker_image.yml +++ b/.github/workflows/publish_docker_image.yml @@ -14,7 +14,7 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Docker meta id: meta @@ -37,7 +37,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/publish_docker_image_homolog.yml b/.github/workflows/publish_docker_image_homolog.yml index b97a5e25..a39c2312 100644 --- a/.github/workflows/publish_docker_image_homolog.yml +++ b/.github/workflows/publish_docker_image_homolog.yml @@ -14,7 +14,7 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Docker meta id: meta @@ -37,7 +37,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/publish_docker_image_latest.yml b/.github/workflows/publish_docker_image_latest.yml index cffdab01..048dc7d9 100644 --- a/.github/workflows/publish_docker_image_latest.yml +++ b/.github/workflows/publish_docker_image_latest.yml @@ -14,7 +14,7 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Docker meta id: meta @@ -37,7 +37,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index bbc73627..2a961523 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Initialize CodeQL uses: github/codeql-action/init@v3 @@ -46,6 +46,6 @@ jobs: if: github.event_name == 'pull_request' steps: - name: Checkout Repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4 diff --git a/Dockerfile b/Dockerfile index 02130c43..24c4e3bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine AS builder +FROM node:24-alpine AS builder RUN apk update && \ apk add --no-cache git ffmpeg wget curl bash openssl @@ -30,7 +30,7 @@ RUN ./Docker/scripts/generate_database.sh RUN npm run build -FROM node:20-alpine AS final +FROM node:24-alpine AS final RUN apk update && \ apk add tzdata ffmpeg bash openssl diff --git a/package-lock.json b/package-lock.json index bb56cd2b..213132d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,14 @@ "license": "Apache-2.0", "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", - "@aws-sdk/client-sqs": "^3.723.0", + "@aws-sdk/client-sqs": "^3.891.0", "@ffmpeg-installer/ffmpeg": "^1.1.0", "@figuro/chatwoot-sdk": "^1.1.16", "@hapi/boom": "^10.0.1", "@paralleldrive/cuid2": "^2.2.2", - "@prisma/client": "^6.1.0", - "@sentry/node": "^8.47.0", + "@prisma/client": "^6.16.2", + "@sentry/node": "^10.12.0", + "@types/uuid": "^10.0.0", "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", @@ -44,13 +45,13 @@ "mime": "^4.0.0", "mime-types": "^2.1.35", "minio": "^8.0.3", - "multer": "^1.4.5-lts.1", + "multer": "^2.0.2", "nats": "^2.29.1", "node-cache": "^5.1.2", "node-cron": "^3.0.3", "openai": "^4.77.3", "pg": "^8.13.1", - "pino": "^8.11.0", + "pino": "^9.10.0", "prisma": "^6.1.0", "pusher": "^5.2.0", "qrcode": "^1.5.4", @@ -62,7 +63,8 @@ "socket.io-client": "^4.8.1", "socks-proxy-agent": "^8.0.5", "swagger-ui-express": "^5.0.1", - "tsup": "^8.3.5" + "tsup": "^8.3.5", + "uuid": "^13.0.0" }, "devDependencies": { "@commitlint/cli": "^19.8.1", @@ -73,17 +75,16 @@ "@types/json-schema": "^7.0.15", "@types/mime": "^4.0.0", "@types/mime-types": "^2.1.4", - "@types/node": "^22.10.5", + "@types/node": "^24.5.2", "@types/node-cron": "^3.0.11", "@types/qrcode": "^1.5.5", "@types/qrcode-terminal": "^0.12.2", - "@types/uuid": "^10.0.0", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", "commitizen": "^4.3.1", "cz-conventional-changelog": "^3.3.0", "eslint": "^8.45.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-simple-import-sort": "^10.0.0", @@ -227,50 +228,50 @@ } }, "node_modules/@aws-sdk/client-sqs": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.888.0.tgz", - "integrity": "sha512-ZnNRgqRZS8iGYift9mz0V2eodBtaKok+EJ7yRc+o3rblTHkun/Evej/WQrvdEvqFBY/Av+yYU2JZXOXegMQt1Q==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.891.0.tgz", + "integrity": "sha512-+c/A8Rqa2pTMR4ZljJ8GRWJc9kI0oBQCRelPDLkDLamGEH8EKJksIaDTw15TvJr+Mg6FZrnIRyDWhSRX57RyYQ==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.888.0", - "@aws-sdk/credential-provider-node": "3.888.0", - "@aws-sdk/middleware-host-header": "3.887.0", - "@aws-sdk/middleware-logger": "3.887.0", - "@aws-sdk/middleware-recursion-detection": "3.887.0", - "@aws-sdk/middleware-sdk-sqs": "3.887.0", - "@aws-sdk/middleware-user-agent": "3.888.0", - "@aws-sdk/region-config-resolver": "3.887.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/credential-provider-node": "3.891.0", + "@aws-sdk/middleware-host-header": "3.891.0", + "@aws-sdk/middleware-logger": "3.891.0", + "@aws-sdk/middleware-recursion-detection": "3.891.0", + "@aws-sdk/middleware-sdk-sqs": "3.891.0", + "@aws-sdk/middleware-user-agent": "3.891.0", + "@aws-sdk/region-config-resolver": "3.890.0", "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-endpoints": "3.891.0", "@aws-sdk/util-user-agent-browser": "3.887.0", - "@aws-sdk/util-user-agent-node": "3.888.0", - "@smithy/config-resolver": "^4.2.1", + "@aws-sdk/util-user-agent-node": "3.891.0", + "@smithy/config-resolver": "^4.2.2", "@smithy/core": "^3.11.0", "@smithy/fetch-http-handler": "^5.2.1", "@smithy/hash-node": "^4.1.1", "@smithy/invalid-dependency": "^4.1.1", "@smithy/md5-js": "^4.1.1", "@smithy/middleware-content-length": "^4.1.1", - "@smithy/middleware-endpoint": "^4.2.1", - "@smithy/middleware-retry": "^4.2.1", + "@smithy/middleware-endpoint": "^4.2.2", + "@smithy/middleware-retry": "^4.2.3", "@smithy/middleware-serde": "^4.1.1", "@smithy/middleware-stack": "^4.1.1", - "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-config-provider": "^4.2.2", "@smithy/node-http-handler": "^4.2.1", "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.1", + "@smithy/smithy-client": "^4.6.2", "@smithy/types": "^4.5.0", "@smithy/url-parser": "^4.1.1", "@smithy/util-base64": "^4.1.0", "@smithy/util-body-length-browser": "^4.1.0", "@smithy/util-body-length-node": "^4.1.0", - "@smithy/util-defaults-mode-browser": "^4.1.1", - "@smithy/util-defaults-mode-node": "^4.1.1", - "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-defaults-mode-browser": "^4.1.2", + "@smithy/util-defaults-mode-node": "^4.1.2", + "@smithy/util-endpoints": "^3.1.2", "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.1", + "@smithy/util-retry": "^4.1.2", "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, @@ -279,47 +280,47 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.888.0.tgz", - "integrity": "sha512-8CLy/ehGKUmekjH+VtZJ4w40PqDg3u0K7uPziq/4P8Q7LLgsy8YQoHNbuY4am7JU3HWrqLXJI9aaz1+vPGPoWA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.891.0.tgz", + "integrity": "sha512-QMDaD9GhJe7l0KQp3Tt7dzqFCz/H2XuyNjQgvi10nM1MfI1RagmLtmEhZveQxMPhZ/AtohLSK0Tisp/I5tR8RQ==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.888.0", - "@aws-sdk/middleware-host-header": "3.887.0", - "@aws-sdk/middleware-logger": "3.887.0", - "@aws-sdk/middleware-recursion-detection": "3.887.0", - "@aws-sdk/middleware-user-agent": "3.888.0", - "@aws-sdk/region-config-resolver": "3.887.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/middleware-host-header": "3.891.0", + "@aws-sdk/middleware-logger": "3.891.0", + "@aws-sdk/middleware-recursion-detection": "3.891.0", + "@aws-sdk/middleware-user-agent": "3.891.0", + "@aws-sdk/region-config-resolver": "3.890.0", "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-endpoints": "3.891.0", "@aws-sdk/util-user-agent-browser": "3.887.0", - "@aws-sdk/util-user-agent-node": "3.888.0", - "@smithy/config-resolver": "^4.2.1", + "@aws-sdk/util-user-agent-node": "3.891.0", + "@smithy/config-resolver": "^4.2.2", "@smithy/core": "^3.11.0", "@smithy/fetch-http-handler": "^5.2.1", "@smithy/hash-node": "^4.1.1", "@smithy/invalid-dependency": "^4.1.1", "@smithy/middleware-content-length": "^4.1.1", - "@smithy/middleware-endpoint": "^4.2.1", - "@smithy/middleware-retry": "^4.2.1", + "@smithy/middleware-endpoint": "^4.2.2", + "@smithy/middleware-retry": "^4.2.3", "@smithy/middleware-serde": "^4.1.1", "@smithy/middleware-stack": "^4.1.1", - "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-config-provider": "^4.2.2", "@smithy/node-http-handler": "^4.2.1", "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.1", + "@smithy/smithy-client": "^4.6.2", "@smithy/types": "^4.5.0", "@smithy/url-parser": "^4.1.1", "@smithy/util-base64": "^4.1.0", "@smithy/util-body-length-browser": "^4.1.0", "@smithy/util-body-length-node": "^4.1.0", - "@smithy/util-defaults-mode-browser": "^4.1.1", - "@smithy/util-defaults-mode-node": "^4.1.1", - "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-defaults-mode-browser": "^4.1.2", + "@smithy/util-defaults-mode-node": "^4.1.2", + "@smithy/util-endpoints": "^3.1.2", "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.1", + "@smithy/util-retry": "^4.1.2", "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, @@ -328,19 +329,19 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.888.0.tgz", - "integrity": "sha512-L3S2FZywACo4lmWv37Y4TbefuPJ1fXWyWwIJ3J4wkPYFJ47mmtUPqThlVrSbdTHkEjnZgJe5cRfxk0qCLsFh1w==", + "version": "3.890.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.890.0.tgz", + "integrity": "sha512-CT+yjhytHdyKvV3Nh/fqBjnZ8+UiQZVz4NMm4LrPATgVSOdfygXHqrWxrPTVgiBtuJWkotg06DF7+pTd5ekLBw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", "@aws-sdk/xml-builder": "3.887.0", "@smithy/core": "^3.11.0", - "@smithy/node-config-provider": "^4.2.1", - "@smithy/property-provider": "^4.0.5", + "@smithy/node-config-provider": "^4.2.2", + "@smithy/property-provider": "^4.1.1", "@smithy/protocol-http": "^5.2.1", - "@smithy/signature-v4": "^5.1.3", - "@smithy/smithy-client": "^4.6.1", + "@smithy/signature-v4": "^5.2.1", + "@smithy/smithy-client": "^4.6.2", "@smithy/types": "^4.5.0", "@smithy/util-base64": "^4.1.0", "@smithy/util-body-length-browser": "^4.1.0", @@ -354,14 +355,14 @@ } }, "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.888.0.tgz", - "integrity": "sha512-shPi4AhUKbIk7LugJWvNpeZA8va7e5bOHAEKo89S0Ac8WDZt2OaNzbh/b9l0iSL2eEyte8UgIsYGcFxOwIF1VA==", + "version": "3.890.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.890.0.tgz", + "integrity": "sha512-BtsUa2y0Rs8phmB2ScZ5RuPqZVmxJJXjGfeiXctmLFTxTwoayIK1DdNzOWx6SRMPVc3s2RBGN4vO7T1TwN+ajA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", + "@aws-sdk/core": "3.890.0", "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.0.5", + "@smithy/property-provider": "^4.1.1", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -370,18 +371,18 @@ } }, "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.888.0.tgz", - "integrity": "sha512-Jvuk6nul0lE7o5qlQutcqlySBHLXOyoPtiwE6zyKbGc7RVl0//h39Lab7zMeY2drMn8xAnIopL4606Fd8JI/Hw==", + "version": "3.890.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.890.0.tgz", + "integrity": "sha512-0sru3LVwsuGYyzbD90EC/d5HnCZ9PL4O9BA2LYT6b9XceC005Oj86uzE47LXb+mDhTAt3T6ZO0+ZcVQe0DDi8w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", + "@aws-sdk/core": "3.890.0", "@aws-sdk/types": "3.887.0", "@smithy/fetch-http-handler": "^5.2.1", "@smithy/node-http-handler": "^4.2.1", - "@smithy/property-provider": "^4.0.5", + "@smithy/property-provider": "^4.1.1", "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.1", + "@smithy/smithy-client": "^4.6.2", "@smithy/types": "^4.5.0", "@smithy/util-stream": "^4.3.1", "tslib": "^2.6.2" @@ -391,22 +392,22 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.888.0.tgz", - "integrity": "sha512-M82ItvS5yq+tO6ZOV1ruaVs2xOne+v8HW85GFCXnz8pecrzYdgxh6IsVqEbbWruryG/mUGkWMbkBZoEsy4MgyA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.891.0.tgz", + "integrity": "sha512-9LOfm97oy2d2frwCQjl53XLkoEYG6/rsNM3Y6n8UtRU3bzGAEjixdIuv3b6Z/Mk/QLeikcQEJ9FMC02DuQh2Yw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", - "@aws-sdk/credential-provider-env": "3.888.0", - "@aws-sdk/credential-provider-http": "3.888.0", - "@aws-sdk/credential-provider-process": "3.888.0", - "@aws-sdk/credential-provider-sso": "3.888.0", - "@aws-sdk/credential-provider-web-identity": "3.888.0", - "@aws-sdk/nested-clients": "3.888.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/credential-provider-env": "3.890.0", + "@aws-sdk/credential-provider-http": "3.890.0", + "@aws-sdk/credential-provider-process": "3.890.0", + "@aws-sdk/credential-provider-sso": "3.891.0", + "@aws-sdk/credential-provider-web-identity": "3.891.0", + "@aws-sdk/nested-clients": "3.891.0", "@aws-sdk/types": "3.887.0", - "@smithy/credential-provider-imds": "^4.0.7", - "@smithy/property-provider": "^4.0.5", - "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/credential-provider-imds": "^4.1.2", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -415,21 +416,21 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.888.0.tgz", - "integrity": "sha512-KCrQh1dCDC8Y+Ap3SZa6S81kHk+p+yAaOQ5jC3dak4zhHW3RCrsGR/jYdemTOgbEGcA6ye51UbhWfrrlMmeJSA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.891.0.tgz", + "integrity": "sha512-IjGvQJhpCN512xlT1DFGaPeE1q0YEm/X62w7wHsRpBindW//M+heSulJzP4KPkoJvmJNVu1NxN26/p4uH+M8TQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.888.0", - "@aws-sdk/credential-provider-http": "3.888.0", - "@aws-sdk/credential-provider-ini": "3.888.0", - "@aws-sdk/credential-provider-process": "3.888.0", - "@aws-sdk/credential-provider-sso": "3.888.0", - "@aws-sdk/credential-provider-web-identity": "3.888.0", + "@aws-sdk/credential-provider-env": "3.890.0", + "@aws-sdk/credential-provider-http": "3.890.0", + "@aws-sdk/credential-provider-ini": "3.891.0", + "@aws-sdk/credential-provider-process": "3.890.0", + "@aws-sdk/credential-provider-sso": "3.891.0", + "@aws-sdk/credential-provider-web-identity": "3.891.0", "@aws-sdk/types": "3.887.0", - "@smithy/credential-provider-imds": "^4.0.7", - "@smithy/property-provider": "^4.0.5", - "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/credential-provider-imds": "^4.1.2", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -438,15 +439,15 @@ } }, "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.888.0.tgz", - "integrity": "sha512-+aX6piSukPQ8DUS4JAH344GePg8/+Q1t0+kvSHAZHhYvtQ/1Zek3ySOJWH2TuzTPCafY4nmWLcQcqvU1w9+4Lw==", + "version": "3.890.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.890.0.tgz", + "integrity": "sha512-dWZ54TI1Q+UerF5YOqGiCzY+x2YfHsSQvkyM3T4QDNTJpb/zjiVv327VbSOULOlI7gHKWY/G3tMz0D9nWI7YbA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", + "@aws-sdk/core": "3.890.0", "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.0.5", - "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -455,17 +456,17 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.888.0.tgz", - "integrity": "sha512-b1ZJji7LJ6E/j1PhFTyvp51in2iCOQ3VP6mj5H6f5OUnqn7efm41iNMoinKr87n0IKZw7qput5ggXVxEdPhouA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.891.0.tgz", + "integrity": "sha512-RtF9BwUIZqc/7sFbK6n6qhe0tNaWJQwin89nSeZ1HOsA0Z7TfTOelX8Otd0L5wfeVBMVcgiN3ofqrcZgjFjQjA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.888.0", - "@aws-sdk/core": "3.888.0", - "@aws-sdk/token-providers": "3.888.0", + "@aws-sdk/client-sso": "3.891.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/token-providers": "3.891.0", "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.0.5", - "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -474,15 +475,16 @@ } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.888.0.tgz", - "integrity": "sha512-7P0QNtsDzMZdmBAaY/vY1BsZHwTGvEz3bsn2bm5VSKFAeMmZqsHK1QeYdNsFjLtegnVh+wodxMq50jqLv3LFlA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.891.0.tgz", + "integrity": "sha512-yq7kzm1sHZ0GZrtS+qpjMUp4ES66UoT1+H2xxrOuAZkvUnkpQq1iSjOgBgJJ9FW1EsDUEmlgn94i4hJTNvm7fg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", - "@aws-sdk/nested-clients": "3.888.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/nested-clients": "3.891.0", "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.0.5", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -491,9 +493,9 @@ } }, "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.887.0.tgz", - "integrity": "sha512-ulzqXv6NNqdu/kr0sgBYupWmahISHY+azpJidtK6ZwQIC+vBUk9NdZeqQpy7KVhIk2xd4+5Oq9rxapPwPI21CA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.891.0.tgz", + "integrity": "sha512-OYaxbqNDeo/noE7MfYWWQDu86cF/R/bMXdZ2QZwpWpX2yjy8xMwxSg7c/4tEK/OtiDZTKRXXrvPxRxG2+1bnJw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", @@ -506,9 +508,9 @@ } }, "node_modules/@aws-sdk/middleware-logger": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.887.0.tgz", - "integrity": "sha512-YbbgLI6jKp2qSoAcHnXrQ5jcuc5EYAmGLVFgMVdk8dfCfJLfGGSaOLxF4CXC7QYhO50s+mPPkhBYejCik02Kug==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.891.0.tgz", + "integrity": "sha512-azL4mg1H1FLpOAECiFtU+r+9VDhpeF6Vh9pzD4m51BWPJ60CVnyHayeI/0gqPsL60+5l90/b9VWonoA8DvAvpg==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", @@ -520,9 +522,9 @@ } }, "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.887.0.tgz", - "integrity": "sha512-tjrUXFtQnFLo+qwMveq5faxP5MQakoLArXtqieHphSqZTXm21wDJM73hgT4/PQQGTwgYjDKqnqsE1hvk0hcfDw==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.891.0.tgz", + "integrity": "sha512-n++KwAEnNlvx5NZdIQZnvl2GjSH/YE3xGSqW2GmPB5780tFY5lOYSb1uA+EUzJSVX4oAKAkSPdR2AOW09kzoew==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", @@ -536,15 +538,15 @@ } }, "node_modules/@aws-sdk/middleware-sdk-sqs": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.887.0.tgz", - "integrity": "sha512-5zkGO/ADEjGJ1zJBCS4Zs2aLPAMLu+W7pk5AgeLpCQp8LqIYOmPH6X9IhNGIq/urytUK7JoFX985MfEzDOvFTg==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.891.0.tgz", + "integrity": "sha512-+FkFslhvJqIzw+nVtToGuOcbdzclkTiOj6Z61mnq1ZyH8r5OOW9EkLHNgIacn6ehdoIeCvOCJiLpQbttNn51Lw==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", - "@smithy/smithy-client": "^4.6.1", + "@smithy/smithy-client": "^4.6.2", "@smithy/types": "^4.5.0", - "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-hex-encoding": "^4.1.0", "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, @@ -553,14 +555,14 @@ } }, "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.888.0.tgz", - "integrity": "sha512-ZkcUkoys8AdrNNG7ATjqw2WiXqrhTvT+r4CIK3KhOqIGPHX0p0DQWzqjaIl7ZhSUToKoZ4Ud7MjF795yUr73oA==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.891.0.tgz", + "integrity": "sha512-xyxIZtR7FunCWymPAxEm61VUq9lruXxWIYU5AIh5rt0av7nXa2ayAAlscQ7ch9jUlw+lbC2PVbw0K/OYrMovuA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", + "@aws-sdk/core": "3.890.0", "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-endpoints": "3.891.0", "@smithy/core": "^3.11.0", "@smithy/protocol-http": "^5.2.1", "@smithy/types": "^4.5.0", @@ -571,47 +573,47 @@ } }, "node_modules/@aws-sdk/nested-clients": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.888.0.tgz", - "integrity": "sha512-py4o4RPSGt+uwGvSBzR6S6cCBjS4oTX5F8hrHFHfPCdIOMVjyOBejn820jXkCrcdpSj3Qg1yUZXxsByvxc9Lyg==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.891.0.tgz", + "integrity": "sha512-cpol+Yk4T3GXPXbRfUyN2u6tpMEHUxAiesZgrfMm11QGHV+pmzyejJV/QZ0pdJKj5sXKaCr4DCntoJ5iBx++Cw==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.888.0", - "@aws-sdk/middleware-host-header": "3.887.0", - "@aws-sdk/middleware-logger": "3.887.0", - "@aws-sdk/middleware-recursion-detection": "3.887.0", - "@aws-sdk/middleware-user-agent": "3.888.0", - "@aws-sdk/region-config-resolver": "3.887.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/middleware-host-header": "3.891.0", + "@aws-sdk/middleware-logger": "3.891.0", + "@aws-sdk/middleware-recursion-detection": "3.891.0", + "@aws-sdk/middleware-user-agent": "3.891.0", + "@aws-sdk/region-config-resolver": "3.890.0", "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.887.0", + "@aws-sdk/util-endpoints": "3.891.0", "@aws-sdk/util-user-agent-browser": "3.887.0", - "@aws-sdk/util-user-agent-node": "3.888.0", - "@smithy/config-resolver": "^4.2.1", + "@aws-sdk/util-user-agent-node": "3.891.0", + "@smithy/config-resolver": "^4.2.2", "@smithy/core": "^3.11.0", "@smithy/fetch-http-handler": "^5.2.1", "@smithy/hash-node": "^4.1.1", "@smithy/invalid-dependency": "^4.1.1", "@smithy/middleware-content-length": "^4.1.1", - "@smithy/middleware-endpoint": "^4.2.1", - "@smithy/middleware-retry": "^4.2.1", + "@smithy/middleware-endpoint": "^4.2.2", + "@smithy/middleware-retry": "^4.2.3", "@smithy/middleware-serde": "^4.1.1", "@smithy/middleware-stack": "^4.1.1", - "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-config-provider": "^4.2.2", "@smithy/node-http-handler": "^4.2.1", "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.1", + "@smithy/smithy-client": "^4.6.2", "@smithy/types": "^4.5.0", "@smithy/url-parser": "^4.1.1", "@smithy/util-base64": "^4.1.0", "@smithy/util-body-length-browser": "^4.1.0", "@smithy/util-body-length-node": "^4.1.0", - "@smithy/util-defaults-mode-browser": "^4.1.1", - "@smithy/util-defaults-mode-node": "^4.1.1", - "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-defaults-mode-browser": "^4.1.2", + "@smithy/util-defaults-mode-node": "^4.1.2", + "@smithy/util-endpoints": "^3.1.2", "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.1", + "@smithy/util-retry": "^4.1.2", "@smithy/util-utf8": "^4.1.0", "tslib": "^2.6.2" }, @@ -620,15 +622,15 @@ } }, "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.887.0.tgz", - "integrity": "sha512-VdSMrIqJ3yjJb/fY+YAxrH/lCVv0iL8uA+lbMNfQGtO5tB3Zx6SU9LEpUwBNX8fPK1tUpI65CNE4w42+MY/7Mg==", + "version": "3.890.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.890.0.tgz", + "integrity": "sha512-VfdT+tkF9groRYNzKvQCsCGDbOQdeBdzyB1d6hWiq22u13UafMIoskJ1ec0i0H1X29oT6mjTitfnvPq1UiKwzQ==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", - "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-config-provider": "^4.2.2", "@smithy/types": "^4.5.0", - "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-config-provider": "^4.1.0", "@smithy/util-middleware": "^4.1.1", "tslib": "^2.6.2" }, @@ -637,16 +639,16 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.888.0.tgz", - "integrity": "sha512-WA3NF+3W8GEuCMG1WvkDYbB4z10G3O8xuhT7QSjhvLYWQ9CPt3w4VpVIfdqmUn131TCIbhCzD0KN/1VJTjAjyw==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.891.0.tgz", + "integrity": "sha512-n31JDMWhj/53QX33C97+1W63JGtgO8pg1/Tfmv4f9TR2VSGf1rFwYH7cPZ7dVIMmcUBeI2VCVhwUIabGNHw86Q==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.888.0", - "@aws-sdk/nested-clients": "3.888.0", + "@aws-sdk/core": "3.890.0", + "@aws-sdk/nested-clients": "3.891.0", "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.0.5", - "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.2.0", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -668,15 +670,15 @@ } }, "node_modules/@aws-sdk/util-endpoints": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.887.0.tgz", - "integrity": "sha512-kpegvT53KT33BMeIcGLPA65CQVxLUL/C3gTz9AzlU/SDmeusBHX4nRApAicNzI/ltQ5lxZXbQn18UczzBuwF1w==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.891.0.tgz", + "integrity": "sha512-MgxvmHIQJbUK+YquX4bdjDw1MjdBqTRJGHs6iU2KM8nN1ut0bPwvavkq7NrY/wB3ZKKECqmv6J/nw+hYKKUIHA==", "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.887.0", "@smithy/types": "^4.5.0", "@smithy/url-parser": "^4.1.1", - "@smithy/util-endpoints": "^3.1.1", + "@smithy/util-endpoints": "^3.1.2", "tslib": "^2.6.2" }, "engines": { @@ -708,14 +710,14 @@ } }, "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.888.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.888.0.tgz", - "integrity": "sha512-rSB3OHyuKXotIGfYEo//9sU0lXAUrTY28SUUnxzOGYuQsAt0XR5iYwBAp+RjV6x8f+Hmtbg0PdCsy1iNAXa0UQ==", + "version": "3.891.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.891.0.tgz", + "integrity": "sha512-/mmvVL2PJE2NMTWj9JSY98OISx7yov0mi72eOViWCHQMRYJCN12DY54i1rc4Q/oPwJwTwIrx69MLjVhQ1OZsgw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/middleware-user-agent": "3.888.0", + "@aws-sdk/middleware-user-agent": "3.891.0", "@aws-sdk/types": "3.887.0", - "@smithy/node-config-provider": "^4.2.1", + "@smithy/node-config-provider": "^4.2.2", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -3094,581 +3096,467 @@ } }, "node_modules/@opentelemetry/api-logs": { - "version": "0.57.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.2.tgz", - "integrity": "sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==", + "version": "0.204.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.204.0.tgz", + "integrity": "sha512-DqxY8yoAaiBPivoJD4UtgrMS8gEmzZ5lnaxzPojzLVHBGqPxgWm4zcuvcUHZiqQ6kRX2Klel2r9y8cA2HAtqpw==", "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.3.0" }, "engines": { - "node": ">=14" + "node": ">=8.0.0" } }, "node_modules/@opentelemetry/context-async-hooks": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.1.tgz", - "integrity": "sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.1.0.tgz", + "integrity": "sha512-zOyetmZppnwTyPrt4S7jMfXiSX9yyfF0hxlA8B5oo2TtKl+/RGCy7fi4DrBfIf3lCPrkKsRBWZZD7RFojK7FDg==", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, "node_modules/@opentelemetry/core": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.30.1.tgz", - "integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.1.0.tgz", + "integrity": "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/semantic-conventions": "1.28.0" + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, - "node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/instrumentation": { - "version": "0.57.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.2.tgz", - "integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==", + "version": "0.204.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.204.0.tgz", + "integrity": "sha512-vV5+WSxktzoMP8JoYWKeopChy6G3HKk4UQ2hESCRDUUTZqQ3+nM3u8noVG0LmNfRWwcFBnbZ71GKC7vaYYdJ1g==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.57.2", - "@types/shimmer": "^1.2.0", + "@opentelemetry/api-logs": "0.204.0", "import-in-the-middle": "^1.8.1", - "require-in-the-middle": "^7.1.1", - "semver": "^7.5.2", - "shimmer": "^1.2.1" + "require-in-the-middle": "^7.1.1" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-amqplib": { - "version": "0.46.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.46.1.tgz", - "integrity": "sha512-AyXVnlCf/xV3K/rNumzKxZqsULyITJH6OVLiW6730JPRqWA7Zc9bvYoVNpN6iOpTU8CasH34SU/ksVJmObFibQ==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.51.0.tgz", + "integrity": "sha512-XGmjYwjVRktD4agFnWBWQXo9SiYHKBxR6Ag3MLXwtLE4R99N3a08kGKM5SC1qOFKIELcQDGFEFT9ydXMH00Luw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.1", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-connect": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.43.0.tgz", - "integrity": "sha512-Q57JGpH6T4dkYHo9tKXONgLtxzsh1ZEW5M9A/OwKrZFyEpLqWgjhcZ3hIuVvDlhb426iDF1f9FPToV/mi5rpeA==", + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.48.0.tgz", + "integrity": "sha512-OMjc3SFL4pC16PeK+tDhwP7MRvDPalYCGSvGqUhX5rASkI2H0RuxZHOWElYeXkV0WP+70Gw6JHWac/2Zqwmhdw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", - "@types/connect": "3.4.36" + "@types/connect": "3.4.38" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-dataloader": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.16.0.tgz", - "integrity": "sha512-88+qCHZC02up8PwKHk0UQKLLqGGURzS3hFQBZC7PnGwReuoKjHXS1o29H58S+QkXJpkTr2GACbx8j6mUoGjNPA==", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.22.0.tgz", + "integrity": "sha512-bXnTcwtngQsI1CvodFkTemrrRSQjAjZxqHVc+CJZTDnidT0T6wt3jkKhnsjU/Kkkc0lacr6VdRpCu2CUWa0OKw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-express": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.47.0.tgz", - "integrity": "sha512-XFWVx6k0XlU8lu6cBlCa29ONtVt6ADEjmxtyAyeF2+rifk8uBJbk1La0yIVfI0DoKURGbaEDTNelaXG9l/lNNQ==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.53.0.tgz", + "integrity": "sha512-r/PBafQmFYRjuxLYEHJ3ze1iBnP2GDA1nXOSS6E02KnYNZAVjj6WcDA1MSthtdAUUK0XnotHvvWM8/qz7DMO5A==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-fastify": { - "version": "0.44.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.44.1.tgz", - "integrity": "sha512-RoVeMGKcNttNfXMSl6W4fsYoCAYP1vi6ZAWIGhBY+o7R9Y0afA7f9JJL0j8LHbyb0P0QhSYk+6O56OwI2k4iRQ==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" - }, - "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-fs": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.19.0.tgz", - "integrity": "sha512-JGwmHhBkRT2G/BYNV1aGI+bBjJu4fJUD/5/Jat0EWZa2ftrLV3YE8z84Fiij/wK32oMZ88eS8DI4ecLGZhpqsQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.24.0.tgz", + "integrity": "sha512-HjIxJ6CBRD770KNVaTdMXIv29Sjz4C1kPCCK5x1Ujpc6SNnLGPqUVyJYZ3LUhhnHAqdbrl83ogVWjCgeT4Q0yw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-generic-pool": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.43.0.tgz", - "integrity": "sha512-at8GceTtNxD1NfFKGAuwtqM41ot/TpcLh+YsGe4dhf7gvv1HW/ZWdq6nfRtS6UjIvZJOokViqLPJ3GVtZItAnQ==", + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.48.0.tgz", + "integrity": "sha512-TLv/On8pufynNR+pUbpkyvuESVASZZKMlqCm4bBImTpXKTpqXaJJ3o/MUDeMlM91rpen+PEv2SeyOKcHCSlgag==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-graphql": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.47.0.tgz", - "integrity": "sha512-Cc8SMf+nLqp0fi8oAnooNEfwZWFnzMiBHCGmDFYqmgjPylyLmi83b+NiTns/rKGwlErpW0AGPt0sMpkbNlzn8w==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.52.0.tgz", + "integrity": "sha512-3fEJ8jOOMwopvldY16KuzHbRhPk8wSsOTSF0v2psmOCGewh6ad+ZbkTx/xyUK9rUdUMWAxRVU0tFpj4Wx1vkPA==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-hapi": { - "version": "0.45.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.45.1.tgz", - "integrity": "sha512-VH6mU3YqAKTePPfUPwfq4/xr049774qWtfTuJqVHoVspCLiT3bW+fCQ1toZxt6cxRPYASoYaBsMA3CWo8B8rcw==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.51.0.tgz", + "integrity": "sha512-qyf27DaFNL1Qhbo/da+04MSCw982B02FhuOS5/UF+PMhM61CcOiu7fPuXj8TvbqyReQuJFljXE6UirlvoT/62g==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-http": { - "version": "0.57.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.57.1.tgz", - "integrity": "sha512-ThLmzAQDs7b/tdKI3BV2+yawuF09jF111OFsovqT1Qj3D8vjwKBwhi/rDE5xethwn4tSXtZcJ9hBsVAlWFQZ7g==", + "version": "0.204.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.204.0.tgz", + "integrity": "sha512-1afJYyGRA4OmHTv0FfNTrTAzoEjPQUYgd+8ih/lX0LlZBnGio/O80vxA0lN3knsJPS7FiDrsDrWq25K7oAzbkw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.30.1", - "@opentelemetry/instrumentation": "0.57.1", - "@opentelemetry/semantic-conventions": "1.28.0", - "forwarded-parse": "2.1.2", - "semver": "^7.5.2" + "@opentelemetry/core": "2.1.0", + "@opentelemetry/instrumentation": "0.204.0", + "@opentelemetry/semantic-conventions": "^1.29.0", + "forwarded-parse": "2.1.2" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, - "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/api-logs": { - "version": "0.57.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.1.tgz", - "integrity": "sha512-I4PHczeujhQAQv6ZBzqHYEUiggZL4IdSMixtVD3EYqbdrjujE7kRfI5QohjlPoJm8BvenoW5YaTMWRrbpot6tg==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/instrumentation": { - "version": "0.57.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.1.tgz", - "integrity": "sha512-SgHEKXoVxOjc20ZYusPG3Fh+RLIZTSa4x8QtD3NfgAUDyqdFFS9W1F2ZVbZkqDCdyMcQG02Ok4duUGLHJXHgbA==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/api-logs": "0.57.1", - "@types/shimmer": "^1.2.0", - "import-in-the-middle": "^1.8.1", - "require-in-the-middle": "^7.1.1", - "semver": "^7.5.2", - "shimmer": "^1.2.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/instrumentation-ioredis": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.47.0.tgz", - "integrity": "sha512-4HqP9IBC8e7pW9p90P3q4ox0XlbLGme65YTrA3UTLvqvo4Z6b0puqZQP203YFu8m9rE/luLfaG7/xrwwqMUpJw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.52.0.tgz", + "integrity": "sha512-rUvlyZwI90HRQPYicxpDGhT8setMrlHKokCtBtZgYxQWRF5RBbG4q0pGtbZvd7kyseuHbFpA3I/5z7M8b/5ywg==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/redis-common": "^0.38.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-kafkajs": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.7.0.tgz", - "integrity": "sha512-LB+3xiNzc034zHfCtgs4ITWhq6Xvdo8bsq7amR058jZlf2aXXDrN9SV4si4z2ya9QX4tz6r4eZJwDkXOp14/AQ==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.14.0.tgz", + "integrity": "sha512-kbB5yXS47dTIdO/lfbbXlzhvHFturbux4EpP0+6H78Lk0Bn4QXiZQW7rmZY1xBCY16mNcCb8Yt0mhz85hTnSVA==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/semantic-conventions": "^1.30.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-knex": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.44.0.tgz", - "integrity": "sha512-SlT0+bLA0Lg3VthGje+bSZatlGHw/vwgQywx0R/5u9QC59FddTQSPJeWNw29M6f8ScORMeUOOTwihlQAn4GkJQ==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.49.0.tgz", + "integrity": "sha512-NKsRRT27fbIYL4Ix+BjjP8h4YveyKc+2gD6DMZbr5R5rUeDqfC8+DTfIt3c3ex3BIc5Vvek4rqHnN7q34ZetLQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/semantic-conventions": "^1.33.1" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-koa": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.47.0.tgz", - "integrity": "sha512-HFdvqf2+w8sWOuwtEXayGzdZ2vWpCKEQv5F7+2DSA74Te/Cv4rvb2E5So5/lh+ok4/RAIPuvCbCb/SHQFzMmbw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.52.0.tgz", + "integrity": "sha512-JJSBYLDx/mNSy8Ibi/uQixu2rH0bZODJa8/cz04hEhRaiZQoeJ5UrOhO/mS87IdgVsHrnBOsZ6vDu09znupyuA==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-lru-memoizer": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.44.0.tgz", - "integrity": "sha512-Tn7emHAlvYDFik3vGU0mdwvWJDwtITtkJ+5eT2cUquct6nIs+H8M47sqMJkCpyPe5QIBJoTOHxmc6mj9lz6zDw==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.49.0.tgz", + "integrity": "sha512-ctXu+O/1HSadAxtjoEg2w307Z5iPyLOMM8IRNwjaKrIpNAthYGSOanChbk1kqY6zU5CrpkPHGdAT6jk8dXiMqw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mongodb": { - "version": "0.51.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.51.0.tgz", - "integrity": "sha512-cMKASxCX4aFxesoj3WK8uoQ0YUrRvnfxaO72QWI2xLu5ZtgX/QvdGBlU3Ehdond5eb74c2s1cqRQUIptBnKz1g==", + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.57.0.tgz", + "integrity": "sha512-KD6Rg0KSHWDkik+qjIOWoksi1xqSpix8TSPfquIK1DTmd9OTFb5PHmMkzJe16TAPVEuElUW8gvgP59cacFcrMQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mongoose": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.46.0.tgz", - "integrity": "sha512-mtVv6UeaaSaWTeZtLo4cx4P5/ING2obSqfWGItIFSunQBrYROfhuVe7wdIrFUs2RH1tn2YYpAJyMaRe/bnTTIQ==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.51.0.tgz", + "integrity": "sha512-gwWaAlhhV2By7XcbyU3DOLMvzsgeaymwP/jktDC+/uPkCmgB61zurwqOQdeiRq9KAf22Y2dtE5ZLXxytJRbEVA==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mysql": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.45.0.tgz", - "integrity": "sha512-tWWyymgwYcTwZ4t8/rLDfPYbOTF3oYB8SxnYMtIQ1zEf5uDm90Ku3i6U/vhaMyfHNlIHvDhvJh+qx5Nc4Z3Acg==", + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.50.0.tgz", + "integrity": "sha512-duKAvMRI3vq6u9JwzIipY9zHfikN20bX05sL7GjDeLKr2qV0LQ4ADtKST7KStdGcQ+MTN5wghWbbVdLgNcB3rA==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", - "@types/mysql": "2.15.26" + "@types/mysql": "2.15.27" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mysql2": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.45.0.tgz", - "integrity": "sha512-qLslv/EPuLj0IXFvcE3b0EqhWI8LKmrgRPIa4gUd8DllbBpqJAvLNJSv3cC6vWwovpbSI3bagNO/3Q2SuXv2xA==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.51.0.tgz", + "integrity": "sha512-zT2Wg22Xn43RyfU3NOUmnFtb5zlDI0fKcijCj9AcK9zuLZ4ModgtLXOyBJSSfO+hsOCZSC1v/Fxwj+nZJFdzLQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", - "@opentelemetry/sql-common": "^0.40.1" + "@opentelemetry/sql-common": "^0.41.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-nestjs-core": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.44.0.tgz", - "integrity": "sha512-t16pQ7A4WYu1yyQJZhRKIfUNvl5PAaF2pEteLvgJb/BWdd1oNuU1rOYt4S825kMy+0q4ngiX281Ss9qiwHfxFQ==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" - }, - "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-pg": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.50.0.tgz", - "integrity": "sha512-TtLxDdYZmBhFswm8UIsrDjh/HFBeDXd4BLmE8h2MxirNHewLJ0VS9UUddKKEverb5Sm2qFVjqRjcU+8Iw4FJ3w==", + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.57.0.tgz", + "integrity": "sha512-dWLGE+r5lBgm2A8SaaSYDE3OKJ/kwwy5WLyGyzor8PLhUL9VnJRiY6qhp4njwhnljiLtzeffRtG2Mf/YyWLeTw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.26.0", - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "1.27.0", - "@opentelemetry/sql-common": "^0.40.1", - "@types/pg": "8.6.1", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/semantic-conventions": "^1.34.0", + "@opentelemetry/sql-common": "^0.41.0", + "@types/pg": "8.15.5", "@types/pg-pool": "2.0.6" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, - "node_modules/@opentelemetry/instrumentation-pg/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", - "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/instrumentation-redis-4": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.46.0.tgz", - "integrity": "sha512-aTUWbzbFMFeRODn3720TZO0tsh/49T8H3h8vVnVKJ+yE36AeW38Uj/8zykQ/9nO8Vrtjr5yKuX3uMiG/W8FKNw==", + "node_modules/@opentelemetry/instrumentation-redis": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.53.0.tgz", + "integrity": "sha512-WUHV8fr+8yo5RmzyU7D5BIE1zwiaNQcTyZPwtxlfr7px6NYYx7IIpSihJK7WA60npWynfxxK1T67RAVF0Gdfjg==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/redis-common": "^0.38.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-tedious": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.18.0.tgz", - "integrity": "sha512-9zhjDpUDOtD+coeADnYEJQ0IeLVCj7w/hqzIutdp5NqS1VqTAanaEfsEcSypyvYv5DX3YOsTUoF+nr2wDXPETA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.23.0.tgz", + "integrity": "sha512-3TMTk/9VtlRonVTaU4tCzbg4YqW+Iq/l5VnN2e5whP6JgEg/PKfrGbqQ+CxQWNLfLaQYIUgEZqAn5gk/inh1uQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", "@types/tedious": "^4.0.14" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-undici": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.10.0.tgz", - "integrity": "sha512-vm+V255NGw9gaSsPD6CP0oGo8L55BffBc8KnxqsMuc6XiAD1L8SFNzsW0RHhxJFqy9CJaJh+YiJ5EHXuZ5rZBw==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.15.0.tgz", + "integrity": "sha512-sNFGA/iCDlVkNjzTzPRcudmI11vT/WAfAguRdZY9IspCw02N4WSC72zTuQhSMheh2a1gdeM9my1imnKRvEEvEg==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.7.0" } }, "node_modules/@opentelemetry/redis-common": { - "version": "0.36.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", - "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.0.tgz", + "integrity": "sha512-4Wc0AWURII2cfXVVoZ6vDqK+s5n4K5IssdrlVrvGsx6OEOKdghKtJZqXAHWFiZv4nTDLH2/2fldjIHY8clMOjQ==", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" } }, "node_modules/@opentelemetry/resources": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.30.1.tgz", - "integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.1.0.tgz", + "integrity": "sha512-1CJjf3LCvoefUOgegxi8h6r4B/wLSzInyhGP2UmIBYNlo4Qk5CZ73e1eEyWmfXvFtm1ybkmfb2DqWvspsYLrWw==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.30.1", - "@opentelemetry/semantic-conventions": "1.28.0" + "@opentelemetry/core": "2.1.0", + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" + "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.1.tgz", - "integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.1.0.tgz", + "integrity": "sha512-uTX9FBlVQm4S2gVQO1sb5qyBLq/FPjbp+tmGoxu4tIgtYGmBYB44+KX/725RFDe30yBSaA9Ml9fqphe1hbUyLQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.30.1", - "@opentelemetry/resources": "1.30.1", - "@opentelemetry/semantic-conventions": "1.28.0" + "@opentelemetry/core": "2.1.0", + "@opentelemetry/resources": "2.1.0", + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" + "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "node_modules/@opentelemetry/semantic-conventions": { @@ -3681,15 +3569,15 @@ } }, "node_modules/@opentelemetry/sql-common": { - "version": "0.40.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", - "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.0.tgz", + "integrity": "sha512-pmzXctVbEERbqSfiAgdes9Y63xjoOyXcD7B6IXBkVb+vbM7M9U98mn33nGXxPf4dfYR0M+vhcKRZmbSJ7HfqFA==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.1.0" + "@opentelemetry/core": "^2.0.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0" @@ -3728,9 +3616,9 @@ } }, "node_modules/@prisma/client": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.1.tgz", - "integrity": "sha512-QaBCOY29lLAxEFFJgBPyW3WInCW52fJeQTmWx/h6YsP5u0bwuqP51aP0uhqFvhK9DaZPwvai/M4tSDYLVE9vRg==", + "version": "6.16.2", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.2.tgz", + "integrity": "sha512-E00PxBcalMfYO/TWnXobBVUai6eW/g5OsifWQsQDzJYm7yaY+IRLo7ZLsaefi0QkTpxfuhFcQ/w180i6kX3iJw==", "hasInstallScript": true, "license": "Apache-2.0", "engines": { @@ -3807,35 +3695,36 @@ } }, "node_modules/@prisma/instrumentation": { - "version": "5.22.0", - "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-5.22.0.tgz", - "integrity": "sha512-LxccF392NN37ISGxIurUljZSh1YWnphO34V5a0+T7FVQG2u9bhAXRTJpgmQ3483woVhkraQZFF7cbRrpbw/F4Q==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-6.15.0.tgz", + "integrity": "sha512-6TXaH6OmDkMOQvOxwLZ8XS51hU2v4A3vmE2pSijCIiGRJYyNeMcL6nMHQMyYdZRD8wl7LF3Wzc+AMPMV/9Oo7A==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api": "^1.8", - "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0", - "@opentelemetry/sdk-trace-base": "^1.22" + "@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.8" } }, "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/api-logs": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", - "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "version": "0.57.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.2.tgz", + "integrity": "sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "engines": { "node": ">=14" } }, "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", - "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "version": "0.57.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.2.tgz", + "integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.53.0", + "@opentelemetry/api-logs": "0.57.2", "@types/shimmer": "^1.2.0", "import-in-the-middle": "^1.8.1", "require-in-the-middle": "^7.1.1", @@ -4260,78 +4149,100 @@ "license": "Apache-2.0" }, "node_modules/@sentry/core": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.55.0.tgz", - "integrity": "sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==", + "version": "10.12.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.12.0.tgz", + "integrity": "sha512-Jrf0Yo7DvmI/ZQcvBnA0xKNAFkJlVC/fMlvcin+5IrFNRcqOToZ2vtF+XqTgjRZymXQNE8s1QTD7IomPHk0TAw==", "license": "MIT", "engines": { - "node": ">=14.18" + "node": ">=18" } }, "node_modules/@sentry/node": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.55.0.tgz", - "integrity": "sha512-h10LJLDTRAzYgay60Oy7moMookqqSZSviCWkkmHZyaDn+4WURnPp5SKhhfrzPRQcXKrweiOwDSHBgn1tweDssg==", + "version": "10.12.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.12.0.tgz", + "integrity": "sha512-rnrNKJkG8rbm1NZaYAhTfLqGmZmiOjv9Y6apa1G9+hsfAqdK4SGFa/s22WG//qVnvqW4aDXR883Dvc0236op+g==", "license": "MIT", "dependencies": { "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^1.30.1", - "@opentelemetry/core": "^1.30.1", - "@opentelemetry/instrumentation": "^0.57.1", - "@opentelemetry/instrumentation-amqplib": "^0.46.0", - "@opentelemetry/instrumentation-connect": "0.43.0", - "@opentelemetry/instrumentation-dataloader": "0.16.0", - "@opentelemetry/instrumentation-express": "0.47.0", - "@opentelemetry/instrumentation-fastify": "0.44.1", - "@opentelemetry/instrumentation-fs": "0.19.0", - "@opentelemetry/instrumentation-generic-pool": "0.43.0", - "@opentelemetry/instrumentation-graphql": "0.47.0", - "@opentelemetry/instrumentation-hapi": "0.45.1", - "@opentelemetry/instrumentation-http": "0.57.1", - "@opentelemetry/instrumentation-ioredis": "0.47.0", - "@opentelemetry/instrumentation-kafkajs": "0.7.0", - "@opentelemetry/instrumentation-knex": "0.44.0", - "@opentelemetry/instrumentation-koa": "0.47.0", - "@opentelemetry/instrumentation-lru-memoizer": "0.44.0", - "@opentelemetry/instrumentation-mongodb": "0.51.0", - "@opentelemetry/instrumentation-mongoose": "0.46.0", - "@opentelemetry/instrumentation-mysql": "0.45.0", - "@opentelemetry/instrumentation-mysql2": "0.45.0", - "@opentelemetry/instrumentation-nestjs-core": "0.44.0", - "@opentelemetry/instrumentation-pg": "0.50.0", - "@opentelemetry/instrumentation-redis-4": "0.46.0", - "@opentelemetry/instrumentation-tedious": "0.18.0", - "@opentelemetry/instrumentation-undici": "0.10.0", - "@opentelemetry/resources": "^1.30.1", - "@opentelemetry/sdk-trace-base": "^1.30.1", - "@opentelemetry/semantic-conventions": "^1.28.0", - "@prisma/instrumentation": "5.22.0", - "@sentry/core": "8.55.0", - "@sentry/opentelemetry": "8.55.0", - "import-in-the-middle": "^1.11.2" + "@opentelemetry/context-async-hooks": "^2.1.0", + "@opentelemetry/core": "^2.1.0", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/instrumentation-amqplib": "0.51.0", + "@opentelemetry/instrumentation-connect": "0.48.0", + "@opentelemetry/instrumentation-dataloader": "0.22.0", + "@opentelemetry/instrumentation-express": "0.53.0", + "@opentelemetry/instrumentation-fs": "0.24.0", + "@opentelemetry/instrumentation-generic-pool": "0.48.0", + "@opentelemetry/instrumentation-graphql": "0.52.0", + "@opentelemetry/instrumentation-hapi": "0.51.0", + "@opentelemetry/instrumentation-http": "0.204.0", + "@opentelemetry/instrumentation-ioredis": "0.52.0", + "@opentelemetry/instrumentation-kafkajs": "0.14.0", + "@opentelemetry/instrumentation-knex": "0.49.0", + "@opentelemetry/instrumentation-koa": "0.52.0", + "@opentelemetry/instrumentation-lru-memoizer": "0.49.0", + "@opentelemetry/instrumentation-mongodb": "0.57.0", + "@opentelemetry/instrumentation-mongoose": "0.51.0", + "@opentelemetry/instrumentation-mysql": "0.50.0", + "@opentelemetry/instrumentation-mysql2": "0.51.0", + "@opentelemetry/instrumentation-pg": "0.57.0", + "@opentelemetry/instrumentation-redis": "0.53.0", + "@opentelemetry/instrumentation-tedious": "0.23.0", + "@opentelemetry/instrumentation-undici": "0.15.0", + "@opentelemetry/resources": "^2.1.0", + "@opentelemetry/sdk-trace-base": "^2.1.0", + "@opentelemetry/semantic-conventions": "^1.37.0", + "@prisma/instrumentation": "6.15.0", + "@sentry/core": "10.12.0", + "@sentry/node-core": "10.12.0", + "@sentry/opentelemetry": "10.12.0", + "import-in-the-middle": "^1.14.2", + "minimatch": "^9.0.0" }, "engines": { - "node": ">=14.18" + "node": ">=18" } }, - "node_modules/@sentry/opentelemetry": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.55.0.tgz", - "integrity": "sha512-UvatdmSr3Xf+4PLBzJNLZ2JjG1yAPWGe/VrJlJAqyTJ2gKeTzgXJJw8rp4pbvNZO8NaTGEYhhO+scLUj0UtLAQ==", + "node_modules/@sentry/node-core": { + "version": "10.12.0", + "resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.12.0.tgz", + "integrity": "sha512-ki+pX4YyVVMhue1Qso0Kiz862ragDe1PgRc/AgtUJ0jc75s5PTvQw6N+9DAtSahL8t078+8rC7UzyGdLTPCl5w==", "license": "MIT", "dependencies": { - "@sentry/core": "8.55.0" + "@sentry/core": "10.12.0", + "@sentry/opentelemetry": "10.12.0", + "import-in-the-middle": "^1.14.2" }, "engines": { - "node": ">=14.18" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^1.30.1", - "@opentelemetry/core": "^1.30.1", - "@opentelemetry/instrumentation": "^0.57.1", - "@opentelemetry/sdk-trace-base": "^1.30.1", - "@opentelemetry/semantic-conventions": "^1.28.0" + "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", + "@opentelemetry/core": "^1.30.1 || ^2.1.0", + "@opentelemetry/instrumentation": ">=0.57.1 <1", + "@opentelemetry/resources": "^1.30.1 || ^2.1.0", + "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", + "@opentelemetry/semantic-conventions": "^1.37.0" + } + }, + "node_modules/@sentry/opentelemetry": { + "version": "10.12.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.12.0.tgz", + "integrity": "sha512-bkUfLVpu0qTfCrQsz7uE/ch0kCJSV2KlFtguWPLMG2m0JOLDI+iivLm2nbp+Bg16FopZojKs5P8aevCSl+ilEw==", + "license": "MIT", + "dependencies": { + "@sentry/core": "10.12.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", + "@opentelemetry/core": "^1.30.1 || ^2.1.0", + "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", + "@opentelemetry/semantic-conventions": "^1.37.0" } }, "node_modules/@smithy/abort-controller": { @@ -4364,9 +4275,9 @@ } }, "node_modules/@smithy/core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.11.0.tgz", - "integrity": "sha512-Abs5rdP1o8/OINtE49wwNeWuynCu0kme1r4RI3VXVrHr4odVDG7h7mTnw1WXXfN5Il+c25QOnrdL2y56USfxkA==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.11.1.tgz", + "integrity": "sha512-REH7crwORgdjSpYs15JBiIWOYjj0hJNC3aCecpJvAlMMaaqL5i2CLb1i6Hc4yevToTKSqslLMI9FKjhugEwALA==", "license": "Apache-2.0", "dependencies": { "@smithy/middleware-serde": "^4.1.1", @@ -4375,7 +4286,7 @@ "@smithy/util-base64": "^4.1.0", "@smithy/util-body-length-browser": "^4.1.0", "@smithy/util-middleware": "^4.1.1", - "@smithy/util-stream": "^4.3.1", + "@smithy/util-stream": "^4.3.2", "@smithy/util-utf8": "^4.1.0", "@types/uuid": "^9.0.1", "tslib": "^2.6.2", @@ -4391,6 +4302,19 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "license": "MIT" }, + "node_modules/@smithy/core/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@smithy/credential-provider-imds": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.1.2.tgz", @@ -4492,12 +4416,12 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.2.2.tgz", - "integrity": "sha512-M51KcwD+UeSOFtpALGf5OijWt915aQT5eJhqnMKJt7ZTfDfNcvg2UZgIgTZUoiORawb6o5lk4n3rv7vnzQXgsA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.2.3.tgz", + "integrity": "sha512-+1H5A28DeffRVrqmVmtqtRraEjoaC6JVap3xEQdVoBh2EagCVY7noPmcBcG4y7mnr9AJitR1ZAse2l+tEtK5vg==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.11.0", + "@smithy/core": "^3.11.1", "@smithy/middleware-serde": "^4.1.1", "@smithy/node-config-provider": "^4.2.2", "@smithy/shared-ini-file-loader": "^4.2.0", @@ -4511,18 +4435,18 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.2.2.tgz", - "integrity": "sha512-KZJueEOO+PWqflv2oGx9jICpHdBYXwCI19j7e2V3IMwKgFcXc9D9q/dsTf4B+uCnYxjNoS1jpyv6pGNGRsKOXA==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.2.4.tgz", + "integrity": "sha512-amyqYQFewnAviX3yy/rI/n1HqAgfvUdkEhc04kDjxsngAUREKuOI24iwqQUirrj6GtodWmR4iO5Zeyl3/3BwWg==", "license": "Apache-2.0", "dependencies": { "@smithy/node-config-provider": "^4.2.2", "@smithy/protocol-http": "^5.2.1", - "@smithy/service-error-classification": "^4.1.1", - "@smithy/smithy-client": "^4.6.2", + "@smithy/service-error-classification": "^4.1.2", + "@smithy/smithy-client": "^4.6.3", "@smithy/types": "^4.5.0", "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.1", + "@smithy/util-retry": "^4.1.2", "@types/uuid": "^9.0.1", "tslib": "^2.6.2", "uuid": "^9.0.1" @@ -4537,6 +4461,19 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "license": "MIT" }, + "node_modules/@smithy/middleware-retry/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@smithy/middleware-serde": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.1.1.tgz", @@ -4649,9 +4586,9 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.1.1.tgz", - "integrity": "sha512-Iam75b/JNXyDE41UvrlM6n8DNOa/r1ylFyvgruTUx7h2Uk7vDNV9AAwP1vfL1fOL8ls0xArwEGVcGZVd7IO/Cw==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.1.2.tgz", + "integrity": "sha512-Kqd8wyfmBWHZNppZSMfrQFpc3M9Y/kjyN8n8P4DqJJtuwgK1H914R471HTw7+RL+T7+kI1f1gOnL7Vb5z9+NgQ==", "license": "Apache-2.0", "dependencies": { "@smithy/types": "^4.5.0" @@ -4693,17 +4630,17 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.6.2.tgz", - "integrity": "sha512-u82cjh/x7MlMat76Z38TRmEcG6JtrrxN4N2CSNG5o2v2S3hfLAxRgSgFqf0FKM3dglH41Evknt/HOX+7nfzZ3g==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.6.3.tgz", + "integrity": "sha512-K27LqywsaqKz4jusdUQYJh/YP2VbnbdskZ42zG8xfV+eovbTtMc2/ZatLWCfSkW0PDsTUXlpvlaMyu8925HsOw==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.11.0", - "@smithy/middleware-endpoint": "^4.2.2", + "@smithy/core": "^3.11.1", + "@smithy/middleware-endpoint": "^4.2.3", "@smithy/middleware-stack": "^4.1.1", "@smithy/protocol-http": "^5.2.1", "@smithy/types": "^4.5.0", - "@smithy/util-stream": "^4.3.1", + "@smithy/util-stream": "^4.3.2", "tslib": "^2.6.2" }, "engines": { @@ -4800,13 +4737,13 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.1.2.tgz", - "integrity": "sha512-QKrOw01DvNHKgY+3p4r9Ut4u6EHLVZ01u6SkOMe6V6v5C+nRPXJeWh72qCT1HgwU3O7sxAIu23nNh+FOpYVZKA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.1.3.tgz", + "integrity": "sha512-5fm3i2laE95uhY6n6O6uGFxI5SVbqo3/RWEuS3YsT0LVmSZk+0eUqPhKd4qk0KxBRPaT5VNT/WEBUqdMyYoRgg==", "license": "Apache-2.0", "dependencies": { "@smithy/property-provider": "^4.1.1", - "@smithy/smithy-client": "^4.6.2", + "@smithy/smithy-client": "^4.6.3", "@smithy/types": "^4.5.0", "bowser": "^2.11.0", "tslib": "^2.6.2" @@ -4816,16 +4753,16 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.1.2.tgz", - "integrity": "sha512-l2yRmSfx5haYHswPxMmCR6jGwgPs5LjHLuBwlj9U7nNBMS43YV/eevj+Xq1869UYdiynnMrCKtoOYQcwtb6lKg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.1.3.tgz", + "integrity": "sha512-lwnMzlMslZ9GJNt+/wVjz6+fe9Wp5tqR1xAyQn+iywmP+Ymj0F6NhU/KfHM5jhGPQchRSCcau5weKhFdLIM4cA==", "license": "Apache-2.0", "dependencies": { "@smithy/config-resolver": "^4.2.2", "@smithy/credential-provider-imds": "^4.1.2", "@smithy/node-config-provider": "^4.2.2", "@smithy/property-provider": "^4.1.1", - "@smithy/smithy-client": "^4.6.2", + "@smithy/smithy-client": "^4.6.3", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -4873,12 +4810,12 @@ } }, "node_modules/@smithy/util-retry": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.1.1.tgz", - "integrity": "sha512-jGeybqEZ/LIordPLMh5bnmnoIgsqnp4IEimmUp5c5voZ8yx+5kAlN5+juyr7p+f7AtZTgvhmInQk4Q0UVbrZ0Q==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.1.2.tgz", + "integrity": "sha512-NCgr1d0/EdeP6U5PSZ9Uv5SMR5XRRYoVr1kRVtKZxWL3tixEL3UatrPIMFZSKwHlCcp2zPLDvMubVDULRqeunA==", "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^4.1.1", + "@smithy/service-error-classification": "^4.1.2", "@smithy/types": "^4.5.0", "tslib": "^2.6.2" }, @@ -4887,9 +4824,9 @@ } }, "node_modules/@smithy/util-stream": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.3.1.tgz", - "integrity": "sha512-khKkW/Jqkgh6caxMWbMuox9+YfGlsk9OnHOYCGVEdYQb/XVzcORXHLYUubHmmda0pubEDncofUrPNniS9d+uAA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.3.2.tgz", + "integrity": "sha512-Ka+FA2UCC/Q1dEqUanCdpqwxOFdf5Dg2VXtPtB1qxLcSGh5C1HdzklIt18xL504Wiy9nNUKwDMRTVCbKGoK69g==", "license": "Apache-2.0", "dependencies": { "@smithy/fetch-http-handler": "^5.2.1", @@ -5066,9 +5003,9 @@ } }, "node_modules/@types/connect": { - "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -5171,21 +5108,21 @@ "license": "MIT" }, "node_modules/@types/mysql": { - "version": "2.15.26", - "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.26.tgz", - "integrity": "sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==", + "version": "2.15.27", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.27.tgz", + "integrity": "sha512-YfWiV16IY0OeBfBCk8+hXKmdTKrKlwKN1MNKAPBu5JYxLwBEZl7QzeEpGnlZb3VMGJrrGmB84gXiH+ofs/TezA==", "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/node": { - "version": "22.18.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.3.tgz", - "integrity": "sha512-gTVM8js2twdtqM+AE2PdGEe9zGQY4UvmFjan9rZcVb6FGdStfjWoWejdmy4CfWVO9rh5MiYQGZloKAGkJt8lMw==", + "version": "24.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", + "integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", "license": "MIT", "dependencies": { - "undici-types": "~6.21.0" + "undici-types": "~7.12.0" } }, "node_modules/@types/node-cron": { @@ -5206,9 +5143,9 @@ } }, "node_modules/@types/pg": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", - "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "version": "8.15.5", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.5.tgz", + "integrity": "sha512-LF7lF6zWEKxuT3/OR8wAZGzkg4ENGXFNyiV/JeOt9z5B+0ZVwbql9McqX5c/WStFq1GaGso7H1AzP/qSzmlCKQ==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -5256,13 +5193,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/send": { "version": "0.17.5", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", @@ -5312,7 +5242,6 @@ "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", - "dev": true, "license": "MIT" }, "node_modules/@types/validator": { @@ -5322,124 +5251,160 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.44.0.tgz", + "integrity": "sha512-EGDAOGX+uwwekcS0iyxVDmRV9HX6FLSM5kzrAToLTsr9OWCIKG/y3lQheCq18yZ5Xh78rRKJiEpP0ZaCs4ryOQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/type-utils": "8.44.0", + "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.44.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" } }, "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.44.0.tgz", + "integrity": "sha512-VGMpFQGUQWYT9LfnPcX8ouFojyrZ/2w3K5BucvxL/spdNehccKhB4jUyB1yBCXpr2XFm0jkECxgrpXBW2ipoAw==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.44.0.tgz", + "integrity": "sha512-ZeaGNraRsq10GuEohKTo4295Z/SuGcSq2LzfGlqiuEvfArzo/VRrT0ZaJsVPuKZ55lVbNk8U6FcL+ZMH8CoyVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.44.0", + "@typescript-eslint/types": "^8.44.0", + "debug": "^4.3.4" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.44.0.tgz", + "integrity": "sha512-87Jv3E+al8wpD+rIdVJm/ItDBe/Im09zXIjFoipOjr5gHUhJmTzfFLuTJ/nPTMc2Srsroy4IBXwcTCHyRR7KzA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.44.0.tgz", + "integrity": "sha512-x5Y0+AuEPqAInc6yd0n5DAcvtoQ/vyaGwuX5HE9n6qAefk1GaedqrLQF8kQGylLUb9pnZyLf+iEiL9fr8APDtQ==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" - }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.44.0.tgz", + "integrity": "sha512-9cwsoSxJ8Sak67Be/hD2RNt/fsqmWnNE1iHohG8lxqLSNY8xNfyY7wloo5zpW3Nu9hxVgURevqfcH6vvKCt6yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.44.0.tgz", + "integrity": "sha512-ZSl2efn44VsYM0MfDQe68RKzBz75NPgLQXuGypmym6QVOWL5kegTZuZ02xRAT9T+onqvM6T8CdQk0OwYMB6ZvA==", "dev": true, "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -5447,76 +5412,87 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.44.0.tgz", + "integrity": "sha512-lqNj6SgnGcQZwL4/SBJ3xdPEfcBuhCG8zdcwCPgYcmiPLgokiNDKlbPzCwEwu7m279J/lBYWtDYL+87OEfn8Jw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" + "@typescript-eslint/project-service": "8.44.0", + "@typescript-eslint/tsconfig-utils": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "node_modules/@typescript-eslint/utils": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.44.0.tgz", + "integrity": "sha512-nktOlVcg3ALo0mYlV+L7sWUD58KG4CMj1rb2HUVOO4aL3K/6wcD+NERqd0rrA5Vg06b42YhF6cFxeixsp9Riqg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.44.0.tgz", + "integrity": "sha512-zaz9u8EJ4GBmnehlrpoKvj/E3dNbuQ7q0ucyZImm3cLqJ8INTc970B1qEqDX/Rzq65r3TvVTN7kHWPBoyW7DWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.44.0", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@ungap/structured-clone": { @@ -5818,16 +5794,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/array.prototype.findlastindex": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", @@ -6079,77 +6045,6 @@ "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", "license": "BSD-3-Clause" }, - "node_modules/baileys/node_modules/pino": { - "version": "9.9.5", - "resolved": "https://registry.npmjs.org/pino/-/pino-9.9.5.tgz", - "integrity": "sha512-d1s98p8/4TfYhsJ09r/Azt30aYELRi6NNnZtEbqFw6BoGsdPVf5lKNK3kUwH8BmJJfpTLNuicjUQjaMbd93dVg==", - "license": "MIT", - "dependencies": { - "atomic-sleep": "^1.0.0", - "fast-redact": "^3.1.1", - "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "^2.0.0", - "pino-std-serializers": "^7.0.0", - "process-warning": "^5.0.0", - "quick-format-unescaped": "^4.0.3", - "real-require": "^0.2.0", - "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^4.0.1", - "thread-stream": "^3.0.0" - }, - "bin": { - "pino": "bin.js" - } - }, - "node_modules/baileys/node_modules/pino-abstract-transport": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", - "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", - "license": "MIT", - "dependencies": { - "split2": "^4.0.0" - } - }, - "node_modules/baileys/node_modules/pino-std-serializers": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", - "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", - "license": "MIT" - }, - "node_modules/baileys/node_modules/process-warning": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", - "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "MIT" - }, - "node_modules/baileys/node_modules/sonic-boom": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", - "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", - "license": "MIT", - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, - "node_modules/baileys/node_modules/thread-stream": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", - "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", - "license": "MIT", - "dependencies": { - "real-require": "^0.2.0" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -6980,56 +6875,20 @@ "license": "MIT" }, "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "engines": [ - "node >= 0.8" + "node >= 6.0" ], "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", - "readable-stream": "^2.2.2", + "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, - "node_modules/concat-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "license": "MIT" - }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/confbox": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", @@ -7133,12 +6992,6 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "license": "MIT" }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" - }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -7608,19 +7461,6 @@ "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", "license": "MIT" }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -8234,14 +8074,17 @@ } }, "node_modules/eslint-config-prettier": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.2.tgz", - "integrity": "sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ==", + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, "peerDependencies": { "eslint": ">=7.0.0" } @@ -9581,27 +9424,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -11479,10 +11301,9 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -11640,22 +11461,21 @@ "license": "MIT" }, "node_modules/multer": { - "version": "1.4.5-lts.2", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", - "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", - "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz", + "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==", "license": "MIT", "dependencies": { "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "mkdirp": "^0.5.6", "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" + "type-is": "^1.6.18", + "xtend": "^4.0.2" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 10.16.0" } }, "node_modules/music-metadata": { @@ -12545,16 +12365,6 @@ "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "license": "MIT" }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -12702,57 +12512,40 @@ } }, "node_modules/pino": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.21.0.tgz", - "integrity": "sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.10.0.tgz", + "integrity": "sha512-VOFxoNnxICtxaN8S3E73pR66c5MTFC+rwRcNRyHV/bV/c90dXvJqMfjkeRFsGBDXmlUN3LccJQPqGIufnaJePA==", "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "^1.2.0", - "pino-std-serializers": "^6.0.0", - "process-warning": "^3.0.0", + "pino-abstract-transport": "^2.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", "quick-format-unescaped": "^4.0.3", "real-require": "^0.2.0", "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^3.7.0", - "thread-stream": "^2.6.0" + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" }, "bin": { "pino": "bin.js" } }, "node_modules/pino-abstract-transport": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", - "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", + "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", "license": "MIT", "dependencies": { - "readable-stream": "^4.0.0", "split2": "^4.0.0" } }, - "node_modules/pino-abstract-transport/node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/pino-std-serializers": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", "license": "MIT" }, "node_modules/pirates": { @@ -12968,16 +12761,20 @@ "node": ">= 0.6.0" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "license": "MIT" - }, "node_modules/process-warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", - "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", + "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], "license": "MIT" }, "node_modules/protobufjs": { @@ -14150,16 +13947,6 @@ "url": "https://github.com/sponsors/eshaz" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/slice-ansi": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", @@ -14390,9 +14177,9 @@ } }, "node_modules/sonic-boom": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", - "integrity": "sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", + "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" @@ -14772,21 +14559,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/sucrase/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -14894,9 +14666,9 @@ } }, "node_modules/thread-stream": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz", - "integrity": "sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", + "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", "license": "MIT", "dependencies": { "real-require": "^0.2.0" @@ -15043,16 +14815,16 @@ } }, "node_modules/ts-api-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", - "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/ts-interface-checker": { @@ -15365,9 +15137,9 @@ } }, "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", + "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", "license": "MIT" }, "node_modules/unicorn-magic": { @@ -15476,16 +15248,16 @@ } }, "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz", + "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, "node_modules/validator": { diff --git a/package.json b/package.json index e2bb16c1..0ec12f9a 100644 --- a/package.json +++ b/package.json @@ -66,13 +66,14 @@ }, "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", - "@aws-sdk/client-sqs": "^3.723.0", + "@aws-sdk/client-sqs": "^3.891.0", "@ffmpeg-installer/ffmpeg": "^1.1.0", "@figuro/chatwoot-sdk": "^1.1.16", "@hapi/boom": "^10.0.1", "@paralleldrive/cuid2": "^2.2.2", - "@prisma/client": "^6.1.0", - "@sentry/node": "^8.47.0", + "@prisma/client": "^6.16.2", + "@sentry/node": "^10.12.0", + "@types/uuid": "^10.0.0", "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", @@ -100,13 +101,13 @@ "mime": "^4.0.0", "mime-types": "^2.1.35", "minio": "^8.0.3", - "multer": "^1.4.5-lts.1", + "multer": "^2.0.2", "nats": "^2.29.1", "node-cache": "^5.1.2", "node-cron": "^3.0.3", "openai": "^4.77.3", "pg": "^8.13.1", - "pino": "^8.11.0", + "pino": "^9.10.0", "prisma": "^6.1.0", "pusher": "^5.2.0", "qrcode": "^1.5.4", @@ -118,7 +119,8 @@ "socket.io-client": "^4.8.1", "socks-proxy-agent": "^8.0.5", "swagger-ui-express": "^5.0.1", - "tsup": "^8.3.5" + "tsup": "^8.3.5", + "uuid": "^13.0.0" }, "devDependencies": { "@commitlint/cli": "^19.8.1", @@ -129,17 +131,16 @@ "@types/json-schema": "^7.0.15", "@types/mime": "^4.0.0", "@types/mime-types": "^2.1.4", - "@types/node": "^22.10.5", + "@types/node": "^24.5.2", "@types/node-cron": "^3.0.11", "@types/qrcode": "^1.5.5", "@types/qrcode-terminal": "^0.12.2", - "@types/uuid": "^10.0.0", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", "commitizen": "^4.3.1", "cz-conventional-changelog": "^3.3.0", "eslint": "^8.45.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-simple-import-sort": "^10.0.0", From 9d42ad34955048f33bf5bb08fdcda587f27ac91f Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 14:48:56 -0300 Subject: [PATCH 092/129] refactor(eslint): update TypeScript object type usage and adjust linting rules - Change usage of `Object` to `object` in various files for better type safety. - Update ESLint configuration to change `@typescript-eslint/no-unused-vars` from 'error' to 'warn' and disable certain rules related to object types. --- .eslintrc.js | 15 ++++----------- src/api/integrations/event/event.manager.ts | 2 +- src/api/services/channel.service.ts | 2 +- src/cache/localcache.ts | 4 ++-- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b77e37db..b6a6064e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,21 +26,14 @@ module.exports = { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-unused-vars': 'warn', 'import/first': 'error', 'import/no-duplicates': 'error', 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', - '@typescript-eslint/ban-types': [ - 'error', - { - extendDefaults: true, - types: { - '{}': false, - Object: false, - }, - }, - ], + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-wrapper-object-types': 'off', + '@typescript-eslint/no-unused-expressions': 'off', 'prettier/prettier': ['error', { endOfLine: 'auto' }], }, }; diff --git a/src/api/integrations/event/event.manager.ts b/src/api/integrations/event/event.manager.ts index 4b4a310c..fe3256c9 100644 --- a/src/api/integrations/event/event.manager.ts +++ b/src/api/integrations/event/event.manager.ts @@ -105,7 +105,7 @@ export class EventManager { instanceName: string; origin: string; event: string; - data: Object; + data: object; serverUrl: string; dateTime: string; sender: string; diff --git a/src/api/services/channel.service.ts b/src/api/services/channel.service.ts index 4b39520e..033a3224 100644 --- a/src/api/services/channel.service.ts +++ b/src/api/services/channel.service.ts @@ -431,7 +431,7 @@ export class ChannelStartupService { return data; } - public async sendDataWebhook(event: Events, data: T, local = true, integration?: string[]) { + public async sendDataWebhook(event: Events, data: T, local = true, integration?: string[]) { const serverUrl = this.configService.get('SERVER').URL; const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds const localISOTime = new Date(Date.now() - tzoffset).toISOString(); diff --git a/src/cache/localcache.ts b/src/cache/localcache.ts index 2aa2007e..f7769e58 100644 --- a/src/cache/localcache.ts +++ b/src/cache/localcache.ts @@ -53,7 +53,7 @@ export class LocalCache implements ICache { async hGet(key: string, field: string) { try { - const data = LocalCache.localCache.get(this.buildKey(key)) as Object; + const data = LocalCache.localCache.get(this.buildKey(key)) as object; if (data && field in data) { return JSON.parse(data[field], BufferJSON.reviver); @@ -84,7 +84,7 @@ export class LocalCache implements ICache { async hDelete(key: string, field: string) { try { - const data = LocalCache.localCache.get(this.buildKey(key)) as Object; + const data = LocalCache.localCache.get(this.buildKey(key)) as object; if (data && field in data) { delete data[field]; From 5bdd6ad9d8ebcf09283961908f4f79f00047b72d Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 14:54:12 -0300 Subject: [PATCH 093/129] chore(dependencies): upgrade eslint-plugin-simple-import-sort to version 12.1.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 213132d0..d898321d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,7 +87,7 @@ "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "husky": "^9.1.7", "lint-staged": "^16.1.6", "prettier": "^3.4.2", @@ -8288,9 +8288,9 @@ } }, "node_modules/eslint-plugin-simple-import-sort": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", - "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/package.json b/package.json index 0ec12f9a..b3771546 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "husky": "^9.1.7", "lint-staged": "^16.1.6", "prettier": "^3.4.2", From 0787a10f391b89c547336205b7c9c88506e991a4 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 14:55:11 -0300 Subject: [PATCH 094/129] chore(dependabot): remove dependabot configuration file --- .github/dependabot.yml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 916a903b..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: 2 -updates: - # Enable version updates for npm - - package-ecosystem: "npm" - directory: "/" - target-branch: "develop" - schedule: - interval: "weekly" - day: "monday" - time: "09:00" - open-pull-requests-limit: 10 - commit-message: - prefix: "chore" - prefix-development: "chore" - include: "scope" - - # Enable version updates for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - target-branch: "develop" - schedule: - interval: "weekly" - day: "monday" - time: "09:00" - open-pull-requests-limit: 5 - commit-message: - prefix: "ci" - include: "scope" - - # Enable version updates for Docker - - package-ecosystem: "docker" - directory: "/" - target-branch: "develop" - schedule: - interval: "weekly" - day: "monday" - time: "09:00" - open-pull-requests-limit: 5 - commit-message: - prefix: "chore" - include: "scope" From 5e08628d8934a36e5f4ec903891f705b5844d7f4 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 14:59:33 -0300 Subject: [PATCH 095/129] refactor(eslint): change unused vars rule to error and update error handling in services - Update ESLint configuration to set `@typescript-eslint/no-unused-vars` from 'warn' to 'error' for stricter linting. - Refactor error handling in various services to omit error variable in catch blocks for cleaner code. --- .eslintrc.js | 2 +- .../whatsapp/whatsapp.baileys.service.ts | 26 +++++++++---------- .../chatbot/base-chatbot.service.ts | 2 +- .../chatwoot/services/chatwoot.service.ts | 8 +++--- .../storage/s3/libs/minio.server.ts | 2 +- src/api/services/proxy.service.ts | 2 +- src/api/services/settings.service.ts | 2 +- src/utils/use-multi-file-auth-state-prisma.ts | 14 +++++----- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b6a6064e..8f54a776 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,7 +26,7 @@ module.exports = { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-unused-vars': 'error', 'import/first': 'error', 'import/no-duplicates': 'error', 'simple-import-sort/imports': 'error', diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 022ea8fd..34ef1366 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -445,7 +445,7 @@ export class BaileysStartupService extends ChannelStartupService { try { const profilePic = await this.profilePicture(this.instance.wuid); this.instance.profilePictureUrl = profilePic.profilePictureUrl; - } catch (error) { + } catch { this.instance.profilePictureUrl = null; } const formattedWuid = this.instance.wuid.split('@')[0].padEnd(30, ' '); @@ -524,7 +524,7 @@ export class BaileysStartupService extends ChannelStartupService { } return webMessageInfo[0].message; - } catch (error) { + } catch { return { conversation: '' }; } } @@ -597,7 +597,7 @@ export class BaileysStartupService extends ChannelStartupService { const rand = Math.floor(Math.random() * Math.floor(proxyUrls.length)); const proxyUrl = 'http://' + proxyUrls[rand]; options = { agent: makeProxyAgent(proxyUrl), fetchAgent: makeProxyAgent(proxyUrl) }; - } catch (error) { + } catch { this.localProxy.enabled = false; } } else { @@ -1189,7 +1189,7 @@ export class BaileysStartupService extends ChannelStartupService { where: { id: existingChat.id }, data: { name: received.pushName }, }); - } catch (error) { + } catch { console.log(`Chat insert record ignored: ${received.key.remoteJid} - ${this.instanceId}`); } } @@ -1564,7 +1564,7 @@ export class BaileysStartupService extends ChannelStartupService { if (this.configService.get('DATABASE').SAVE_DATA.CHATS) { try { await this.prismaRepository.chat.update({ where: { id: existingChat.id }, data: chatToInsert }); - } catch (error) { + } catch { console.log(`Chat insert record ignored: ${chatToInsert.remoteJid} - ${chatToInsert.instanceId}`); } } @@ -1832,7 +1832,7 @@ export class BaileysStartupService extends ChannelStartupService { const profilePictureUrl = await this.client.profilePictureUrl(jid, 'image'); return { wuid: jid, profilePictureUrl }; - } catch (error) { + } catch { return { wuid: jid, profilePictureUrl: null }; } } @@ -1842,7 +1842,7 @@ export class BaileysStartupService extends ChannelStartupService { try { return { wuid: jid, status: (await this.client.fetchStatus(jid))[0]?.status }; - } catch (error) { + } catch { return { wuid: jid, status: null }; } } @@ -1891,7 +1891,7 @@ export class BaileysStartupService extends ChannelStartupService { website: business?.website?.shift(), }; } - } catch (error) { + } catch { return { wuid: jid, name: null, picture: null, status: null, os: null, isBusiness: false }; } } @@ -2131,7 +2131,7 @@ export class BaileysStartupService extends ChannelStartupService { if (!cache.REDIS.ENABLED && !cache.LOCAL.ENABLED) group = await this.findGroup({ groupJid: sender }, 'inner'); else group = await this.getGroupMetadataCache(sender); // group = await this.findGroup({ groupJid: sender }, 'inner'); - } catch (error) { + } catch { throw new NotFoundException('Group not found'); } @@ -3640,7 +3640,7 @@ export class BaileysStartupService extends ChannelStartupService { {}, { logger: P({ level: 'error' }) as any, reuploadRequest: this.client.updateMediaMessage }, ); - } catch (err) { + } catch { this.logger.error('Download Media failed, trying to retry in 5 seconds...'); await new Promise((resolve) => setTimeout(resolve, 5000)); const mediaType = Object.keys(msg.message).find((key) => key.endsWith('Message')); @@ -4230,7 +4230,7 @@ export class BaileysStartupService extends ChannelStartupService { public async inviteInfo(id: GroupInvite) { try { return await this.client.groupGetInviteInfo(id.inviteCode); - } catch (error) { + } catch { throw new NotFoundException('No invite info', id.inviteCode); } } @@ -4253,7 +4253,7 @@ export class BaileysStartupService extends ChannelStartupService { } return { send: true, inviteUrl }; - } catch (error) { + } catch { throw new NotFoundException('No send invite'); } } @@ -4717,7 +4717,7 @@ export class BaileysStartupService extends ChannelStartupService { collectionsLength: collections?.length, collections: collections, }; - } catch (error) { + } catch { return { wuid: jid, name: null, isBusiness: false }; } } diff --git a/src/api/integrations/chatbot/base-chatbot.service.ts b/src/api/integrations/chatbot/base-chatbot.service.ts index f19cb9d4..34cb765f 100644 --- a/src/api/integrations/chatbot/base-chatbot.service.ts +++ b/src/api/integrations/chatbot/base-chatbot.service.ts @@ -49,7 +49,7 @@ export abstract class BaseChatbotService { try { JSON.parse(str); return true; - } catch (e) { + } catch { return false; } } diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index be3d5620..5020bfa6 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -130,7 +130,7 @@ export class ChatwootService { public async find(instance: InstanceDto): Promise { try { return await this.waMonitor.waInstances[instance.instanceName].findChatwoot(); - } catch (error) { + } catch { this.logger.error('chatwoot not found'); return { enabled: null, url: '' }; } @@ -370,7 +370,7 @@ export class ChatwootService { }); return contact; - } catch (error) { + } catch { return null; } } @@ -407,7 +407,7 @@ export class ChatwootService { } return true; - } catch (error) { + } catch { return false; } } @@ -2552,7 +2552,7 @@ export class ChatwootService { await chatwootImport.importHistoryMessages(instance, this, inbox, this.provider); const waInstance = this.waMonitor.waInstances[instance.instanceName]; waInstance.clearCacheChatwoot(); - } catch (error) { + } catch { return; } } diff --git a/src/api/integrations/storage/s3/libs/minio.server.ts b/src/api/integrations/storage/s3/libs/minio.server.ts index 8d296fdc..47145a4c 100644 --- a/src/api/integrations/storage/s3/libs/minio.server.ts +++ b/src/api/integrations/storage/s3/libs/minio.server.ts @@ -33,7 +33,7 @@ const bucketExists = async () => { try { const list = await minioClient.listBuckets(); return list.find((bucket) => bucket.name === bucketName); - } catch (error) { + } catch { return false; } } diff --git a/src/api/services/proxy.service.ts b/src/api/services/proxy.service.ts index 69ba87b4..a1e5b210 100644 --- a/src/api/services/proxy.service.ts +++ b/src/api/services/proxy.service.ts @@ -25,7 +25,7 @@ export class ProxyService { } return result; - } catch (error) { + } catch { return null; } } diff --git a/src/api/services/settings.service.ts b/src/api/services/settings.service.ts index 5b7ab1b8..da477c46 100644 --- a/src/api/services/settings.service.ts +++ b/src/api/services/settings.service.ts @@ -24,7 +24,7 @@ export class SettingsService { } return result; - } catch (error) { + } catch { return null; } } diff --git a/src/utils/use-multi-file-auth-state-prisma.ts b/src/utils/use-multi-file-auth-state-prisma.ts index 7278c056..0f7faa07 100644 --- a/src/utils/use-multi-file-auth-state-prisma.ts +++ b/src/utils/use-multi-file-auth-state-prisma.ts @@ -19,7 +19,7 @@ export async function keyExists(sessionId: string): Promise { try { const key = await prismaRepository.session.findUnique({ where: { sessionId: sessionId } }); return !!key; - } catch (error) { + } catch { return false; } } @@ -38,7 +38,7 @@ export async function saveKey(sessionId: string, keyJson: any): Promise { where: { sessionId: sessionId }, data: { creds: JSON.stringify(keyJson) }, }); - } catch (error) { + } catch { return null; } } @@ -49,7 +49,7 @@ export async function getAuthKey(sessionId: string): Promise { if (!register) return null; const auth = await prismaRepository.session.findUnique({ where: { sessionId: sessionId } }); return JSON.parse(auth?.creds); - } catch (error) { + } catch { return null; } } @@ -59,7 +59,7 @@ async function deleteAuthKey(sessionId: string): Promise { const register = await keyExists(sessionId); if (!register) return; await prismaRepository.session.delete({ where: { sessionId: sessionId } }); - } catch (error) { + } catch { return; } } @@ -68,7 +68,7 @@ async function fileExists(file: string): Promise { try { const stat = await fs.stat(file); if (stat.isFile()) return true; - } catch (error) { + } catch { return; } } @@ -119,7 +119,7 @@ export default async function useMultiFileAuthStatePrisma( const parsedData = JSON.parse(rawData, BufferJSON.reviver); return parsedData; - } catch (error) { + } catch { return null; } } @@ -137,7 +137,7 @@ export default async function useMultiFileAuthStatePrisma( } else { await deleteAuthKey(sessionId); } - } catch (error) { + } catch { return; } } From 8ab41fcfc988f9f6061495ccd776b9cda408d032 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 15:44:56 -0300 Subject: [PATCH 096/129] feat(kafka): add Kafka integration for event streaming - Introduced Kafka support in the Evolution API, allowing for real-time event streaming and processing. - Updated environment configuration to include Kafka-related variables. - Added KafkaController and KafkaRouter for managing Kafka events. - Enhanced event management to support Kafka alongside existing integrations. - Updated database schemas and migrations for Kafka integration in both MySQL and PostgreSQL. - Documented Kafka integration in the README file. --- .env.example | 54 +++ README.md | 3 + package-lock.json | 10 + package.json | 1 + .../migration.sql | 231 ++++++++++ prisma/mysql-schema.prisma | 28 +- .../migration.sql | 17 + prisma/postgresql-schema.prisma | 11 + prisma/psql_bouncer-schema.prisma | 11 + src/api/integrations/event/event.dto.ts | 10 + src/api/integrations/event/event.manager.ts | 39 +- src/api/integrations/event/event.router.ts | 2 + src/api/integrations/event/event.schema.ts | 3 + .../event/kafka/kafka.controller.ts | 414 ++++++++++++++++++ .../integrations/event/kafka/kafka.router.ts | 36 ++ .../integrations/event/kafka/kafka.schema.ts | 21 + src/config/env.config.ts | 91 ++++ 17 files changed, 969 insertions(+), 13 deletions(-) create mode 100644 prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql create mode 100644 prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql create mode 100644 src/api/integrations/event/kafka/kafka.controller.ts create mode 100644 src/api/integrations/event/kafka/kafka.router.ts create mode 100644 src/api/integrations/event/kafka/kafka.schema.ts diff --git a/.env.example b/.env.example index 52644bea..73a3b40d 100644 --- a/.env.example +++ b/.env.example @@ -190,6 +190,60 @@ PUSHER_EVENTS_CALL=true PUSHER_EVENTS_TYPEBOT_START=false PUSHER_EVENTS_TYPEBOT_CHANGE_STATUS=false +# Kafka - Environment variables +KAFKA_ENABLED=false +KAFKA_CLIENT_ID=evolution-api +KAFKA_BROKERS=localhost:9092 +KAFKA_CONNECTION_TIMEOUT=3000 +KAFKA_REQUEST_TIMEOUT=30000 +# Global events - By enabling this variable, events from all instances are sent to global Kafka topics. +KAFKA_GLOBAL_ENABLED=false +KAFKA_CONSUMER_GROUP_ID=evolution-api-consumers +KAFKA_TOPIC_PREFIX=evolution +KAFKA_NUM_PARTITIONS=1 +KAFKA_REPLICATION_FACTOR=1 +KAFKA_AUTO_CREATE_TOPICS=false +# Choose the events you want to send to Kafka +KAFKA_EVENTS_APPLICATION_STARTUP=false +KAFKA_EVENTS_INSTANCE_CREATE=false +KAFKA_EVENTS_INSTANCE_DELETE=false +KAFKA_EVENTS_QRCODE_UPDATED=false +KAFKA_EVENTS_MESSAGES_SET=false +KAFKA_EVENTS_MESSAGES_UPSERT=false +KAFKA_EVENTS_MESSAGES_EDITED=false +KAFKA_EVENTS_MESSAGES_UPDATE=false +KAFKA_EVENTS_MESSAGES_DELETE=false +KAFKA_EVENTS_SEND_MESSAGE=false +KAFKA_EVENTS_SEND_MESSAGE_UPDATE=false +KAFKA_EVENTS_CONTACTS_SET=false +KAFKA_EVENTS_CONTACTS_UPSERT=false +KAFKA_EVENTS_CONTACTS_UPDATE=false +KAFKA_EVENTS_PRESENCE_UPDATE=false +KAFKA_EVENTS_CHATS_SET=false +KAFKA_EVENTS_CHATS_UPSERT=false +KAFKA_EVENTS_CHATS_UPDATE=false +KAFKA_EVENTS_CHATS_DELETE=false +KAFKA_EVENTS_GROUPS_UPSERT=false +KAFKA_EVENTS_GROUPS_UPDATE=false +KAFKA_EVENTS_GROUP_PARTICIPANTS_UPDATE=false +KAFKA_EVENTS_CONNECTION_UPDATE=false +KAFKA_EVENTS_LABELS_EDIT=false +KAFKA_EVENTS_LABELS_ASSOCIATION=false +KAFKA_EVENTS_CALL=false +KAFKA_EVENTS_TYPEBOT_START=false +KAFKA_EVENTS_TYPEBOT_CHANGE_STATUS=false +# SASL Authentication (optional) +KAFKA_SASL_ENABLED=false +KAFKA_SASL_MECHANISM=plain +KAFKA_SASL_USERNAME= +KAFKA_SASL_PASSWORD= +# SSL Configuration (optional) +KAFKA_SSL_ENABLED=false +KAFKA_SSL_REJECT_UNAUTHORIZED=true +KAFKA_SSL_CA= +KAFKA_SSL_KEY= +KAFKA_SSL_CERT= + # WhatsApp Business API - Environment variables # Token used to validate the webhook on the Facebook APP WA_BUSINESS_TOKEN_WEBHOOK=evolution diff --git a/README.md b/README.md index 5f486a15..eb7e638c 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ Evolution API supports various integrations to enhance its functionality. Below - [RabbitMQ](https://www.rabbitmq.com/): - Receive events from the Evolution API via RabbitMQ. +- [Apache Kafka](https://kafka.apache.org/): + - Receive events from the Evolution API via Apache Kafka for real-time event streaming and processing. + - [Amazon SQS](https://aws.amazon.com/pt/sqs/): - Receive events from the Evolution API via Amazon SQS. diff --git a/package-lock.json b/package-lock.json index d898321d..f1f483e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,7 @@ "json-schema": "^0.4.0", "jsonschema": "^1.4.1", "jsonwebtoken": "^9.0.2", + "kafkajs": "^2.2.4", "link-preview-js": "^3.0.13", "long": "^5.2.3", "mediainfo.js": "^0.3.4", @@ -10718,6 +10719,15 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/kafkajs": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/kafkajs/-/kafkajs-2.2.4.tgz", + "integrity": "sha512-j/YeapB1vfPT2iOIUn/vxdyKEuhuY2PxMBvf5JWux6iSaukAccrMtXEY/Lb7OvavDhOWME589bpLrEdnVHjfjA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/keyv": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.1.tgz", diff --git a/package.json b/package.json index b3771546..6168e11c 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "json-schema": "^0.4.0", "jsonschema": "^1.4.1", "jsonwebtoken": "^9.0.2", + "kafkajs": "^2.2.4", "link-preview-js": "^3.0.13", "long": "^5.2.3", "mediainfo.js": "^0.3.4", diff --git a/prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql b/prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql new file mode 100644 index 00000000..c3a089bd --- /dev/null +++ b/prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql @@ -0,0 +1,231 @@ +/* + Warnings: + + - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Evoai` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Evoai` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `EvoaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `EvoaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to drop the column `lid` on the `IsOnWhatsapp` table. All the data in the column will be lost. + - You are about to alter the column `createdAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `N8n` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `N8n` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `N8nSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `N8nSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Nats` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Nats` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to drop the column `splitMessages` on the `Typebot` table. All the data in the column will be lost. + - You are about to drop the column `timePerChar` on the `Typebot` table. All the data in the column will be lost. + - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to drop the column `splitMessages` on the `TypebotSetting` table. All the data in the column will be lost. + - You are about to drop the column `timePerChar` on the `TypebotSetting` table. All the data in the column will be lost. + - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + +*/ +-- DropIndex +DROP INDEX `unique_remote_instance` ON `Chat`; + +-- AlterTable +ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Evoai` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `EvoaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `EvolutionBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `EvolutionBotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `IsOnWhatsapp` DROP COLUMN `lid`, + MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; + +-- AlterTable +ALTER TABLE `N8n` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `N8nSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Nats` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Pusher` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; + +-- AlterTable +ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Typebot` DROP COLUMN `splitMessages`, + DROP COLUMN `timePerChar`, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `TypebotSetting` DROP COLUMN `splitMessages`, + DROP COLUMN `timePerChar`, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- CreateTable +CREATE TABLE `Kafka` ( + `id` VARCHAR(191) NOT NULL, + `enabled` BOOLEAN NOT NULL DEFAULT false, + `events` JSON NOT NULL, + `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + `updatedAt` TIMESTAMP NOT NULL, + `instanceId` VARCHAR(191) NOT NULL, + + UNIQUE INDEX `Kafka_instanceId_key`(`instanceId`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `Kafka` ADD CONSTRAINT `Kafka_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/mysql-schema.prisma b/prisma/mysql-schema.prisma index 70efea47..71b5a743 100644 --- a/prisma/mysql-schema.prisma +++ b/prisma/mysql-schema.prisma @@ -88,6 +88,7 @@ model Instance { Rabbitmq Rabbitmq? Nats Nats? Sqs Sqs? + Kafka Kafka? Websocket Websocket? Typebot Typebot[] Session Session? @@ -105,8 +106,11 @@ model Instance { EvolutionBotSetting EvolutionBotSetting? Flowise Flowise[] FlowiseSetting FlowiseSetting? - Pusher Pusher? N8n N8n[] + N8nSetting N8nSetting? + Evoai Evoai[] + EvoaiSetting EvoaiSetting? + Pusher Pusher? } model Session { @@ -309,6 +313,16 @@ model Sqs { instanceId String @unique } +model Kafka { + id String @id @default(cuid()) + enabled Boolean @default(false) + events Json @db.Json + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp + Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) + instanceId String @unique +} + model Websocket { id String @id @default(cuid()) enabled Boolean @default(false) @@ -647,7 +661,7 @@ model IsOnWhatsapp { model N8n { id String @id @default(cuid()) - enabled Boolean @default(true) @db.TinyInt(1) + enabled Boolean @default(true) @db.TinyInt() description String? @db.VarChar(255) webhookUrl String? @db.VarChar(255) basicAuthUser String? @db.VarChar(255) @@ -666,7 +680,7 @@ model N8n { triggerType TriggerType? triggerOperator TriggerOperator? triggerValue String? - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) instanceId String @@ -686,7 +700,7 @@ model N8nSetting { ignoreJids Json? splitMessages Boolean? @default(false) timePerChar Int? @default(50) @db.Int - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Fallback N8n? @relation(fields: [n8nIdFallback], references: [id]) n8nIdFallback String? @db.VarChar(100) @@ -696,7 +710,7 @@ model N8nSetting { model Evoai { id String @id @default(cuid()) - enabled Boolean @default(true) @db.TinyInt(1) + enabled Boolean @default(true) @db.TinyInt() description String? @db.VarChar(255) agentUrl String? @db.VarChar(255) apiKey String? @db.VarChar(255) @@ -714,7 +728,7 @@ model Evoai { triggerType TriggerType? triggerOperator TriggerOperator? triggerValue String? - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) instanceId String @@ -734,7 +748,7 @@ model EvoaiSetting { ignoreJids Json? splitMessages Boolean? @default(false) timePerChar Int? @default(50) @db.Int - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id]) evoaiIdFallback String? @db.VarChar(100) diff --git a/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql b/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql new file mode 100644 index 00000000..16ef2d7c --- /dev/null +++ b/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql @@ -0,0 +1,17 @@ +-- CreateTable +CREATE TABLE "public"."Kafka" ( + "id" TEXT NOT NULL, + "enabled" BOOLEAN NOT NULL DEFAULT false, + "events" JSONB NOT NULL, + "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP NOT NULL, + "instanceId" TEXT NOT NULL, + + CONSTRAINT "Kafka_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Kafka_instanceId_key" ON "public"."Kafka"("instanceId"); + +-- AddForeignKey +ALTER TABLE "public"."Kafka" ADD CONSTRAINT "Kafka_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "public"."Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/postgresql-schema.prisma b/prisma/postgresql-schema.prisma index 221d69d9..e14f8d49 100644 --- a/prisma/postgresql-schema.prisma +++ b/prisma/postgresql-schema.prisma @@ -88,6 +88,7 @@ model Instance { Rabbitmq Rabbitmq? Nats Nats? Sqs Sqs? + Kafka Kafka? Websocket Websocket? Typebot Typebot[] Session Session? @@ -312,6 +313,16 @@ model Sqs { instanceId String @unique } +model Kafka { + id String @id @default(cuid()) + enabled Boolean @default(false) @db.Boolean + events Json @db.JsonB + createdAt DateTime? @default(now()) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp + Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) + instanceId String @unique +} + model Websocket { id String @id @default(cuid()) enabled Boolean @default(false) @db.Boolean diff --git a/prisma/psql_bouncer-schema.prisma b/prisma/psql_bouncer-schema.prisma index 4754f165..a3f4dbe9 100644 --- a/prisma/psql_bouncer-schema.prisma +++ b/prisma/psql_bouncer-schema.prisma @@ -89,6 +89,7 @@ model Instance { Rabbitmq Rabbitmq? Nats Nats? Sqs Sqs? + Kafka Kafka? Websocket Websocket? Typebot Typebot[] Session Session? @@ -313,6 +314,16 @@ model Sqs { instanceId String @unique } +model Kafka { + id String @id @default(cuid()) + enabled Boolean @default(false) @db.Boolean + events Json @db.JsonB + createdAt DateTime? @default(now()) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp + Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) + instanceId String @unique +} + model Websocket { id String @id @default(cuid()) enabled Boolean @default(false) @db.Boolean diff --git a/src/api/integrations/event/event.dto.ts b/src/api/integrations/event/event.dto.ts index 84426764..b5292993 100644 --- a/src/api/integrations/event/event.dto.ts +++ b/src/api/integrations/event/event.dto.ts @@ -40,6 +40,11 @@ export class EventDto { useTLS?: boolean; events?: string[]; }; + + kafka?: { + enabled?: boolean; + events?: string[]; + }; } export function EventInstanceMixin(Base: TBase) { @@ -82,5 +87,10 @@ export function EventInstanceMixin(Base: TBase) { useTLS?: boolean; events?: string[]; }; + + kafka?: { + enabled?: boolean; + events?: string[]; + }; }; } diff --git a/src/api/integrations/event/event.manager.ts b/src/api/integrations/event/event.manager.ts index fe3256c9..90547932 100644 --- a/src/api/integrations/event/event.manager.ts +++ b/src/api/integrations/event/event.manager.ts @@ -1,3 +1,4 @@ +import { KafkaController } from '@api/integrations/event/kafka/kafka.controller'; import { NatsController } from '@api/integrations/event/nats/nats.controller'; import { PusherController } from '@api/integrations/event/pusher/pusher.controller'; import { RabbitmqController } from '@api/integrations/event/rabbitmq/rabbitmq.controller'; @@ -17,6 +18,7 @@ export class EventManager { private natsController: NatsController; private sqsController: SqsController; private pusherController: PusherController; + private kafkaController: KafkaController; constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { this.prisma = prismaRepository; @@ -28,6 +30,7 @@ export class EventManager { this.nats = new NatsController(prismaRepository, waMonitor); this.sqs = new SqsController(prismaRepository, waMonitor); this.pusher = new PusherController(prismaRepository, waMonitor); + this.kafka = new KafkaController(prismaRepository, waMonitor); } public set prisma(prisma: PrismaRepository) { @@ -93,12 +96,20 @@ export class EventManager { return this.pusherController; } + public set kafka(kafka: KafkaController) { + this.kafkaController = kafka; + } + public get kafka() { + return this.kafkaController; + } + public init(httpServer: Server): void { this.websocket.init(httpServer); this.rabbitmq.init(); this.nats.init(); this.sqs.init(); this.pusher.init(); + this.kafka.init(); } public async emit(eventData: { @@ -119,42 +130,47 @@ export class EventManager { await this.sqs.emit(eventData); await this.webhook.emit(eventData); await this.pusher.emit(eventData); + await this.kafka.emit(eventData); } public async setInstance(instanceName: string, data: any): Promise { - if (data.websocket) + if (data.websocket) { await this.websocket.set(instanceName, { websocket: { enabled: true, events: data.websocket?.events, }, }); + } - if (data.rabbitmq) + if (data.rabbitmq) { await this.rabbitmq.set(instanceName, { rabbitmq: { enabled: true, events: data.rabbitmq?.events, }, }); + } - if (data.nats) + if (data.nats) { await this.nats.set(instanceName, { nats: { enabled: true, events: data.nats?.events, }, }); + } - if (data.sqs) + if (data.sqs) { await this.sqs.set(instanceName, { sqs: { enabled: true, events: data.sqs?.events, }, }); + } - if (data.webhook) + if (data.webhook) { await this.webhook.set(instanceName, { webhook: { enabled: true, @@ -165,8 +181,9 @@ export class EventManager { byEvents: data.webhook?.byEvents, }, }); + } - if (data.pusher) + if (data.pusher) { await this.pusher.set(instanceName, { pusher: { enabled: true, @@ -178,5 +195,15 @@ export class EventManager { useTLS: data.pusher?.useTLS, }, }); + } + + if (data.kafka) { + await this.kafka.set(instanceName, { + kafka: { + enabled: true, + events: data.kafka?.events, + }, + }); + } } } diff --git a/src/api/integrations/event/event.router.ts b/src/api/integrations/event/event.router.ts index 49a6ec60..f80907bc 100644 --- a/src/api/integrations/event/event.router.ts +++ b/src/api/integrations/event/event.router.ts @@ -1,3 +1,4 @@ +import { KafkaRouter } from '@api/integrations/event/kafka/kafka.router'; import { NatsRouter } from '@api/integrations/event/nats/nats.router'; import { PusherRouter } from '@api/integrations/event/pusher/pusher.router'; import { RabbitmqRouter } from '@api/integrations/event/rabbitmq/rabbitmq.router'; @@ -18,5 +19,6 @@ export class EventRouter { this.router.use('/nats', new NatsRouter(...guards).router); this.router.use('/pusher', new PusherRouter(...guards).router); this.router.use('/sqs', new SqsRouter(...guards).router); + this.router.use('/kafka', new KafkaRouter(...guards).router); } } diff --git a/src/api/integrations/event/event.schema.ts b/src/api/integrations/event/event.schema.ts index 464ee02b..812bbd53 100644 --- a/src/api/integrations/event/event.schema.ts +++ b/src/api/integrations/event/event.schema.ts @@ -22,6 +22,9 @@ export const eventSchema: JSONSchema7 = { sqs: { $ref: '#/$defs/event', }, + kafka: { + $ref: '#/$defs/event', + }, }, $defs: { event: { diff --git a/src/api/integrations/event/kafka/kafka.controller.ts b/src/api/integrations/event/kafka/kafka.controller.ts new file mode 100644 index 00000000..416bcb13 --- /dev/null +++ b/src/api/integrations/event/kafka/kafka.controller.ts @@ -0,0 +1,414 @@ +import { PrismaRepository } from '@api/repository/repository.service'; +import { WAMonitoringService } from '@api/services/monitor.service'; +import { configService, Kafka, Log } from '@config/env.config'; +import { Logger } from '@config/logger.config'; +import { Consumer, ConsumerConfig, Kafka as KafkaJS, KafkaConfig, Producer, ProducerConfig } from 'kafkajs'; + +import { EmitData, EventController, EventControllerInterface } from '../event.controller'; + +export class KafkaController extends EventController implements EventControllerInterface { + private kafkaClient: KafkaJS | null = null; + private producer: Producer | null = null; + private consumer: Consumer | null = null; + private readonly logger = new Logger('KafkaController'); + private reconnectAttempts = 0; + private maxReconnectAttempts = 10; + private reconnectDelay = 5000; // 5 seconds + private isReconnecting = false; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor, configService.get('KAFKA')?.ENABLED, 'kafka'); + } + + public async init(): Promise { + if (!this.status) { + return; + } + + await this.connect(); + } + + private async connect(): Promise { + try { + const kafkaConfig = configService.get('KAFKA'); + + const clientConfig: KafkaConfig = { + clientId: kafkaConfig.CLIENT_ID || 'evolution-api', + brokers: kafkaConfig.BROKERS || ['localhost:9092'], + connectionTimeout: kafkaConfig.CONNECTION_TIMEOUT || 3000, + requestTimeout: kafkaConfig.REQUEST_TIMEOUT || 30000, + retry: { + initialRetryTime: 100, + retries: 8, + }, + }; + + // Add SASL authentication if configured + if (kafkaConfig.SASL?.ENABLED) { + clientConfig.sasl = { + mechanism: (kafkaConfig.SASL.MECHANISM as any) || 'plain', + username: kafkaConfig.SASL.USERNAME, + password: kafkaConfig.SASL.PASSWORD, + }; + } + + // Add SSL configuration if enabled + if (kafkaConfig.SSL?.ENABLED) { + clientConfig.ssl = { + rejectUnauthorized: kafkaConfig.SSL.REJECT_UNAUTHORIZED !== false, + ca: kafkaConfig.SSL.CA ? [kafkaConfig.SSL.CA] : undefined, + key: kafkaConfig.SSL.KEY, + cert: kafkaConfig.SSL.CERT, + }; + } + + this.kafkaClient = new KafkaJS(clientConfig); + + // Initialize producer + const producerConfig: ProducerConfig = { + maxInFlightRequests: 1, + idempotent: true, + transactionTimeout: 30000, + }; + + this.producer = this.kafkaClient.producer(producerConfig); + await this.producer.connect(); + + // Initialize consumer for global events if enabled + if (kafkaConfig.GLOBAL_ENABLED) { + await this.initGlobalConsumer(); + } + + this.reconnectAttempts = 0; + this.isReconnecting = false; + + this.logger.info('Kafka initialized successfully'); + + // Create topics if they don't exist + if (kafkaConfig.AUTO_CREATE_TOPICS) { + await this.createTopics(); + } + } catch (error) { + this.logger.error({ + local: 'KafkaController.connect', + message: 'Failed to connect to Kafka', + error: error.message || error, + }); + this.scheduleReconnect(); + throw error; + } + } + + private async initGlobalConsumer(): Promise { + try { + const kafkaConfig = configService.get('KAFKA'); + + const consumerConfig: ConsumerConfig = { + groupId: kafkaConfig.CONSUMER_GROUP_ID || 'evolution-api-consumers', + sessionTimeout: 30000, + heartbeatInterval: 3000, + }; + + this.consumer = this.kafkaClient.consumer(consumerConfig); + await this.consumer.connect(); + + // Subscribe to global topics + const events = kafkaConfig.EVENTS; + if (events) { + const eventKeys = Object.keys(events).filter((event) => events[event]); + + for (const event of eventKeys) { + const topicName = this.getTopicName(event, true); + await this.consumer.subscribe({ topic: topicName }); + } + + // Start consuming messages + await this.consumer.run({ + eachMessage: async ({ topic, message }) => { + try { + const data = JSON.parse(message.value?.toString() || '{}'); + this.logger.debug(`Received message from topic ${topic}: ${JSON.stringify(data)}`); + + // Process the message here if needed + // This is where you can add custom message processing logic + } catch (error) { + this.logger.error(`Error processing message from topic ${topic}: ${error}`); + } + }, + }); + + this.logger.info('Global Kafka consumer initialized'); + } + } catch (error) { + this.logger.error(`Failed to initialize global Kafka consumer: ${error}`); + } + } + + private async createTopics(): Promise { + try { + const kafkaConfig = configService.get('KAFKA'); + const admin = this.kafkaClient.admin(); + await admin.connect(); + + const topics = []; + + // Create global topics if enabled + if (kafkaConfig.GLOBAL_ENABLED && kafkaConfig.EVENTS) { + const eventKeys = Object.keys(kafkaConfig.EVENTS).filter((event) => kafkaConfig.EVENTS[event]); + + for (const event of eventKeys) { + const topicName = this.getTopicName(event, true); + topics.push({ + topic: topicName, + numPartitions: kafkaConfig.NUM_PARTITIONS || 1, + replicationFactor: kafkaConfig.REPLICATION_FACTOR || 1, + }); + } + } + + if (topics.length > 0) { + await admin.createTopics({ + topics, + waitForLeaders: true, + }); + + this.logger.info(`Created ${topics.length} Kafka topics`); + } + + await admin.disconnect(); + } catch (error) { + this.logger.error(`Failed to create Kafka topics: ${error}`); + } + } + + private getTopicName(event: string, isGlobal: boolean = false, instanceName?: string): string { + const kafkaConfig = configService.get('KAFKA'); + const prefix = kafkaConfig.TOPIC_PREFIX || 'evolution'; + + if (isGlobal) { + return `${prefix}.global.${event.toLowerCase().replace(/_/g, '.')}`; + } else { + return `${prefix}.${instanceName}.${event.toLowerCase().replace(/_/g, '.')}`; + } + } + + private handleConnectionLoss(): void { + if (this.isReconnecting) { + return; + } + + this.cleanup(); + this.scheduleReconnect(); + } + + private scheduleReconnect(): void { + if (this.reconnectAttempts >= this.maxReconnectAttempts) { + this.logger.error( + `Maximum reconnect attempts (${this.maxReconnectAttempts}) reached. Stopping reconnection attempts.`, + ); + return; + } + + if (this.isReconnecting) { + return; + } + + this.isReconnecting = true; + this.reconnectAttempts++; + + const delay = this.reconnectDelay * Math.pow(2, Math.min(this.reconnectAttempts - 1, 5)); + + this.logger.info( + `Scheduling Kafka reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms`, + ); + + setTimeout(async () => { + try { + this.logger.info( + `Attempting to reconnect to Kafka (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`, + ); + await this.connect(); + this.logger.info('Successfully reconnected to Kafka'); + } catch (error) { + this.logger.error({ + local: 'KafkaController.scheduleReconnect', + message: `Reconnection attempt ${this.reconnectAttempts} failed`, + error: error.message || error, + }); + this.isReconnecting = false; + this.scheduleReconnect(); + } + }, delay); + } + + private async ensureConnection(): Promise { + if (!this.producer) { + this.logger.warn('Kafka producer is not available, attempting to reconnect...'); + if (!this.isReconnecting) { + this.scheduleReconnect(); + } + return false; + } + return true; + } + + public async emit({ + instanceName, + origin, + event, + data, + serverUrl, + dateTime, + sender, + apiKey, + integration, + }: EmitData): Promise { + if (integration && !integration.includes('kafka')) { + return; + } + + if (!this.status) { + return; + } + + if (!(await this.ensureConnection())) { + this.logger.warn(`Failed to emit event ${event} for instance ${instanceName}: No Kafka connection`); + return; + } + + const instanceKafka = await this.get(instanceName); + const kafkaLocal = instanceKafka?.events; + const kafkaGlobal = configService.get('KAFKA').GLOBAL_ENABLED; + const kafkaEvents = configService.get('KAFKA').EVENTS; + const we = event.replace(/[.-]/gm, '_').toUpperCase(); + const logEnabled = configService.get('LOG').LEVEL.includes('WEBHOOKS'); + + const message = { + event, + instance: instanceName, + data, + server_url: serverUrl, + date_time: dateTime, + sender, + apikey: apiKey, + timestamp: Date.now(), + }; + + const messageValue = JSON.stringify(message); + + // Instance-specific events + if (instanceKafka?.enabled && this.producer && Array.isArray(kafkaLocal) && kafkaLocal.includes(we)) { + const topicName = this.getTopicName(event, false, instanceName); + + let retry = 0; + while (retry < 3) { + try { + await this.producer.send({ + topic: topicName, + messages: [ + { + key: instanceName, + value: messageValue, + headers: { + event, + instance: instanceName, + origin, + timestamp: dateTime, + }, + }, + ], + }); + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-Kafka`, + ...message, + }; + this.logger.log(logData); + } + + break; + } catch (error) { + this.logger.error({ + local: 'KafkaController.emit', + message: `Error publishing local Kafka message (attempt ${retry + 1}/3)`, + error: error.message || error, + }); + retry++; + if (retry >= 3) { + this.handleConnectionLoss(); + } + } + } + } + + // Global events + if (kafkaGlobal && kafkaEvents[we] && this.producer) { + const topicName = this.getTopicName(event, true); + + let retry = 0; + while (retry < 3) { + try { + await this.producer.send({ + topic: topicName, + messages: [ + { + key: `${instanceName}-${event}`, + value: messageValue, + headers: { + event, + instance: instanceName, + origin, + timestamp: dateTime, + }, + }, + ], + }); + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-Kafka-Global`, + ...message, + }; + this.logger.log(logData); + } + + break; + } catch (error) { + this.logger.error({ + local: 'KafkaController.emit', + message: `Error publishing global Kafka message (attempt ${retry + 1}/3)`, + error: error.message || error, + }); + retry++; + if (retry >= 3) { + this.handleConnectionLoss(); + } + } + } + } + } + + public async cleanup(): Promise { + try { + if (this.consumer) { + await this.consumer.disconnect(); + this.consumer = null; + } + if (this.producer) { + await this.producer.disconnect(); + this.producer = null; + } + this.kafkaClient = null; + } catch (error) { + this.logger.warn({ + local: 'KafkaController.cleanup', + message: 'Error during cleanup', + error: error.message || error, + }); + this.producer = null; + this.consumer = null; + this.kafkaClient = null; + } + } +} diff --git a/src/api/integrations/event/kafka/kafka.router.ts b/src/api/integrations/event/kafka/kafka.router.ts new file mode 100644 index 00000000..eb846508 --- /dev/null +++ b/src/api/integrations/event/kafka/kafka.router.ts @@ -0,0 +1,36 @@ +import { RouterBroker } from '@api/abstract/abstract.router'; +import { InstanceDto } from '@api/dto/instance.dto'; +import { EventDto } from '@api/integrations/event/event.dto'; +import { HttpStatus } from '@api/routes/index.router'; +import { eventManager } from '@api/server.module'; +import { eventSchema, instanceSchema } from '@validate/validate.schema'; +import { RequestHandler, Router } from 'express'; + +export class KafkaRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: eventSchema, + ClassRef: EventDto, + execute: (instance, data) => eventManager.kafka.set(instance.instanceName, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: instanceSchema, + ClassRef: InstanceDto, + execute: (instance) => eventManager.kafka.get(instance.instanceName), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router: Router = Router(); +} diff --git a/src/api/integrations/event/kafka/kafka.schema.ts b/src/api/integrations/event/kafka/kafka.schema.ts new file mode 100644 index 00000000..3decb27e --- /dev/null +++ b/src/api/integrations/event/kafka/kafka.schema.ts @@ -0,0 +1,21 @@ +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +import { EventController } from '../event.controller'; + +export const kafkaSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean', enum: [true, false] }, + events: { + type: 'array', + minItems: 0, + items: { + type: 'string', + enum: EventController.events, + }, + }, + }, + required: ['enabled'], +}; diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 66e0b000..7c4e382e 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -153,6 +153,34 @@ export type Sqs = { }; }; +export type Kafka = { + ENABLED: boolean; + CLIENT_ID: string; + BROKERS: string[]; + CONNECTION_TIMEOUT: number; + REQUEST_TIMEOUT: number; + GLOBAL_ENABLED: boolean; + CONSUMER_GROUP_ID: string; + TOPIC_PREFIX: string; + NUM_PARTITIONS: number; + REPLICATION_FACTOR: number; + AUTO_CREATE_TOPICS: boolean; + EVENTS: EventsRabbitmq; + SASL?: { + ENABLED: boolean; + MECHANISM: string; + USERNAME: string; + PASSWORD: string; + }; + SSL?: { + ENABLED: boolean; + REJECT_UNAUTHORIZED: boolean; + CA?: string; + KEY?: string; + CERT?: string; + }; +}; + export type Websocket = { ENABLED: boolean; GLOBAL_EVENTS: boolean; @@ -372,6 +400,7 @@ export interface Env { RABBITMQ: Rabbitmq; NATS: Nats; SQS: Sqs; + KAFKA: Kafka; WEBSOCKET: Websocket; WA_BUSINESS: WaBusiness; LOG: Log; @@ -587,6 +616,68 @@ export class ConfigService { TYPEBOT_START: process.env?.SQS_GLOBAL_TYPEBOT_START === 'true', }, }, + KAFKA: { + ENABLED: process.env?.KAFKA_ENABLED === 'true', + CLIENT_ID: process.env?.KAFKA_CLIENT_ID || 'evolution-api', + BROKERS: process.env?.KAFKA_BROKERS?.split(',') || ['localhost:9092'], + CONNECTION_TIMEOUT: Number.parseInt(process.env?.KAFKA_CONNECTION_TIMEOUT || '3000'), + REQUEST_TIMEOUT: Number.parseInt(process.env?.KAFKA_REQUEST_TIMEOUT || '30000'), + GLOBAL_ENABLED: process.env?.KAFKA_GLOBAL_ENABLED === 'true', + CONSUMER_GROUP_ID: process.env?.KAFKA_CONSUMER_GROUP_ID || 'evolution-api-consumers', + TOPIC_PREFIX: process.env?.KAFKA_TOPIC_PREFIX || 'evolution', + NUM_PARTITIONS: Number.parseInt(process.env?.KAFKA_NUM_PARTITIONS || '1'), + REPLICATION_FACTOR: Number.parseInt(process.env?.KAFKA_REPLICATION_FACTOR || '1'), + AUTO_CREATE_TOPICS: process.env?.KAFKA_AUTO_CREATE_TOPICS === 'true', + EVENTS: { + APPLICATION_STARTUP: process.env?.KAFKA_EVENTS_APPLICATION_STARTUP === 'true', + INSTANCE_CREATE: process.env?.KAFKA_EVENTS_INSTANCE_CREATE === 'true', + INSTANCE_DELETE: process.env?.KAFKA_EVENTS_INSTANCE_DELETE === 'true', + QRCODE_UPDATED: process.env?.KAFKA_EVENTS_QRCODE_UPDATED === 'true', + MESSAGES_SET: process.env?.KAFKA_EVENTS_MESSAGES_SET === 'true', + MESSAGES_UPSERT: process.env?.KAFKA_EVENTS_MESSAGES_UPSERT === 'true', + MESSAGES_EDITED: process.env?.KAFKA_EVENTS_MESSAGES_EDITED === 'true', + MESSAGES_UPDATE: process.env?.KAFKA_EVENTS_MESSAGES_UPDATE === 'true', + MESSAGES_DELETE: process.env?.KAFKA_EVENTS_MESSAGES_DELETE === 'true', + SEND_MESSAGE: process.env?.KAFKA_EVENTS_SEND_MESSAGE === 'true', + SEND_MESSAGE_UPDATE: process.env?.KAFKA_EVENTS_SEND_MESSAGE_UPDATE === 'true', + CONTACTS_SET: process.env?.KAFKA_EVENTS_CONTACTS_SET === 'true', + CONTACTS_UPSERT: process.env?.KAFKA_EVENTS_CONTACTS_UPSERT === 'true', + CONTACTS_UPDATE: process.env?.KAFKA_EVENTS_CONTACTS_UPDATE === 'true', + PRESENCE_UPDATE: process.env?.KAFKA_EVENTS_PRESENCE_UPDATE === 'true', + CHATS_SET: process.env?.KAFKA_EVENTS_CHATS_SET === 'true', + CHATS_UPSERT: process.env?.KAFKA_EVENTS_CHATS_UPSERT === 'true', + CHATS_UPDATE: process.env?.KAFKA_EVENTS_CHATS_UPDATE === 'true', + CHATS_DELETE: process.env?.KAFKA_EVENTS_CHATS_DELETE === 'true', + CONNECTION_UPDATE: process.env?.KAFKA_EVENTS_CONNECTION_UPDATE === 'true', + LABELS_EDIT: process.env?.KAFKA_EVENTS_LABELS_EDIT === 'true', + LABELS_ASSOCIATION: process.env?.KAFKA_EVENTS_LABELS_ASSOCIATION === 'true', + GROUPS_UPSERT: process.env?.KAFKA_EVENTS_GROUPS_UPSERT === 'true', + GROUP_UPDATE: process.env?.KAFKA_EVENTS_GROUPS_UPDATE === 'true', + GROUP_PARTICIPANTS_UPDATE: process.env?.KAFKA_EVENTS_GROUP_PARTICIPANTS_UPDATE === 'true', + CALL: process.env?.KAFKA_EVENTS_CALL === 'true', + TYPEBOT_START: process.env?.KAFKA_EVENTS_TYPEBOT_START === 'true', + TYPEBOT_CHANGE_STATUS: process.env?.KAFKA_EVENTS_TYPEBOT_CHANGE_STATUS === 'true', + }, + SASL: + process.env?.KAFKA_SASL_ENABLED === 'true' + ? { + ENABLED: true, + MECHANISM: process.env?.KAFKA_SASL_MECHANISM || 'plain', + USERNAME: process.env?.KAFKA_SASL_USERNAME || '', + PASSWORD: process.env?.KAFKA_SASL_PASSWORD || '', + } + : undefined, + SSL: + process.env?.KAFKA_SSL_ENABLED === 'true' + ? { + ENABLED: true, + REJECT_UNAUTHORIZED: process.env?.KAFKA_SSL_REJECT_UNAUTHORIZED !== 'false', + CA: process.env?.KAFKA_SSL_CA, + KEY: process.env?.KAFKA_SSL_KEY, + CERT: process.env?.KAFKA_SSL_CERT, + } + : undefined, + }, WEBSOCKET: { ENABLED: process.env?.WEBSOCKET_ENABLED === 'true', GLOBAL_EVENTS: process.env?.WEBSOCKET_GLOBAL_EVENTS === 'true', From 41a36bbb195a6999f640c17c2db7670672893415 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 15:48:27 -0300 Subject: [PATCH 097/129] feat(changelog): update CHANGELOG for version 2.3.4 - Added Apache Kafka integration for real-time event streaming, including a new controller, router, and schema. - Fixed MySQL schema issues related to default values and added missing relation fields in the Instance model. - Introduced new environment variables for comprehensive Kafka configuration. --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- CHANGELOG.md | 28 +++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9873a587..92531b7e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -59,7 +59,7 @@ body: value: | - OS: [e.g. Ubuntu 20.04, Windows 10, macOS 12.0] - Node.js version: [e.g. 18.17.0] - - Evolution API version: [e.g. 2.3.3] + - Evolution API version: [e.g. 2.3.4] - Database: [e.g. PostgreSQL 14, MySQL 8.0] - Connection type: [e.g. Baileys, WhatsApp Business API] validations: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e78a762..8a4c6c33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ +# 2.3.4 (develop) + +### Features + +* **Kafka Integration**: Added Apache Kafka event integration for real-time event streaming + - New Kafka controller, router, and schema for event publishing + - Support for instance-specific and global event topics + - Configurable SASL/SSL authentication and connection settings + - Auto-creation of topics with configurable partitions and replication + - Consumer group management for reliable event processing + - Integration with existing event manager for seamless event distribution + +### Fixed + +* **MySQL Schema**: Fixed invalid default value errors for `createdAt` fields in `Evoai` and `EvoaiSetting` models + - Changed `@default(now())` to `@default(dbgenerated("CURRENT_TIMESTAMP"))` for MySQL compatibility + - Added missing relation fields (`N8n`, `N8nSetting`, `Evoai`, `EvoaiSetting`) in Instance model + - Resolved Prisma schema validation errors for MySQL provider + +### Environment Variables + +* Added comprehensive Kafka configuration options: + - `KAFKA_ENABLED`, `KAFKA_CLIENT_ID`, `KAFKA_BROKERS` + - `KAFKA_CONSUMER_GROUP_ID`, `KAFKA_TOPIC_PREFIX` + - `KAFKA_SASL_*` and `KAFKA_SSL_*` for authentication + - `KAFKA_EVENTS_*` for event type configuration + + # 2.3.3 (2025-09-18) ### Features diff --git a/package-lock.json b/package-lock.json index f1f483e3..5b558ca0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "evolution-api", - "version": "2.3.3", + "version": "2.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "evolution-api", - "version": "2.3.3", + "version": "2.3.4", "license": "Apache-2.0", "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", diff --git a/package.json b/package.json index 6168e11c..748439d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "2.3.3", + "version": "2.3.4", "description": "Rest api for communication with WhatsApp", "main": "./dist/main.js", "type": "commonjs", From 5f44da61fbb73dbdb41d746e91e6edde53f91c94 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 17:00:15 -0300 Subject: [PATCH 098/129] feat(evolution-manager): add evolution-manager-v2 as a submodule and update changelog - Introduced evolution-manager-v2 as a git submodule for easier access and integration. - Updated CHANGELOG to reflect the addition of evolution-manager-v2 with details on its features and open-source setup. - Adjusted media message handling in EvolutionStartupService to use null instead of undefined for base64 and mediaUrl properties, ensuring better data consistency. --- .gitmodules | 3 + CHANGELOG.md | 10 + LICENSE | 2 +- evolution-manager-v2 | 1 + manager/dist/assets/index-CXH2BdD4.css | 1 - manager/dist/assets/index-D-oOjDYe.js | 381 --------------- manager/dist/assets/index-DJ2Q5K8k.js | 461 ++++++++++++++++++ manager/dist/assets/index-DxAxQfZR.css | 1 + manager/dist/index.html | 4 +- .../evolution/evolution.channel.service.ts | 25 +- 10 files changed, 495 insertions(+), 394 deletions(-) create mode 100644 .gitmodules create mode 160000 evolution-manager-v2 delete mode 100644 manager/dist/assets/index-CXH2BdD4.css delete mode 100644 manager/dist/assets/index-D-oOjDYe.js create mode 100644 manager/dist/assets/index-DJ2Q5K8k.js create mode 100644 manager/dist/assets/index-DxAxQfZR.css diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..ef5b3e63 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "evolution-manager-v2"] + path = evolution-manager-v2 + url = https://github.com/EvolutionAPI/evolution-manager-v2.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a4c6c33..6d093fb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ - Consumer group management for reliable event processing - Integration with existing event manager for seamless event distribution +* **Evolution Manager v2 Open Source**: Evolution Manager v2 is now available as open source + - Added as git submodule with HTTPS URL for easy access + - Complete open source setup with Apache 2.0 license + Evolution API custom conditions + - GitHub templates for issues, pull requests, and workflows + - Comprehensive documentation and contribution guidelines + - Docker support for development and production environments + - CI/CD workflows for code quality, security audits, and automated builds + - Multi-language support (English, Portuguese, Spanish, French) + - Modern React + TypeScript + Vite frontend with Tailwind CSS + ### Fixed * **MySQL Schema**: Fixed invalid default value errors for `createdAt` fields in `Evoai` and `EvoaiSetting` models diff --git a/LICENSE b/LICENSE index ad430f14..18ebe6f6 100644 --- a/LICENSE +++ b/LICENSE @@ -17,5 +17,5 @@ b. Your contributed code may be used for commercial purposes, including but not Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0. -© 2024 Evolution API +© 2025 Evolution API diff --git a/evolution-manager-v2 b/evolution-manager-v2 new file mode 160000 index 00000000..fcb38dd4 --- /dev/null +++ b/evolution-manager-v2 @@ -0,0 +1 @@ +Subproject commit fcb38dd407b89697b7a7154cfd873f76729e6ece diff --git a/manager/dist/assets/index-CXH2BdD4.css b/manager/dist/assets/index-CXH2BdD4.css deleted file mode 100644 index 105f4ef3..00000000 --- a/manager/dist/assets/index-CXH2BdD4.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--gradient: #093028;--background: 178 98.4% 98.22%;--foreground: 178 6.800000000000001% .44%;--muted: 178 6.800000000000001% 91.1%;--muted-foreground: 178 3.4000000000000004% 41.1%;--popover: 178 35.599999999999994% 91.1%;--popover-foreground: 178 6.800000000000001% .55%;--card: 178 35.599999999999994% 91.1%;--card-foreground: 178 6.800000000000001% .55%;--border: 178 11.8% 89.44%;--input: 178 11.8% 89.44%;--primary: 178 68% 11%;--primary-foreground: 178 1.36% 91.1%;--secondary: 178 3.4000000000000004% 95.55%;--secondary-foreground: 178 5.08% 11.1%;--accent: 178 3.4000000000000004% 95.55%;--accent-foreground: 178 5.08% 11.1%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--ring: 178 68% 11%;--radius: .5rem}.dark{--gradient: #189d68;--background: 166 47.449999999999996% 2.88%;--foreground: 166 7.3% 96.8%;--muted: 166 36.5% 10.799999999999999%;--muted-foreground: 166 7.3% 53.6%;--popover: 166 50.4% 4.68%;--popover-foreground: 166 7.3% 96.8%;--card: 166 50.4% 4.68%;--card-foreground: 166 7.3% 96.8%;--border: 166 36.5% 10.799999999999999%;--input: 166 36.5% 10.799999999999999%;--primary: 166 73% 36%;--primary-foreground: 166 7.3% 96.8%;--secondary: 166 36.5% 10.799999999999999%;--secondary-foreground: 166 7.3% 96.8%;--accent: 166 36.5% 10.799999999999999%;--accent-foreground: 166 7.3% 96.8%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 166 7.3% 96.8%;--ring: 166 73% 36%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:Inter,sans-serif;scrollbar-width:thin;scrollbar-color:transparent transparent}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.left-2{left:.5rem}.left-3{left:.75rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-10{z-index:10}.z-50{z-index:50}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-16{margin-right:4rem}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-auto{margin-top:auto}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1\.2rem\]{height:1.2rem}.h-\[1px\]{height:1px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-96{max-height:24rem}.max-h-\[240px\]{max-height:240px}.max-h-\[300px\]{max-height:300px}.min-h-\[48px\]{min-height:48px}.min-h-\[80px\]{min-height:80px}.min-h-\[calc\(100vh_-_56px\)\]{min-height:calc(100vh - 56px)}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[1\.2rem\]{width:1.2rem}.w-\[1px\]{width:1px}.w-\[350px\]{width:350px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.grid-cols-\[repeat\(auto-fit\,_minmax\(15rem\,_1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.rounded-3xl{border-radius:1.5rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-500\/20{border-color:#f59e0b33}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-emerald-500\/20{border-color:#10b98133}.border-gray-600\/50{border-color:#4b556380}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-red-500\/20{border-color:#ef444433}.border-sky-500\/20{border-color:#0ea5e933}.border-transparent{border-color:transparent}.border-zinc-500\/20{border-color:#71717a33}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-amber-50\/50{background-color:#fffbeb80}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-50\/50{background-color:#ecfdf580}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/30{background-color:hsl(var(--primary) / .3)}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-50\/50{background-color:#f0f9ff80}.bg-transparent{background-color:transparent}.bg-zinc-50\/50{background-color:#fafafa80}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pl-12{padding-left:3rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-900{--tw-text-opacity: 1;color:rgb(12 74 110 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.caret-transparent{caret-color:transparent}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-muted-foreground{--tw-ring-color: hsl(var(--muted-foreground))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:bg-border:after{content:var(--tw-content);background-color:hsl(var(--border))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-600\/80:hover{background-color:#d97706cc}.hover\:bg-amber-600\/90:hover{background-color:#d97706e6}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:stroke-destructive:hover{stroke:hsl(var(--destructive))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-muted[data-state=open],.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-slate-400[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-amber-500\/30:is(.dark *){border-color:#f59e0b4d}.dark\:border-emerald-500\/30:is(.dark *){border-color:#10b9814d}.dark\:border-red-500\/30:is(.dark *){border-color:#ef44444d}.dark\:border-sky-500\/30:is(.dark *){border-color:#0ea5e94d}.dark\:border-zinc-500\/30:is(.dark *){border-color:#71717a4d}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#10b9811a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-sky-500\/10:is(.dark *){background-color:#0ea5e91a}.dark\:bg-zinc-500\/10:is(.dark *){background-color:#71717a1a}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity))}.dark\:text-sky-200:is(.dark *){--tw-text-opacity: 1;color:rgb(186 230 253 / var(--tw-text-opacity))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:m-4{margin:1rem}.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-\[950px\]{max-width:950px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr_10rem\]{grid-template-columns:10rem 1fr 10rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:inline{display:inline}.md\:flex{display:flex}.md\:w-64{width:16rem}.md\:w-full{width:100%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-8{gap:2rem}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\*\]\:p-4>*{padding:1rem}.\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.\[\&\>\*\]\:py-2>*{padding-top:.5rem;padding-bottom:.5rem}.\[\&\>div\[style\]\]\:\!block>div[style]{display:block!important}.\[\&\>div\[style\]\]\:h-full>div[style]{height:100%}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:fill-rose-600>svg{fill:#e11d48}.\[\&\>svg\]\:text-amber-500>svg{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-emerald-600>svg{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-red-600>svg{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-sky-500>svg{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-zinc-400>svg{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.hover\:\[\&\>svg\]\:fill-rose-700>svg:hover{fill:#be123c}.dark\:\[\&\>svg\]\:text-emerald-400\/80>svg:is(.dark *){color:#34d399cc}.dark\:\[\&\>svg\]\:text-red-400\/80>svg:is(.dark *){color:#f87171cc}.dark\:\[\&\>svg\]\:text-zinc-300>svg:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_strong\]\:text-foreground strong{color:hsl(var(--foreground))}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: #e74c3c;--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient( to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55 );--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width : 480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}}.Toastify__toast{--y: 0;position:relative;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px #0000001a;display:flex;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;flex:1 1 auto;padding:6px;display:flex;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;flex:1}.Toastify__toast-icon{margin-inline-end:10px;width:20px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width : 480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tabs-chat{background-color:transparent;width:100%;border-radius:0}.chat-item{display:flex;padding:10px;cursor:pointer;background-color:hsl(var(--background))}.chat-item:hover,.chat-item.active{background-color:#2f2f2f}.bubble{border-radius:16px;padding:12px;word-wrap:break-word}.bubble-right .bubble{background-color:#0a0a0a;text-align:right;max-width:100%}.bubble-left .bubble{background-color:#1b1b1b;max-width:100%}.bubble-right{align-self:flex-end;display:flex;justify-content:flex-end;width:80%}.bubble-left{align-self:flex-start;display:flex;justify-content:flex-start;width:80%}.input-message textarea{background-color:#2f2f2f;padding-left:48px}.input-message textarea:focus{outline:none;border:none;box-shadow:none}.message-container{flex:1;overflow-y:auto;max-height:calc(100vh - 110px);padding-top:50px} diff --git a/manager/dist/assets/index-D-oOjDYe.js b/manager/dist/assets/index-D-oOjDYe.js deleted file mode 100644 index 25cc0b12..00000000 --- a/manager/dist/assets/index-D-oOjDYe.js +++ /dev/null @@ -1,381 +0,0 @@ -var Yw=e=>{throw TypeError(e)};var sD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lm=(e,t,n)=>t.has(e)||Yw("Cannot "+n);var N=(e,t,n)=>(lm(e,t,"read from private field"),n?n.call(e):t.get(e)),De=(e,t,n)=>t.has(e)?Yw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),we=(e,t,n,r)=>(lm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ye=(e,t,n)=>(lm(e,t,"access private method"),n);var uf=(e,t,n,r)=>({set _(s){we(e,t,s,n)},get _(){return N(e,t,r)}});var Ooe=sD((fo,po)=>{function DE(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AE={exports:{}},Ig={},FE={exports:{}},it={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zd=Symbol.for("react.element"),oD=Symbol.for("react.portal"),aD=Symbol.for("react.fragment"),iD=Symbol.for("react.strict_mode"),lD=Symbol.for("react.profiler"),cD=Symbol.for("react.provider"),uD=Symbol.for("react.context"),dD=Symbol.for("react.forward_ref"),fD=Symbol.for("react.suspense"),pD=Symbol.for("react.memo"),gD=Symbol.for("react.lazy"),Xw=Symbol.iterator;function hD(e){return e===null||typeof e!="object"?null:(e=Xw&&e[Xw]||e["@@iterator"],typeof e=="function"?e:null)}var LE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$E=Object.assign,BE={};function bc(e,t,n){this.props=e,this.context=t,this.refs=BE,this.updater=n||LE}bc.prototype.isReactComponent={};bc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};bc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zE(){}zE.prototype=bc.prototype;function Ob(e,t,n){this.props=e,this.context=t,this.refs=BE,this.updater=n||LE}var Ib=Ob.prototype=new zE;Ib.constructor=Ob;$E(Ib,bc.prototype);Ib.isPureReactComponent=!0;var eS=Array.isArray,UE=Object.prototype.hasOwnProperty,Db={current:null},VE={key:!0,ref:!0,__self:!0,__source:!0};function HE(e,t,n){var r,s={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)UE.call(t,r)&&!VE.hasOwnProperty(r)&&(s[r]=t[r]);var c=arguments.length-2;if(c===1)s.children=n;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rc=typeof window>"u"||"Deno"in globalThis;function Dr(){}function jD(e,t){return typeof e=="function"?e(t):e}function Nv(e){return typeof e=="number"&&e>=0&&e!==1/0}function WE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pl(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function nS(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:c}=e;if(a){if(r){if(t.queryHash!==Fb(a,t.options))return!1}else if(!zu(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||o&&!o(t))}function rS(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ki(t.options.mutationKey)!==ki(o))return!1}else if(!zu(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Fb(e,t){return((t==null?void 0:t.queryKeyHashFn)||ki)(e)}function ki(e){return JSON.stringify(e,(t,n)=>_v(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function zu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!zu(e[n],t[n])):!1}function GE(e,t){if(e===t)return e;const n=sS(e)&&sS(t);if(n||_v(e)&&_v(t)){const r=n?e:Object.keys(e),s=r.length,o=n?t:Object.keys(t),a=o.length,c=n?[]:{};let u=0;for(let i=0;i{setTimeout(t,e)})}function Pv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?GE(e,t):t}function MD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ND(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var JE=Symbol();function QE(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===JE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ui,Qo,Hl,kE,_D=(kE=class extends xc{constructor(){super();De(this,ui);De(this,Qo);De(this,Hl);we(this,Hl,t=>{if(!rc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,Qo)||this.setEventListener(N(this,Hl))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Qo))==null||t.call(this),we(this,Qo,void 0))}setEventListener(t){var n;we(this,Hl,t),(n=N(this,Qo))==null||n.call(this),we(this,Qo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,ui)!==t&&(we(this,ui,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,ui)=="boolean"?N(this,ui):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ui=new WeakMap,Qo=new WeakMap,Hl=new WeakMap,kE),Lb=new _D,Kl,Zo,ql,jE,PD=(jE=class extends xc{constructor(){super();De(this,Kl,!0);De(this,Zo);De(this,ql);we(this,ql,t=>{if(!rc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,Zo)||this.setEventListener(N(this,ql))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Zo))==null||t.call(this),we(this,Zo,void 0))}setEventListener(t){var n;we(this,ql,t),(n=N(this,Zo))==null||n.call(this),we(this,Zo,t(this.setOnline.bind(this)))}setOnline(t){N(this,Kl)!==t&&(we(this,Kl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,Kl)}},Kl=new WeakMap,Zo=new WeakMap,ql=new WeakMap,jE),Tp=new PD;function RD(e){return Math.min(1e3*2**e,3e4)}function ZE(e){return(e??"online")==="online"?Tp.isOnline():!0}var YE=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function um(e){return e instanceof YE}function XE(e){let t=!1,n=0,r=!1,s,o,a;const c=new Promise((b,y)=>{o=b,a=y}),u=b=>{var y;r||(h(new YE(b)),(y=e.abort)==null||y.call(e))},i=()=>{t=!0},d=()=>{t=!1},p=()=>Lb.isFocused()&&(e.networkMode==="always"||Tp.isOnline())&&e.canRun(),f=()=>ZE(e.networkMode)&&e.canRun(),g=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),s==null||s(),o(b))},h=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),s==null||s(),a(b))},m=()=>new Promise(b=>{var y;s=w=>{(r||p())&&b(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;s=void 0,r||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(g).catch(w=>{var j;if(r)return;const S=e.retry??(rc?0:3),E=e.retryDelay??RD,C=typeof E=="function"?E(n,w):E,T=S===!0||typeof S=="number"&&np()?void 0:m()).then(()=>{t?h(w):x()})})};return{promise:c,cancel:u,continue:()=>(s==null||s(),c),cancelRetry:i,continueRetry:d,canStart:f,start:()=>(f()?x():m().then(x),c)}}function OD(){let e=[],t=0,n=f=>{f()},r=f=>{f()},s=f=>setTimeout(f,0);const o=f=>{s=f},a=f=>{let g;t++;try{g=f()}finally{t--,t||i()}return g},c=f=>{t?e.push(f):s(()=>{n(f)})},u=f=>(...g)=>{c(()=>{f(...g)})},i=()=>{const f=e;e=[],f.length&&s(()=>{r(()=>{f.forEach(g=>{n(g)})})})};return{batch:a,batchCalls:u,schedule:c,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:o}}var dn=OD(),di,TE,ek=(TE=class{constructor(){De(this,di)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nv(this.gcTime)&&we(this,di,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:5*60*1e3))}clearGcTimeout(){N(this,di)&&(clearTimeout(N(this,di)),we(this,di,void 0))}},di=new WeakMap,TE),Wl,Gl,Ir,Dn,Fd,fi,Qr,eo,ME,ID=(ME=class extends ek{constructor(t){super();De(this,Qr);De(this,Wl);De(this,Gl);De(this,Ir);De(this,Dn);De(this,Fd);De(this,fi);we(this,fi,!1),we(this,Fd,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,Ir,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,Wl,DD(this.options)),this.state=t.state??N(this,Wl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Dn))==null?void 0:t.promise}setOptions(t){this.options={...N(this,Fd),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Ir).remove(this)}setData(t,n){const r=Pv(this.state.data,t,this.options);return Ye(this,Qr,eo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ye(this,Qr,eo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Dn))==null?void 0:r.promise;return(s=N(this,Dn))==null||s.cancel(t),n?n.then(Dr).catch(Dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,Wl))}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!WE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Ir).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Dn)&&(N(this,fi)?N(this,Dn).cancel({revert:!0}):N(this,Dn).cancelRetry()),this.scheduleGc()),N(this,Ir).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ye(this,Qr,eo).call(this,{type:"invalidate"})}fetch(t,n){var u,i,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Dn))return N(this,Dn).continueRetry(),N(this,Dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(f=>f.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(we(this,fi,!0),r.signal)})},o=()=>{const p=QE(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return s(f),we(this,fi,!1),this.options.persister?this.options.persister(p,f,this):p(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(u=this.options.behavior)==null||u.onFetch(a,this),we(this,Gl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=a.fetchOptions)==null?void 0:i.meta))&&Ye(this,Qr,eo).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const c=p=>{var f,g,h,m;um(p)&&p.silent||Ye(this,Qr,eo).call(this,{type:"error",error:p}),um(p)||((g=(f=N(this,Ir).config).onError)==null||g.call(f,p,this),(m=(h=N(this,Ir).config).onSettled)==null||m.call(h,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return we(this,Dn,XE({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var f,g,h,m;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(g=(f=N(this,Ir).config).onSuccess)==null||g.call(f,p,this),(m=(h=N(this,Ir).config).onSettled)==null||m.call(h,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(p,f)=>{Ye(this,Qr,eo).call(this,{type:"failed",failureCount:p,error:f})},onPause:()=>{Ye(this,Qr,eo).call(this,{type:"pause"})},onContinue:()=>{Ye(this,Qr,eo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),N(this,Dn).start()}},Wl=new WeakMap,Gl=new WeakMap,Ir=new WeakMap,Dn=new WeakMap,Fd=new WeakMap,fi=new WeakMap,Qr=new WeakSet,eo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...tk(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return um(s)&&s.revert&&N(this,Gl)?{...N(this,Gl),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),dn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,Ir).notify({query:this,type:"updated",action:t})})},ME);function tk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function DD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var js,NE,AD=(NE=class extends xc{constructor(t={}){super();De(this,js);this.config=t,we(this,js,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Fb(s,n);let a=this.get(o);return a||(a=new ID({cache:this,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){N(this,js).has(t.queryHash)||(N(this,js).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,js).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,js).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,js).get(t)}getAll(){return[...N(this,js).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>nS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>nS(t,r)):n}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},js=new WeakMap,NE),Ts,Un,pi,Ms,zo,_E,FD=(_E=class extends ek{constructor(t){super();De(this,Ms);De(this,Ts);De(this,Un);De(this,pi);this.mutationId=t.mutationId,we(this,Un,t.mutationCache),we(this,Ts,[]),this.state=t.state||nk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,Ts).includes(t)||(N(this,Ts).push(t),this.clearGcTimeout(),N(this,Un).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Ts,N(this,Ts).filter(n=>n!==t)),this.scheduleGc(),N(this,Un).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,Ts).length||(this.state.status==="pending"?this.scheduleGc():N(this,Un).remove(this))}continue(){var t;return((t=N(this,pi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,a,c,u,i,d,p,f,g,h,m,x,b,y,w,S,E,C,T;we(this,pi,XE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,_)=>{Ye(this,Ms,zo).call(this,{type:"failed",failureCount:j,error:_})},onPause:()=>{Ye(this,Ms,zo).call(this,{type:"pause"})},onContinue:()=>{Ye(this,Ms,zo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Un).canRun(this)}));const n=this.state.status==="pending",r=!N(this,pi).canStart();try{if(!n){Ye(this,Ms,zo).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(s=N(this,Un).config).onMutate)==null?void 0:o.call(s,t,this));const _=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t));_!==this.state.context&&Ye(this,Ms,zo).call(this,{type:"pending",context:_,variables:t,isPaused:r})}const j=await N(this,pi).start();return await((i=(u=N(this,Un).config).onSuccess)==null?void 0:i.call(u,j,t,this.state.context,this)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,j,t,this.state.context)),await((g=(f=N(this,Un).config).onSettled)==null?void 0:g.call(f,j,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,j,null,t,this.state.context)),Ye(this,Ms,zo).call(this,{type:"success",data:j}),j}catch(j){try{throw await((b=(x=N(this,Un).config).onError)==null?void 0:b.call(x,j,t,this.state.context,this)),await((w=(y=this.options).onError)==null?void 0:w.call(y,j,t,this.state.context)),await((E=(S=N(this,Un).config).onSettled)==null?void 0:E.call(S,void 0,j,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,j,t,this.state.context)),j}finally{Ye(this,Ms,zo).call(this,{type:"error",error:j})}}finally{N(this,Un).runNext(this)}}},Ts=new WeakMap,Un=new WeakMap,pi=new WeakMap,Ms=new WeakSet,zo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dn.batch(()=>{N(this,Ts).forEach(r=>{r.onMutationUpdate(t)}),N(this,Un).notify({mutation:this,type:"updated",action:t})})},_E);function nk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fr,Ld,PE,LD=(PE=class extends xc{constructor(t={}){super();De(this,fr);De(this,Ld);this.config=t,we(this,fr,new Map),we(this,Ld,Date.now())}build(t,n,r){const s=new FD({mutationCache:this,mutationId:++uf(this,Ld)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=ff(t),r=N(this,fr).get(n)??[];r.push(t),N(this,fr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=ff(t);if(N(this,fr).has(n)){const s=(r=N(this,fr).get(n))==null?void 0:r.filter(o=>o!==t);s&&(s.length===0?N(this,fr).delete(n):N(this,fr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=N(this,fr).get(ff(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=N(this,fr).get(ff(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...N(this,fr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>rS(n,r))}findAll(t={}){return this.getAll().filter(n=>rS(t,n))}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dr))))}},fr=new WeakMap,Ld=new WeakMap,PE);function ff(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function $D(e){return{onFetch:(t,n)=>{const r=async()=>{var h,m,x,b,y;const s=t.options,o=(x=(m=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:x.direction,a=((b=t.state.data)==null?void 0:b.pages)||[],c=((y=t.state.data)==null?void 0:y.pageParams)||[],u={pages:[],pageParams:[]};let i=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?i=!0:t.signal.addEventListener("abort",()=>{i=!0}),t.signal)})},p=QE(t.options,t.fetchOptions),f=async(w,S,E)=>{if(i)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};d(C);const T=await p(C),{maxPages:j}=t.options,_=E?ND:MD;return{pages:_(w.pages,T,j),pageParams:_(w.pageParams,S,j)}};let g;if(o&&a.length){const w=o==="backward",S=w?BD:aS,E={pages:a,pageParams:c},C=S(s,E);g=await f(E,C,w)}else{g=await f(u,c[0]??s.initialPageParam);const w=e??a.length;for(let S=1;S{var s,o;return(o=(s=t.options).persister)==null?void 0:o.call(s,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function aS(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function BD(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Qt,Yo,Xo,Jl,Ql,ea,Zl,Yl,RE,zD=(RE=class{constructor(e={}){De(this,Qt);De(this,Yo);De(this,Xo);De(this,Jl);De(this,Ql);De(this,ea);De(this,Zl);De(this,Yl);we(this,Qt,e.queryCache||new AD),we(this,Yo,e.mutationCache||new LD),we(this,Xo,e.defaultOptions||{}),we(this,Jl,new Map),we(this,Ql,new Map),we(this,ea,0)}mount(){uf(this,ea)._++,N(this,ea)===1&&(we(this,Zl,Lb.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,Qt).onFocus())})),we(this,Yl,Tp.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,Qt).onOnline())})))}unmount(){var e,t;uf(this,ea)._--,N(this,ea)===0&&((e=N(this,Zl))==null||e.call(this),we(this,Zl,void 0),(t=N(this,Yl))==null||t.call(this),we(this,Yl,void 0))}isFetching(e){return N(this,Qt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Yo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,Qt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=N(this,Qt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Pl(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return N(this,Qt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=N(this,Qt).get(r.queryHash),o=s==null?void 0:s.state.data,a=jD(t,o);if(a!==void 0)return N(this,Qt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return dn.batch(()=>N(this,Qt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,Qt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,Qt);dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,Qt),r={type:"active",...e};return dn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=dn.batch(()=>N(this,Qt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Dr).catch(Dr)}invalidateQueries(e={},t={}){return dn.batch(()=>{if(N(this,Qt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=dn.batch(()=>N(this,Qt).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Dr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Dr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,Qt).build(this,t);return n.isStaleByTime(Pl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dr).catch(Dr)}fetchInfiniteQuery(e){return e.behavior=$D(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dr).catch(Dr)}resumePausedMutations(){return Tp.isOnline()?N(this,Yo).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,Qt)}getMutationCache(){return N(this,Yo)}getDefaultOptions(){return N(this,Xo)}setDefaultOptions(e){we(this,Xo,e)}setQueryDefaults(e,t){N(this,Jl).set(ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Jl).values()];let n={};return t.forEach(r=>{zu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){N(this,Ql).set(ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Ql).values()];let n={};return t.forEach(r=>{zu(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Xo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===JE&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Xo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,Qt).clear(),N(this,Yo).clear()}},Qt=new WeakMap,Yo=new WeakMap,Xo=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,ea=new WeakMap,Zl=new WeakMap,Yl=new WeakMap,RE),er,lt,$d,Vn,gi,Xl,Ns,Bd,ec,tc,hi,mi,ta,nc,wt,du,Rv,Ov,Iv,Dv,Av,Fv,Lv,rk,OE,UD=(OE=class extends xc{constructor(t,n){super();De(this,wt);De(this,er);De(this,lt);De(this,$d);De(this,Vn);De(this,gi);De(this,Xl);De(this,Ns);De(this,Bd);De(this,ec);De(this,tc);De(this,hi);De(this,mi);De(this,ta);De(this,nc,new Set);this.options=n,we(this,er,t),we(this,Ns,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,lt).addObserver(this),iS(N(this,lt),this.options)?Ye(this,wt,du).call(this):this.updateResult(),Ye(this,wt,Dv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $v(N(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $v(N(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ye(this,wt,Av).call(this),Ye(this,wt,Fv).call(this),N(this,lt).removeObserver(this)}setOptions(t,n){const r=this.options,s=N(this,lt);if(this.options=N(this,er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,N(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ye(this,wt,Lv).call(this),N(this,lt).setOptions(this.options),r._defaulted&&!jp(this.options,r)&&N(this,er).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,lt),observer:this});const o=this.hasListeners();o&&lS(N(this,lt),s,this.options,r)&&Ye(this,wt,du).call(this),this.updateResult(n),o&&(N(this,lt)!==s||Xr(this.options.enabled,N(this,lt))!==Xr(r.enabled,N(this,lt))||Pl(this.options.staleTime,N(this,lt))!==Pl(r.staleTime,N(this,lt)))&&Ye(this,wt,Rv).call(this);const a=Ye(this,wt,Ov).call(this);o&&(N(this,lt)!==s||Xr(this.options.enabled,N(this,lt))!==Xr(r.enabled,N(this,lt))||a!==N(this,ta))&&Ye(this,wt,Iv).call(this,a)}getOptimisticResult(t){const n=N(this,er).getQueryCache().build(N(this,er),t),r=this.createResult(n,t);return HD(this,r)&&(we(this,Vn,r),we(this,Xl,this.options),we(this,gi,N(this,lt).state)),r}getCurrentResult(){return N(this,Vn)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){N(this,nc).add(t)}getCurrentQuery(){return N(this,lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,er).defaultQueryOptions(t),r=N(this,er).getQueryCache().build(N(this,er),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ye(this,wt,du).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Vn)))}createResult(t,n){var T;const r=N(this,lt),s=this.options,o=N(this,Vn),a=N(this,gi),c=N(this,Xl),i=t!==r?t.state:N(this,$d),{state:d}=t;let p={...d},f=!1,g;if(n._optimisticResults){const j=this.hasListeners(),_=!j&&iS(t,n),O=j&&lS(t,r,n,s);(_||O)&&(p={...p,...tk(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:x}=p;if(n.select&&p.data!==void 0)if(o&&p.data===(a==null?void 0:a.data)&&n.select===N(this,Bd))g=N(this,ec);else try{we(this,Bd,n.select),g=n.select(p.data),g=Pv(o==null?void 0:o.data,g,n),we(this,ec,g),we(this,Ns,null)}catch(j){we(this,Ns,j)}else g=p.data;if(n.placeholderData!==void 0&&g===void 0&&x==="pending"){let j;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData))j=o.data;else if(j=typeof n.placeholderData=="function"?n.placeholderData((T=N(this,tc))==null?void 0:T.state.data,N(this,tc)):n.placeholderData,n.select&&j!==void 0)try{j=n.select(j),we(this,Ns,null)}catch(_){we(this,Ns,_)}j!==void 0&&(x="success",g=Pv(o==null?void 0:o.data,j,n),f=!0)}N(this,Ns)&&(h=N(this,Ns),g=N(this,ec),m=Date.now(),x="error");const b=p.fetchStatus==="fetching",y=x==="pending",w=x==="error",S=y&&b,E=g!==void 0;return{status:x,fetchStatus:p.fetchStatus,isPending:y,isSuccess:x==="success",isError:w,isInitialLoading:S,isLoading:S,data:g,dataUpdatedAt:p.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>i.dataUpdateCount||p.errorUpdateCount>i.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:w&&!E,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&E,isStale:$b(t,n),refetch:this.refetch}}updateResult(t){const n=N(this,Vn),r=this.createResult(N(this,lt),this.options);if(we(this,gi,N(this,lt).state),we(this,Xl,this.options),N(this,gi).data!==void 0&&we(this,tc,N(this,lt)),jp(r,n))return;we(this,Vn,r);const s={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,c=typeof a=="function"?a():a;if(c==="all"||!c&&!N(this,nc).size)return!0;const u=new Set(c??N(this,nc));return this.options.throwOnError&&u.add("error"),Object.keys(N(this,Vn)).some(i=>{const d=i;return N(this,Vn)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(s.listeners=!0),Ye(this,wt,rk).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ye(this,wt,Dv).call(this)}},er=new WeakMap,lt=new WeakMap,$d=new WeakMap,Vn=new WeakMap,gi=new WeakMap,Xl=new WeakMap,Ns=new WeakMap,Bd=new WeakMap,ec=new WeakMap,tc=new WeakMap,hi=new WeakMap,mi=new WeakMap,ta=new WeakMap,nc=new WeakMap,wt=new WeakSet,du=function(t){Ye(this,wt,Lv).call(this);let n=N(this,lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Dr)),n},Rv=function(){Ye(this,wt,Av).call(this);const t=Pl(this.options.staleTime,N(this,lt));if(rc||N(this,Vn).isStale||!Nv(t))return;const r=WE(N(this,Vn).dataUpdatedAt,t)+1;we(this,hi,setTimeout(()=>{N(this,Vn).isStale||this.updateResult()},r))},Ov=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,lt)):this.options.refetchInterval)??!1},Iv=function(t){Ye(this,wt,Fv).call(this),we(this,ta,t),!(rc||Xr(this.options.enabled,N(this,lt))===!1||!Nv(N(this,ta))||N(this,ta)===0)&&we(this,mi,setInterval(()=>{(this.options.refetchIntervalInBackground||Lb.isFocused())&&Ye(this,wt,du).call(this)},N(this,ta)))},Dv=function(){Ye(this,wt,Rv).call(this),Ye(this,wt,Iv).call(this,Ye(this,wt,Ov).call(this))},Av=function(){N(this,hi)&&(clearTimeout(N(this,hi)),we(this,hi,void 0))},Fv=function(){N(this,mi)&&(clearInterval(N(this,mi)),we(this,mi,void 0))},Lv=function(){const t=N(this,er).getQueryCache().build(N(this,er),this.options);if(t===N(this,lt))return;const n=N(this,lt);we(this,lt,t),we(this,$d,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},rk=function(t){dn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,Vn))}),N(this,er).getQueryCache().notify({query:N(this,lt),type:"observerResultsUpdated"})})},OE);function VD(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function iS(e,t){return VD(e,t)||e.state.data!==void 0&&$v(e,t,t.refetchOnMount)}function $v(e,t,n){if(Xr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$b(e,t)}return!1}function lS(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$b(e,n)}function $b(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(Pl(t.staleTime,e))}function HD(e,t){return!jp(e.getCurrentResult(),t)}var na,ra,tr,ao,mo,ep,Bv,IE,KD=(IE=class extends xc{constructor(n,r){super();De(this,mo);De(this,na);De(this,ra);De(this,tr);De(this,ao);we(this,na,n),this.setOptions(r),this.bindMethods(),Ye(this,mo,ep).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=N(this,na).defaultMutationOptions(n),jp(this.options,r)||N(this,na).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,tr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ki(r.mutationKey)!==ki(this.options.mutationKey)?this.reset():((s=N(this,tr))==null?void 0:s.state.status)==="pending"&&N(this,tr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=N(this,tr))==null||n.removeObserver(this)}onMutationUpdate(n){Ye(this,mo,ep).call(this),Ye(this,mo,Bv).call(this,n)}getCurrentResult(){return N(this,ra)}reset(){var n;(n=N(this,tr))==null||n.removeObserver(this),we(this,tr,void 0),Ye(this,mo,ep).call(this),Ye(this,mo,Bv).call(this)}mutate(n,r){var s;return we(this,ao,r),(s=N(this,tr))==null||s.removeObserver(this),we(this,tr,N(this,na).getMutationCache().build(N(this,na),this.options)),N(this,tr).addObserver(this),N(this,tr).execute(n)}},na=new WeakMap,ra=new WeakMap,tr=new WeakMap,ao=new WeakMap,mo=new WeakSet,ep=function(){var r;const n=((r=N(this,tr))==null?void 0:r.state)??nk();we(this,ra,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Bv=function(n){dn.batch(()=>{var r,s,o,a,c,u,i,d;if(N(this,ao)&&this.hasListeners()){const p=N(this,ra).variables,f=N(this,ra).context;(n==null?void 0:n.type)==="success"?((s=(r=N(this,ao)).onSuccess)==null||s.call(r,n.data,p,f),(a=(o=N(this,ao)).onSettled)==null||a.call(o,n.data,null,p,f)):(n==null?void 0:n.type)==="error"&&((u=(c=N(this,ao)).onError)==null||u.call(c,n.error,p,f),(d=(i=N(this,ao)).onSettled)==null||d.call(i,void 0,n.error,p,f))}this.listeners.forEach(p=>{p(N(this,ra))})})},IE),sk=v.createContext(void 0),Bb=e=>{const t=v.useContext(sk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qD=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(sk.Provider,{value:e,children:t})),ok=v.createContext(!1),WD=()=>v.useContext(ok);ok.Provider;function GD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JD=v.createContext(GD()),QD=()=>v.useContext(JD);function ak(e,t){return typeof e=="function"?e(...t):!!e}function ZD(){}var YD=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},XD=e=>{v.useEffect(()=>{e.clearReset()},[e])},eA=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&ak(n,[e.error,r]),tA=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},nA=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,rA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function sA(e,t,n){var i,d,p,f;const r=Bb(),s=WD(),o=QD(),a=r.defaultQueryOptions(e);(d=(i=r.getDefaultOptions().queries)==null?void 0:i._experimental_beforeQuery)==null||d.call(i,a),a._optimisticResults=s?"isRestoring":"optimistic",tA(a),YD(a,o),XD(o);const[c]=v.useState(()=>new t(r,a)),u=c.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(g=>{const h=s?()=>{}:c.subscribe(dn.batchCalls(g));return c.updateResult(),h},[c,s]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),nA(a,u))throw rA(a,c,o);if(eA({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw u.error;return(f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||f.call(p,a,u),a.notifyOnChangeProps?u:c.trackResult(u)}function qe(e,t){return sA(e,UD)}function oA(e,t){const n=Bb(),[r]=v.useState(()=>new KD(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const s=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(dn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,c)=>{r.mutate(a,c).catch(ZD)},[r]);if(s.error&&ak(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}var zv={},ik={exports:{}},jr={},lk={exports:{}},ck={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(L,A){var X=L.length;L.push(A);e:for(;0>>1,H=L[fe];if(0>>1;fes(le,X))oes(Q,le)?(L[fe]=Q,L[oe]=X,fe=oe):(L[fe]=le,L[ne]=X,fe=ne);else if(oes(Q,X))L[fe]=Q,L[oe]=X,fe=oe;else break e}}return A}function s(L,A){var X=L.sortIndex-A.sortIndex;return X!==0?X:L.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],i=[],d=1,p=null,f=3,g=!1,h=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var A=n(i);A!==null;){if(A.callback===null)r(i);else if(A.startTime<=L)r(i),A.sortIndex=A.expirationTime,t(u,A);else break;A=n(i)}}function S(L){if(m=!1,w(L),!h)if(n(u)!==null)h=!0,ee(E);else{var A=n(i);A!==null&&J(S,A.startTime-L)}}function E(L,A){h=!1,m&&(m=!1,b(j),j=-1),g=!0;var X=f;try{for(w(A),p=n(u);p!==null&&(!(p.expirationTime>A)||L&&!K());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,f=p.priorityLevel;var H=fe(p.expirationTime<=A);A=e.unstable_now(),typeof H=="function"?p.callback=H:p===n(u)&&r(u),w(A)}else r(u);p=n(u)}if(p!==null)var se=!0;else{var ne=n(i);ne!==null&&J(S,ne.startTime-A),se=!1}return se}finally{p=null,f=X,g=!1}}var C=!1,T=null,j=-1,_=5,O=-1;function K(){return!(e.unstable_now()-O<_)}function I(){if(T!==null){var L=e.unstable_now();O=L;var A=!0;try{A=T(!0,L)}finally{A?Y():(C=!1,T=null)}}else C=!1}var Y;if(typeof y=="function")Y=function(){y(I)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Z=q.port2;q.port1.onmessage=I,Y=function(){Z.postMessage(null)}}else Y=function(){x(I,0)};function ee(L){T=L,C||(C=!0,Y())}function J(L,A){j=x(function(){L(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){h||g||(h=!0,ee(E))},e.unstable_forceFrameRate=function(L){0>L||125fe?(L.sortIndex=X,t(i,L),n(u)===null&&L===n(i)&&(m?(b(j),j=-1):m=!0,J(S,X-fe))):(L.sortIndex=H,t(u,L),h||g||(h=!0,ee(E))),L},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(L){var A=f;return function(){var X=f;f=A;try{return L.apply(this,arguments)}finally{f=X}}}})(ck);lk.exports=ck;var aA=lk.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var iA=v,Cr=aA;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uv=Object.prototype.hasOwnProperty,lA=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,cS={},uS={};function cA(e){return Uv.call(uS,e)?!0:Uv.call(cS,e)?!1:lA.test(e)?uS[e]=!0:(cS[e]=!0,!1)}function uA(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dA(e,t,n,r){if(t===null||typeof t>"u"||uA(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zn(e,t,n,r,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jn[e]=new Zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];jn[t]=new Zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jn[e]=new Zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jn[e]=new Zn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jn[e]=new Zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jn[e]=new Zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jn[e]=new Zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jn[e]=new Zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jn[e]=new Zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var zb=/[\-:]([a-z])/g;function Ub(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(zb,Ub);jn[t]=new Zn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zb,Ub);jn[t]=new Zn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zb,Ub);jn[t]=new Zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jn[e]=new Zn(e,1,!1,e.toLowerCase(),null,!1,!1)});jn.xlinkHref=new Zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jn[e]=new Zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Vb(e,t,n,r){var s=jn.hasOwnProperty(t)?jn[t]:null;(s!==null?s.type!==0:r||!(2c||s[a]!==o[c]){var u=` -`+s[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=c);break}}}finally{fm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fu(e):""}function fA(e){switch(e.tag){case 5:return fu(e.type);case 16:return fu("Lazy");case 13:return fu("Suspense");case 19:return fu("SuspenseList");case 0:case 2:case 15:return e=pm(e.type,!1),e;case 11:return e=pm(e.type.render,!1),e;case 1:return e=pm(e.type,!0),e;default:return""}}function qv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ml:return"Fragment";case hl:return"Portal";case Vv:return"Profiler";case Hb:return"StrictMode";case Hv:return"Suspense";case Kv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fk:return(e.displayName||"Context")+".Consumer";case dk:return(e._context.displayName||"Context")+".Provider";case Kb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qb:return t=e.displayName||null,t!==null?t:qv(e.type)||"Memo";case Ho:t=e._payload,e=e._init;try{return qv(e(t))}catch{}}return null}function pA(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qv(t);case 8:return t===Hb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ma(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gk(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gA(e){var t=gk(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gf(e){e._valueTracker||(e._valueTracker=gA(e))}function hk(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=gk(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Mp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Wv(e,t){var n=t.checked;return Gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fS(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ma(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mk(e,t){t=t.checked,t!=null&&Vb(e,"checked",t,!1)}function Gv(e,t){mk(e,t);var n=ma(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jv(e,t.type,n):t.hasOwnProperty("defaultValue")&&Jv(e,t.type,ma(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pS(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Jv(e,t,n){(t!=="number"||Mp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pu=Array.isArray;function Rl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=hf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Eu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hA=["Webkit","ms","Moz","O"];Object.keys(Eu).forEach(function(e){hA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Eu[t]=Eu[e]})});function xk(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Eu.hasOwnProperty(e)&&Eu[e]?(""+t).trim():t+"px"}function wk(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=xk(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var mA=Gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yv(e,t){if(t){if(mA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function Xv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ey=null;function Wb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ty=null,Ol=null,Il=null;function mS(e){if(e=Hd(e)){if(typeof ty!="function")throw Error(te(280));var t=e.stateNode;t&&(t=Bg(t),ty(e.stateNode,e.type,t))}}function Sk(e){Ol?Il?Il.push(e):Il=[e]:Ol=e}function Ck(){if(Ol){var e=Ol,t=Il;if(Il=Ol=null,mS(e),t)for(e=0;e>>=0,e===0?32:31-(TA(e)/MA|0)|0}var mf=64,vf=4194304;function gu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var c=a&~s;c!==0?r=gu(c):(o&=a,o!==0&&(r=gu(o)))}else a=n&~s,a!==0?r=gu(a):o!==0&&(r=gu(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ud(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ss(t),e[t]=n}function RA(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ju),kS=" ",jS=!1;function Vk(e,t){switch(e){case"keyup":return aF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function lF(e,t){switch(e){case"compositionend":return Hk(t);case"keypress":return t.which!==32?null:(jS=!0,kS);case"textInput":return e=t.data,e===kS&&jS?null:e;default:return null}}function cF(e,t){if(vl)return e==="compositionend"||!tx&&Vk(e,t)?(e=zk(),np=Yb=sa=null,vl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_S(n)}}function Gk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jk(){for(var e=window,t=Mp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mp(e.document)}return t}function nx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yF(e){var t=Jk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gk(n.ownerDocument.documentElement,n)){if(r!==null&&nx(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=PS(n,o);var a=PS(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,yl=null,iy=null,Mu=null,ly=!1;function RS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ly||yl==null||yl!==Mp(r)||(r=yl,"selectionStart"in r&&nx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mu&&Ju(Mu,r)||(Mu=r,r=Dp(iy,"onSelect"),0wl||(e.current=gy[wl],gy[wl]=null,wl--)}function Nt(e,t){wl++,gy[wl]=e.current,e.current=t}var va={},Ln=Na(va),or=Na(!1),ji=va;function oc(e,t){var n=e.type.contextTypes;if(!n)return va;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function ar(e){return e=e.childContextTypes,e!=null}function Fp(){At(or),At(Ln)}function $S(e,t,n){if(Ln.current!==va)throw Error(te(168));Nt(Ln,t),Nt(or,n)}function sj(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(te(108,pA(e)||"Unknown",s));return Gt({},n,r)}function Lp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||va,ji=Ln.current,Nt(Ln,e),Nt(or,or.current),!0}function BS(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=sj(e,t,ji),r.__reactInternalMemoizedMergedChildContext=e,At(or),At(Ln),Nt(Ln,e)):At(or),Nt(or,n)}var oo=null,zg=!1,Tm=!1;function oj(e){oo===null?oo=[e]:oo.push(e)}function _F(e){zg=!0,oj(e)}function _a(){if(!Tm&&oo!==null){Tm=!0;var e=0,t=Ct;try{var n=oo;for(Ct=1;e>=a,s-=a,lo=1<<32-ss(t)+s|n<j?(_=T,T=null):_=T.sibling;var O=f(b,T,w[j],S);if(O===null){T===null&&(T=_);break}e&&T&&O.alternate===null&&t(b,T),y=o(O,y,j),C===null?E=O:C.sibling=O,C=O,T=_}if(j===w.length)return n(b,T),$t&&Ja(b,j),E;if(T===null){for(;jj?(_=T,T=null):_=T.sibling;var K=f(b,T,O.value,S);if(K===null){T===null&&(T=_);break}e&&T&&K.alternate===null&&t(b,T),y=o(K,y,j),C===null?E=K:C.sibling=K,C=K,T=_}if(O.done)return n(b,T),$t&&Ja(b,j),E;if(T===null){for(;!O.done;j++,O=w.next())O=p(b,O.value,S),O!==null&&(y=o(O,y,j),C===null?E=O:C.sibling=O,C=O);return $t&&Ja(b,j),E}for(T=r(b,T);!O.done;j++,O=w.next())O=g(T,b,j,O.value,S),O!==null&&(e&&O.alternate!==null&&T.delete(O.key===null?j:O.key),y=o(O,y,j),C===null?E=O:C.sibling=O,C=O);return e&&T.forEach(function(I){return t(b,I)}),$t&&Ja(b,j),E}function x(b,y,w,S){if(typeof w=="object"&&w!==null&&w.type===ml&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case pf:e:{for(var E=w.key,C=y;C!==null;){if(C.key===E){if(E=w.type,E===ml){if(C.tag===7){n(b,C.sibling),y=s(C,w.props.children),y.return=b,b=y;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ho&&VS(E)===C.type){n(b,C.sibling),y=s(C,w.props),y.ref=Gc(b,C,w),y.return=b,b=y;break e}n(b,C);break}else t(b,C);C=C.sibling}w.type===ml?(y=yi(w.props.children,b.mode,S,w.key),y.return=b,b=y):(S=up(w.type,w.key,w.props,null,b.mode,S),S.ref=Gc(b,y,w),S.return=b,b=S)}return a(b);case hl:e:{for(C=w.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(b,y.sibling),y=s(y,w.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=Dm(w,b.mode,S),y.return=b,b=y}return a(b);case Ho:return C=w._init,x(b,y,C(w._payload),S)}if(pu(w))return h(b,y,w,S);if(Vc(w))return m(b,y,w,S);Ef(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(b,y.sibling),y=s(y,w),y.return=b,b=y):(n(b,y),y=Im(w,b.mode,S),y.return=b,b=y),a(b)):n(b,y)}return x}var ic=cj(!0),uj=cj(!1),zp=Na(null),Up=null,El=null,ax=null;function ix(){ax=El=Up=null}function lx(e){var t=zp.current;At(zp),e._currentValue=t}function vy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Al(e,t){Up=e,ax=El=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Hr(e){var t=e._currentValue;if(ax!==e)if(e={context:e,memoizedValue:t,next:null},El===null){if(Up===null)throw Error(te(308));El=e,Up.dependencies={lanes:0,firstContext:e}}else El=El.next=e;return t}var ei=null;function cx(e){ei===null?ei=[e]:ei.push(e)}function dj(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,cx(t)):(n.next=s.next,s.next=n),t.interleaved=n,bo(e,r)}function bo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ko=!1;function ux(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fj(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function go(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,gt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,bo(e,n)}return s=r.interleaved,s===null?(t.next=t,cx(r)):(t.next=s.next,s.next=t),r.interleaved=t,bo(e,n)}function sp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jb(e,n)}}function HS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vp(e,t,n,r){var s=e.updateQueue;Ko=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,c=s.shared.pending;if(c!==null){s.shared.pending=null;var u=c,i=u.next;u.next=null,a===null?o=i:a.next=i,a=u;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==a&&(c===null?d.firstBaseUpdate=i:c.next=i,d.lastBaseUpdate=u))}if(o!==null){var p=s.baseState;a=0,d=i=u=null,c=o;do{var f=c.lane,g=c.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var h=e,m=c;switch(f=t,g=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){p=h.call(g,p,f);break e}p=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(g,p,f):h,f==null)break e;p=Gt({},p,f);break e;case 2:Ko=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[c]:f.push(c))}else g={eventTime:g,lane:f,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(i=d=g,u=p):d=d.next=g,a|=f;if(c=c.next,c===null){if(c=s.shared.pending,c===null)break;f=c,c=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(u=p),s.baseState=u,s.firstBaseUpdate=i,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Ni|=a,e.lanes=a,e.memoizedState=p}}function KS(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Nm.transition;Nm.transition={};try{e(!1),t()}finally{Ct=n,Nm.transition=r}}function Nj(){return Kr().memoizedState}function IF(e,t,n){var r=ga(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_j(e))Pj(t,n);else if(n=dj(e,t,n,r),n!==null){var s=Gn();os(n,e,r,s),Rj(n,t,r)}}function DF(e,t,n){var r=ga(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_j(e))Pj(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,c=o(a,n);if(s.hasEagerState=!0,s.eagerState=c,ds(c,a)){var u=t.interleaved;u===null?(s.next=s,cx(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=dj(e,t,s,r),n!==null&&(s=Gn(),os(n,e,r,s),Rj(n,t,r))}}function _j(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function Pj(e,t){Nu=Kp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jb(e,n)}}var qp={readContext:Hr,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useInsertionEffect:Pn,useLayoutEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useMutableSource:Pn,useSyncExternalStore:Pn,useId:Pn,unstable_isNewReconciler:!1},AF={readContext:Hr,useCallback:function(e,t){return ks().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:WS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ap(4194308,4,Ej.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ap(4194308,4,e,t)},useInsertionEffect:function(e,t){return ap(4,2,e,t)},useMemo:function(e,t){var n=ks();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ks();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=IF.bind(null,Wt,e),[r.memoizedState,e]},useRef:function(e){var t=ks();return e={current:e},t.memoizedState=e},useState:qS,useDebugValue:yx,useDeferredValue:function(e){return ks().memoizedState=e},useTransition:function(){var e=qS(!1),t=e[0];return e=OF.bind(null,e[1]),ks().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Wt,s=ks();if($t){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),yn===null)throw Error(te(349));Mi&30||mj(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,WS(yj.bind(null,r,o,e),[e]),r.flags|=2048,rd(9,vj.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ks(),t=yn.identifierPrefix;if($t){var n=co,r=lo;n=(r&~(1<<32-ss(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=td++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[_s]=t,e[Yu]=r,Uj(e,t,!1,!1),t.stateNode=e;e:{switch(a=Xv(n,r),n){case"dialog":It("cancel",e),It("close",e),s=r;break;case"iframe":case"object":case"embed":It("load",e),s=r;break;case"video":case"audio":for(s=0;suc&&(t.flags|=128,r=!0,Jc(o,!1),t.lanes=4194304)}else{if(!r)if(e=Hp(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!$t)return Rn(t),null}else 2*en()-o.renderingStartTime>uc&&n!==1073741824&&(t.flags|=128,r=!0,Jc(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=en(),t.sibling=null,n=qt.current,Nt(qt,r?n&1|2:n&1),t):(Rn(t),null);case 22:case 23:return Ex(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gr&1073741824&&(Rn(t),t.subtreeFlags&6&&(t.flags|=8192)):Rn(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function HF(e,t){switch(sx(t),t.tag){case 1:return ar(t.type)&&Fp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lc(),At(or),At(Ln),px(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fx(t),null;case 13:if(At(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ac()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return At(qt),null;case 4:return lc(),null;case 10:return lx(t.type._context),null;case 22:case 23:return Ex(),null;case 24:return null;default:return null}}var jf=!1,An=!1,KF=typeof WeakSet=="function"?WeakSet:Set,Se=null;function kl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zt(e,t,r)}else n.current=null}function jy(e,t,n){try{n()}catch(r){Zt(e,t,r)}}var s0=!1;function qF(e,t){if(cy=Op,e=Jk(),nx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,c=-1,u=-1,i=0,d=0,p=e,f=null;t:for(;;){for(var g;p!==n||s!==0&&p.nodeType!==3||(c=a+s),p!==o||r!==0&&p.nodeType!==3||(u=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(g=p.firstChild)!==null;)f=p,p=g;for(;;){if(p===e)break t;if(f===n&&++i===s&&(c=a),f===o&&++d===r&&(u=a),(g=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=g}n=c===-1||u===-1?null:{start:c,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(uy={focusedElem:e,selectionRange:n},Op=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,x=h.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Jr(t.type,m),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(S){Zt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return h=s0,s0=!1,h}function _u(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&jy(t,n,o)}s=s.next}while(s!==r)}}function Hg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ty(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Kj(e){var t=e.alternate;t!==null&&(e.alternate=null,Kj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_s],delete t[Yu],delete t[py],delete t[MF],delete t[NF])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qj(e){return e.tag===5||e.tag===3||e.tag===4}function o0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function My(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ap));else if(r!==4&&(e=e.child,e!==null))for(My(e,t,n),e=e.sibling;e!==null;)My(e,t,n),e=e.sibling}function Ny(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ny(e,t,n),e=e.sibling;e!==null;)Ny(e,t,n),e=e.sibling}var Cn=null,Zr=!1;function Ao(e,t,n){for(n=n.child;n!==null;)Wj(e,t,n),n=n.sibling}function Wj(e,t,n){if($s&&typeof $s.onCommitFiberUnmount=="function")try{$s.onCommitFiberUnmount(Ag,n)}catch{}switch(n.tag){case 5:An||kl(n,t);case 6:var r=Cn,s=Zr;Cn=null,Ao(e,t,n),Cn=r,Zr=s,Cn!==null&&(Zr?(e=Cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Cn.removeChild(n.stateNode));break;case 18:Cn!==null&&(Zr?(e=Cn,n=n.stateNode,e.nodeType===8?jm(e.parentNode,n):e.nodeType===1&&jm(e,n),Wu(e)):jm(Cn,n.stateNode));break;case 4:r=Cn,s=Zr,Cn=n.stateNode.containerInfo,Zr=!0,Ao(e,t,n),Cn=r,Zr=s;break;case 0:case 11:case 14:case 15:if(!An&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&jy(n,t,a),s=s.next}while(s!==r)}Ao(e,t,n);break;case 1:if(!An&&(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Zt(n,t,c)}Ao(e,t,n);break;case 21:Ao(e,t,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,Ao(e,t,n),An=r):Ao(e,t,n);break;default:Ao(e,t,n)}}function a0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KF),t.forEach(function(r){var s=t2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Gr(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~o}if(r=s,r=en()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GF(r/1960))-r,10e?16:e,oa===null)var r=!1;else{if(e=oa,oa=null,Jp=0,gt&6)throw Error(te(331));var s=gt;for(gt|=4,Se=e.current;Se!==null;){var o=Se,a=o.child;if(Se.flags&16){var c=o.deletions;if(c!==null){for(var u=0;uen()-Sx?vi(e,0):wx|=n),ir(e,t)}function tT(e,t){t===0&&(e.mode&1?(t=vf,vf<<=1,!(vf&130023424)&&(vf=4194304)):t=1);var n=Gn();e=bo(e,t),e!==null&&(Ud(e,t,n),ir(e,n))}function e2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tT(e,n)}function t2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),tT(e,n)}var nT;nT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||or.current)sr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return sr=!1,UF(e,t,n);sr=!!(e.flags&131072)}else sr=!1,$t&&t.flags&1048576&&aj(t,Bp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ip(e,t),e=t.pendingProps;var s=oc(t,Ln.current);Al(t,n),s=hx(null,t,r,e,s,n);var o=mx();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ar(r)?(o=!0,Lp(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ux(t),s.updater=Vg,t.stateNode=s,s._reactInternals=t,by(t,r,e,n),t=Sy(null,t,r,!0,o,n)):(t.tag=0,$t&&o&&rx(t),Kn(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ip(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=r2(r),e=Jr(r,e),s){case 0:t=wy(null,t,r,e,n);break e;case 1:t=t0(null,t,r,e,n);break e;case 11:t=XS(null,t,r,e,n);break e;case 14:t=e0(null,t,r,Jr(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),wy(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),t0(e,t,r,s,n);case 3:e:{if($j(t),e===null)throw Error(te(387));r=t.pendingProps,o=t.memoizedState,s=o.element,fj(e,t),Vp(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=cc(Error(te(423)),t),t=n0(e,t,r,n,s);break e}else if(r!==s){s=cc(Error(te(424)),t),t=n0(e,t,r,n,s);break e}else for(yr=da(t.stateNode.containerInfo.firstChild),xr=t,$t=!0,es=null,n=uj(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ac(),r===s){t=xo(e,t,n);break e}Kn(e,t,r,n)}t=t.child}return t;case 5:return pj(t),e===null&&my(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,dy(r,s)?a=null:o!==null&&dy(r,o)&&(t.flags|=32),Lj(e,t),Kn(e,t,a,n),t.child;case 6:return e===null&&my(t),null;case 13:return Bj(e,t,n);case 4:return dx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ic(t,null,r,n):Kn(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),XS(e,t,r,s,n);case 7:return Kn(e,t,t.pendingProps,n),t.child;case 8:return Kn(e,t,t.pendingProps.children,n),t.child;case 12:return Kn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,Nt(zp,r._currentValue),r._currentValue=a,o!==null)if(ds(o.value,a)){if(o.children===s.children&&!or.current){t=xo(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){a=o.child;for(var u=c.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=go(-1,n&-n),u.tag=2;var i=o.updateQueue;if(i!==null){i=i.shared;var d=i.pending;d===null?u.next=u:(u.next=d.next,d.next=u),i.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),vy(o.return,n,t),c.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(te(341));a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),vy(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Kn(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Al(t,n),s=Hr(s),r=r(s),t.flags|=1,Kn(e,t,r,n),t.child;case 14:return r=t.type,s=Jr(r,t.pendingProps),s=Jr(r.type,s),e0(e,t,r,s,n);case 15:return Aj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),ip(e,t),t.tag=1,ar(r)?(e=!0,Lp(t)):e=!1,Al(t,n),Oj(t,r,s),by(t,r,s,n),Sy(null,t,r,!0,e,n);case 19:return zj(e,t,n);case 22:return Fj(e,t,n)}throw Error(te(156,t.tag))};function rT(e,t){return _k(e,t)}function n2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(e,t,n,r){return new n2(e,t,n,r)}function jx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function r2(e){if(typeof e=="function")return jx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kb)return 11;if(e===qb)return 14}return 2}function ha(e,t){var n=e.alternate;return n===null?(n=$r(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function up(e,t,n,r,s,o){var a=2;if(r=e,typeof e=="function")jx(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ml:return yi(n.children,s,o,t);case Hb:a=8,s|=8;break;case Vv:return e=$r(12,n,t,s|2),e.elementType=Vv,e.lanes=o,e;case Hv:return e=$r(13,n,t,s),e.elementType=Hv,e.lanes=o,e;case Kv:return e=$r(19,n,t,s),e.elementType=Kv,e.lanes=o,e;case pk:return qg(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dk:a=10;break e;case fk:a=9;break e;case Kb:a=11;break e;case qb:a=14;break e;case Ho:a=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=$r(a,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function yi(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function qg(e,t,n,r){return e=$r(22,e,r,t),e.elementType=pk,e.lanes=n,e.stateNode={isHidden:!1},e}function Im(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function Dm(e,t,n){return t=$r(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function s2(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hm(0),this.expirationTimes=hm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hm(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Tx(e,t,n,r,s,o,a,c,u){return e=new s2(e,t,n,c,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=$r(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ux(o),e}function o2(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iT)}catch(e){console.error(e)}}iT(),ik.exports=jr;var Pa=ik.exports;const lT=Rb(Pa),u2=DE({__proto__:null,default:lT},[Pa]);var g0=Pa;zv.createRoot=g0.createRoot,zv.hydrateRoot=g0.hydrateRoot;const d2=(...e)=>{console!=null&&console.warn&&(bi(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},h0={},Iy=(...e)=>{bi(e[0])&&h0[e[0]]||(bi(e[0])&&(h0[e[0]]=new Date),d2(...e))},cT=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},m0=(e,t,n)=>{e.loadNamespaces(t,cT(e,n))},v0=(e,t,n,r)=>{bi(n)&&(n=[n]),n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,cT(e,r))},f2=(e,t,n={})=>!t.languages||!t.languages.length?(Iy("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),bi=e=>typeof e=="string",p2=e=>typeof e=="object"&&e!==null,g2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,h2={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},m2=e=>h2[e],v2=e=>e.replace(g2,m2);let Dy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:v2};const y2=(e={})=>{Dy={...Dy,...e}},b2=()=>Dy;let uT;const x2=e=>{uT=e},w2=()=>uT,S2={type:"3rdParty",init(e){y2(e.options.react),x2(e)}},dT=v.createContext();class C2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const E2=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},fT=(e,t,n,r)=>e.getFixedT(t,n,r),k2=(e,t,n,r)=>v.useCallback(fT(e,t,n,r),[e,t,n,r]),Te=(e,t={})=>{var S,E,C,T;const{i18n:n}=t,{i18n:r,defaultNS:s}=v.useContext(dT)||{},o=n||r||w2();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new C2),!o){Iy("You will need to pass in an i18next instance by using initReactI18next");const j=(O,K)=>bi(K)?K:p2(K)&&bi(K.defaultValue)?K.defaultValue:Array.isArray(O)?O[O.length-1]:O,_=[j,{},!1];return _.t=j,_.i18n={},_.ready=!1,_}(S=o.options.react)!=null&&S.wait&&Iy("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...b2(),...o.options.react,...t},{useSuspense:c,keyPrefix:u}=a;let i=s||((E=o.options)==null?void 0:E.defaultNS);i=bi(i)?[i]:i||["translation"],(T=(C=o.reportNamespaces).addUsedNamespaces)==null||T.call(C,i);const d=(o.isInitialized||o.initializedStoreOnce)&&i.every(j=>f2(j,o,a)),p=k2(o,t.lng||null,a.nsMode==="fallback"?i:i[0],u),f=()=>p,g=()=>fT(o,t.lng||null,a.nsMode==="fallback"?i:i[0],u),[h,m]=v.useState(f);let x=i.join();t.lng&&(x=`${t.lng}${x}`);const b=E2(x),y=v.useRef(!0);v.useEffect(()=>{const{bindI18n:j,bindI18nStore:_}=a;y.current=!0,!d&&!c&&(t.lng?v0(o,t.lng,i,()=>{y.current&&m(g)}):m0(o,i,()=>{y.current&&m(g)})),d&&b&&b!==x&&y.current&&m(g);const O=()=>{y.current&&m(g)};return j&&(o==null||o.on(j,O)),_&&(o==null||o.store.on(_,O)),()=>{y.current=!1,o&&(j==null||j.split(" ").forEach(K=>o.off(K,O))),_&&o&&_.split(" ").forEach(K=>o.store.off(K,O))}},[o,x]),v.useEffect(()=>{y.current&&d&&m(f)},[o,u,d]);const w=[h,o,d];if(w.t=h,w.i18n=o,w.ready=d,d||!d&&!c)return w;throw new Promise(j=>{t.lng?v0(o,t.lng,i,()=>j()):m0(o,i,()=>j())})};function j2({i18n:e,defaultNS:t,children:n}){const r=v.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return v.createElement(dT.Provider,{value:r},n)}/** - * @remix-run/router v1.18.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function dc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function M2(){return Math.random().toString(36).substr(2,8)}function b0(e,t){return{usr:e.state,key:e.key,idx:t}}function od(e,t,n,r){return n===void 0&&(n=null),Kt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ra(t):t,{state:n,key:t&&t.key||r||M2()})}function Pi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ra(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function N2(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,a=s.history,c=rn.Pop,u=null,i=d();i==null&&(i=0,a.replaceState(Kt({},a.state,{idx:i}),""));function d(){return(a.state||{idx:null}).idx}function p(){c=rn.Pop;let x=d(),b=x==null?null:x-i;i=x,u&&u({action:c,location:m.location,delta:b})}function f(x,b){c=rn.Push;let y=od(m.location,x,b);i=d()+1;let w=b0(y,i),S=m.createHref(y);try{a.pushState(w,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(S)}o&&u&&u({action:c,location:m.location,delta:1})}function g(x,b){c=rn.Replace;let y=od(m.location,x,b);i=d();let w=b0(y,i),S=m.createHref(y);a.replaceState(w,"",S),o&&u&&u({action:c,location:m.location,delta:0})}function h(x){let b=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof x=="string"?x:Pi(x);return y=y.replace(/ $/,"%20"),et(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let m={get action(){return c},get location(){return e(s,a)},listen(x){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(y0,p),u=x,()=>{s.removeEventListener(y0,p),u=null}},createHref(x){return t(s,x)},createURL:h,encodeLocation(x){let b=h(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:g,go(x){return a.go(x)}};return m}var Mt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mt||(Mt={}));const _2=new Set(["lazy","caseSensitive","path","id","index","children"]);function P2(e){return e.index===!0}function ad(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,o)=>{let a=[...n,String(o)],c=typeof s.id=="string"?s.id:a.join("-");if(et(s.index!==!0||!s.children,"Cannot specify children on an index route"),et(!r[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),P2(s)){let u=Kt({},s,t(s),{id:c});return r[c]=u,u}else{let u=Kt({},s,t(s),{id:c,children:void 0});return r[c]=u,s.children&&(u.children=ad(s.children,t,a,r)),u}})}function Ya(e,t,n){return n===void 0&&(n="/"),dp(e,t,n,!1)}function dp(e,t,n,r){let s=typeof t=="string"?Ra(t):t,o=Cc(s.pathname||"/",n);if(o==null)return null;let a=pT(e);O2(a);let c=null;for(let u=0;c==null&&u{let u={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(et(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let i=ho([r,u.relativePath]),d=n.concat(u);o.children&&o.children.length>0&&(et(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),pT(o.children,t,d,i)),!(o.path==null&&!o.index)&&t.push({path:i,score:B2(i,o.index),routesMeta:d})};return e.forEach((o,a)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))s(o,a);else for(let u of gT(o.path))s(o,a,u)}),t}function gT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let a=gT(r.join("/")),c=[];return c.push(...a.map(u=>u===""?o:[o,u].join("/"))),s&&c.push(...a),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function O2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:z2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const I2=/^:[\w-]+$/,D2=3,A2=2,F2=1,L2=10,$2=-2,x0=e=>e==="*";function B2(e,t){let n=e.split("/"),r=n.length;return n.some(x0)&&(r+=$2),t&&(r+=A2),n.filter(s=>!x0(s)).reduce((s,o)=>s+(I2.test(o)?D2:o===""?F2:L2),r)}function z2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function U2(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},o="/",a=[];for(let c=0;c{let{paramName:f,isOptional:g}=d;if(f==="*"){let m=c[p]||"";a=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const h=c[p];return g&&!h?i[f]=void 0:i[f]=(h||"").replace(/%2F/g,"/"),i},{}),pathname:o,pathnameBase:a,pattern:e}}function V2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),dc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function H2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function K2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ra(e):e;return{pathname:n?n.startsWith("/")?n:q2(n,t):t,search:G2(r),hash:J2(s)}}function q2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Am(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function hT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zg(e,t){let n=hT(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Yg(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ra(e):(s=Kt({},e),et(!s.pathname||!s.pathname.includes("?"),Am("?","pathname","search",s)),et(!s.pathname||!s.pathname.includes("#"),Am("#","pathname","hash",s)),et(!s.search||!s.search.includes("#"),Am("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,c;if(a==null)c=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),p-=1;s.pathname=f.join("/")}c=p>=0?t[p]:"/"}let u=K2(s,c),i=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(i||d)&&(u.pathname+="/"),u}const ho=e=>e.join("/").replace(/\/\/+/g,"/"),W2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),G2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,J2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Px{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Xg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const mT=["post","put","patch","delete"],Q2=new Set(mT),Z2=["get",...mT],Y2=new Set(Z2),X2=new Set([301,302,303,307,308]),eL=new Set([307,308]),Fm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Rx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nL=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),vT="remix-router-transitions";function rL(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;et(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;s=R=>({hasErrorBoundary:P(R)})}else s=nL;let o={},a=ad(e.routes,s,void 0,o),c,u=e.basename||"/",i=e.unstable_dataStrategy||lL,d=e.unstable_patchRoutesOnMiss,p=Kt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,g=new Set,h=null,m=null,x=null,b=e.hydrationData!=null,y=Ya(a,e.history.location,u),w=null;if(y==null&&!d){let P=Hn(404,{pathname:e.history.location.pathname}),{matches:R,route:B}=P0(a);y=R,w={[B.id]:P}}y&&d&&!e.hydrationData&&im(y,a,e.history.location.pathname).active&&(y=null);let S;if(!y)S=!1,y=[];else if(y.some(P=>P.route.lazy))S=!1;else if(!y.some(P=>P.route.loader))S=!0;else if(p.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,R=e.hydrationData?e.hydrationData.errors:null,B=W=>W.route.loader?typeof W.route.loader=="function"&&W.route.loader.hydrate===!0?!1:P&&P[W.route.id]!==void 0||R&&R[W.route.id]!==void 0:!0;if(R){let W=y.findIndex(be=>R[be.route.id]!==void 0);S=y.slice(0,W+1).every(B)}else S=y.every(B)}else S=e.hydrationData!=null;let E,C={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,navigation:Fm,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},T=rn.Pop,j=!1,_,O=!1,K=new Map,I=null,Y=!1,q=!1,Z=[],ee=[],J=new Map,L=0,A=-1,X=new Map,fe=new Set,H=new Map,se=new Map,ne=new Set,le=new Map,oe=new Map,Q=new Map,Ee=!1;function Pe(){if(f=e.history.listen(P=>{let{action:R,location:B,delta:W}=P;if(Ee){Ee=!1;return}dc(oe.size===0||W!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let be=Io({currentLocation:C.location,nextLocation:B,historyAction:R});if(be&&W!=null){Ee=!0,e.history.go(W*-1),xs(be,{state:"blocked",location:B,proceed(){xs(be,{state:"proceeding",proceed:void 0,reset:void 0,location:B}),e.history.go(W)},reset(){let Me=new Map(C.blockers);Me.set(be,Zc),ve({blockers:Me})}});return}return Xt(R,B)}),n){wL(t,K);let P=()=>SL(t,K);t.addEventListener("pagehide",P),I=()=>t.removeEventListener("pagehide",P)}return C.initialized||Xt(rn.Pop,C.location,{initialHydration:!0}),E}function Be(){f&&f(),I&&I(),g.clear(),_&&_.abort(),C.fetchers.forEach((P,R)=>bs(R)),C.blockers.forEach((P,R)=>_n(R))}function Re(P){return g.add(P),()=>g.delete(P)}function ve(P,R){R===void 0&&(R={}),C=Kt({},C,P);let B=[],W=[];p.v7_fetcherPersist&&C.fetchers.forEach((be,Me)=>{be.state==="idle"&&(ne.has(Me)?W.push(Me):B.push(Me))}),[...g].forEach(be=>be(C,{deletedFetchers:W,unstable_viewTransitionOpts:R.viewTransitionOpts,unstable_flushSync:R.flushSync===!0})),p.v7_fetcherPersist&&(B.forEach(be=>C.fetchers.delete(be)),W.forEach(be=>bs(be)))}function ot(P,R,B){var W,be;let{flushSync:Me}=B===void 0?{}:B,ze=C.actionData!=null&&C.navigation.formMethod!=null&&Yr(C.navigation.formMethod)&&C.navigation.state==="loading"&&((W=P.state)==null?void 0:W._isRedirect)!==!0,pe;R.actionData?Object.keys(R.actionData).length>0?pe=R.actionData:pe=null:ze?pe=C.actionData:pe=null;let Je=R.loaderData?N0(C.loaderData,R.loaderData,R.matches||[],R.errors):C.loaderData,_e=C.blockers;_e.size>0&&(_e=new Map(_e),_e.forEach((St,kt)=>_e.set(kt,Zc)));let Oe=j===!0||C.navigation.formMethod!=null&&Yr(C.navigation.formMethod)&&((be=P.state)==null?void 0:be._isRedirect)!==!0;c&&(a=c,c=void 0),Y||T===rn.Pop||(T===rn.Push?e.history.push(P,P.state):T===rn.Replace&&e.history.replace(P,P.state));let Et;if(T===rn.Pop){let St=K.get(C.location.pathname);St&&St.has(P.pathname)?Et={currentLocation:C.location,nextLocation:P}:K.has(P.pathname)&&(Et={currentLocation:P,nextLocation:C.location})}else if(O){let St=K.get(C.location.pathname);St?St.add(P.pathname):(St=new Set([P.pathname]),K.set(C.location.pathname,St)),Et={currentLocation:C.location,nextLocation:P}}ve(Kt({},R,{actionData:pe,loaderData:Je,historyAction:T,location:P,initialized:!0,navigation:Fm,revalidation:"idle",restoreScrollPosition:Qw(P,R.matches||C.matches),preventScrollReset:Oe,blockers:_e}),{viewTransitionOpts:Et,flushSync:Me===!0}),T=rn.Pop,j=!1,O=!1,Y=!1,q=!1,Z=[],ee=[]}async function Vt(P,R){if(typeof P=="number"){e.history.go(P);return}let B=Ay(C.location,C.matches,u,p.v7_prependBasename,P,p.v7_relativeSplatPath,R==null?void 0:R.fromRouteId,R==null?void 0:R.relative),{path:W,submission:be,error:Me}=S0(p.v7_normalizeFormMethod,!1,B,R),ze=C.location,pe=od(C.location,W,R&&R.state);pe=Kt({},pe,e.history.encodeLocation(pe));let Je=R&&R.replace!=null?R.replace:void 0,_e=rn.Push;Je===!0?_e=rn.Replace:Je===!1||be!=null&&Yr(be.formMethod)&&be.formAction===C.location.pathname+C.location.search&&(_e=rn.Replace);let Oe=R&&"preventScrollReset"in R?R.preventScrollReset===!0:void 0,Et=(R&&R.unstable_flushSync)===!0,St=Io({currentLocation:ze,nextLocation:pe,historyAction:_e});if(St){xs(St,{state:"blocked",location:pe,proceed(){xs(St,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),Vt(P,R)},reset(){let kt=new Map(C.blockers);kt.set(St,Zc),ve({blockers:kt})}});return}return await Xt(_e,pe,{submission:be,pendingError:Me,preventScrollReset:Oe,replace:R&&R.replace,enableViewTransition:R&&R.unstable_viewTransition,flushSync:Et})}function tn(){if(hn(),ve({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){Xt(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}Xt(T||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation})}}async function Xt(P,R,B){_&&_.abort(),_=null,T=P,Y=(B&&B.startUninterruptedRevalidation)===!0,eD(C.location,C.matches),j=(B&&B.preventScrollReset)===!0,O=(B&&B.enableViewTransition)===!0;let W=c||a,be=B&&B.overrideNavigation,Me=Ya(W,R,u),ze=(B&&B.flushSync)===!0,pe=im(Me,W,R.pathname);if(pe.active&&pe.matches&&(Me=pe.matches),!Me){let{error:bt,notFoundMatches:xn,route:nn}=Bc(R.pathname);ot(R,{matches:xn,loaderData:{},errors:{[nn.id]:bt}},{flushSync:ze});return}if(C.initialized&&!q&&gL(C.location,R)&&!(B&&B.submission&&Yr(B.submission.formMethod))){ot(R,{matches:Me},{flushSync:ze});return}_=new AbortController;let Je=nl(e.history,R,_.signal,B&&B.submission),_e;if(B&&B.pendingError)_e=[Tl(Me).route.id,{type:Mt.error,error:B.pendingError}];else if(B&&B.submission&&Yr(B.submission.formMethod)){let bt=await ln(Je,R,B.submission,Me,pe.active,{replace:B.replace,flushSync:ze});if(bt.shortCircuited)return;if(bt.pendingActionResult){let[xn,nn]=bt.pendingActionResult;if(mr(nn)&&Xg(nn.error)&&nn.error.status===404){_=null,ot(R,{matches:bt.matches,loaderData:{},errors:{[xn]:nn.error}});return}}Me=bt.matches||Me,_e=bt.pendingActionResult,be=Lm(R,B.submission),ze=!1,pe.active=!1,Je=nl(e.history,Je.url,Je.signal)}let{shortCircuited:Oe,matches:Et,loaderData:St,errors:kt}=await M(Je,R,Me,pe.active,be,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,ze,_e);Oe||(_=null,ot(R,Kt({matches:Et||Me},_0(_e),{loaderData:St,errors:kt})))}async function ln(P,R,B,W,be,Me){Me===void 0&&(Me={}),hn();let ze=bL(R,B);if(ve({navigation:ze},{flushSync:Me.flushSync===!0}),be){let _e=await of(W,R.pathname,P.signal);if(_e.type==="aborted")return{shortCircuited:!0};if(_e.type==="error"){let{boundaryId:Oe,error:Et}=Zi(R.pathname,_e);return{matches:_e.partialMatches,pendingActionResult:[Oe,{type:Mt.error,error:Et}]}}else if(_e.matches)W=_e.matches;else{let{notFoundMatches:Oe,error:Et,route:St}=Bc(R.pathname);return{matches:Oe,pendingActionResult:[St.id,{type:Mt.error,error:Et}]}}}let pe,Je=mu(W,R);if(!Je.route.action&&!Je.route.lazy)pe={type:Mt.error,error:Hn(405,{method:P.method,pathname:R.pathname,routeId:Je.route.id})};else if(pe=(await rt("action",P,[Je],W))[0],P.signal.aborted)return{shortCircuited:!0};if(ri(pe)){let _e;return Me&&Me.replace!=null?_e=Me.replace:_e=j0(pe.response.headers.get("Location"),new URL(P.url),u)===C.location.pathname+C.location.search,await ke(P,pe,{submission:B,replace:_e}),{shortCircuited:!0}}if(ni(pe))throw Hn(400,{type:"defer-action"});if(mr(pe)){let _e=Tl(W,Je.route.id);return(Me&&Me.replace)!==!0&&(T=rn.Push),{matches:W,pendingActionResult:[_e.route.id,pe]}}return{matches:W,pendingActionResult:[Je.route.id,pe]}}async function M(P,R,B,W,be,Me,ze,pe,Je,_e,Oe){let Et=be||Lm(R,Me),St=Me||ze||I0(Et),kt=!Y&&(!p.v7_partialHydration||!Je);if(W){if(kt){let Jt=D(Oe);ve(Kt({navigation:Et},Jt!==void 0?{actionData:Jt}:{}),{flushSync:_e})}let Ze=await of(B,R.pathname,P.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){let{boundaryId:Jt,error:ur}=Zi(R.pathname,Ze);return{matches:Ze.partialMatches,loaderData:{},errors:{[Jt]:ur}}}else if(Ze.matches)B=Ze.matches;else{let{error:Jt,notFoundMatches:ur,route:Ft}=Bc(R.pathname);return{matches:ur,loaderData:{},errors:{[Ft.id]:Jt}}}}let bt=c||a,[xn,nn]=C0(e.history,C,B,St,R,p.v7_partialHydration&&Je===!0,p.v7_skipActionErrorRevalidation,q,Z,ee,ne,H,fe,bt,u,Oe);if(ws(Ze=>!(B&&B.some(Jt=>Jt.route.id===Ze))||xn&&xn.some(Jt=>Jt.route.id===Ze)),A=++L,xn.length===0&&nn.length===0){let Ze=He();return ot(R,Kt({matches:B,loaderData:{},errors:Oe&&mr(Oe[1])?{[Oe[0]]:Oe[1].error}:null},_0(Oe),Ze?{fetchers:new Map(C.fetchers)}:{}),{flushSync:_e}),{shortCircuited:!0}}if(kt){let Ze={};if(!W){Ze.navigation=Et;let Jt=D(Oe);Jt!==void 0&&(Ze.actionData=Jt)}nn.length>0&&(Ze.fetchers=V(nn)),ve(Ze,{flushSync:_e})}nn.forEach(Ze=>{J.has(Ze.key)&&zn(Ze.key),Ze.controller&&J.set(Ze.key,Ze.controller)});let Uc=()=>nn.forEach(Ze=>zn(Ze.key));_&&_.signal.addEventListener("abort",Uc);let{loaderResults:Do,fetcherResults:Yi}=await Pt(C.matches,B,xn,nn,P);if(P.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",Uc),nn.forEach(Ze=>J.delete(Ze.key));let Xi=R0([...Do,...Yi]);if(Xi){if(Xi.idx>=xn.length){let Ze=nn[Xi.idx-xn.length].key;fe.add(Ze)}return await ke(P,Xi.result,{replace:pe}),{shortCircuited:!0}}let{loaderData:el,errors:Ss}=M0(C,B,xn,Do,Oe,nn,Yi,le);le.forEach((Ze,Jt)=>{Ze.subscribe(ur=>{(ur||Ze.done)&&le.delete(Jt)})}),p.v7_partialHydration&&Je&&C.errors&&Object.entries(C.errors).filter(Ze=>{let[Jt]=Ze;return!xn.some(ur=>ur.route.id===Jt)}).forEach(Ze=>{let[Jt,ur]=Ze;Ss=Object.assign(Ss||{},{[Jt]:ur})});let af=He(),lf=Tt(A),cf=af||lf||nn.length>0;return Kt({matches:B,loaderData:el,errors:Ss},cf?{fetchers:new Map(C.fetchers)}:{})}function D(P){if(P&&!mr(P[1]))return{[P[0]]:P[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function V(P){return P.forEach(R=>{let B=C.fetchers.get(R.key),W=Yc(void 0,B?B.data:void 0);C.fetchers.set(R.key,W)}),new Map(C.fetchers)}function he(P,R,B,W){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");J.has(P)&&zn(P);let be=(W&&W.unstable_flushSync)===!0,Me=c||a,ze=Ay(C.location,C.matches,u,p.v7_prependBasename,B,p.v7_relativeSplatPath,R,W==null?void 0:W.relative),pe=Ya(Me,ze,u),Je=im(pe,Me,ze);if(Je.active&&Je.matches&&(pe=Je.matches),!pe){mn(P,R,Hn(404,{pathname:ze}),{flushSync:be});return}let{path:_e,submission:Oe,error:Et}=S0(p.v7_normalizeFormMethod,!0,ze,W);if(Et){mn(P,R,Et,{flushSync:be});return}let St=mu(pe,_e);if(j=(W&&W.preventScrollReset)===!0,Oe&&Yr(Oe.formMethod)){ce(P,R,_e,St,pe,Je.active,be,Oe);return}H.set(P,{routeId:R,path:_e}),ae(P,R,_e,St,pe,Je.active,be,Oe)}async function ce(P,R,B,W,be,Me,ze,pe){hn(),H.delete(P);function Je(Ft){if(!Ft.route.action&&!Ft.route.lazy){let Qs=Hn(405,{method:pe.formMethod,pathname:B,routeId:R});return mn(P,R,Qs,{flushSync:ze}),!0}return!1}if(!Me&&Je(W))return;let _e=C.fetchers.get(P);bn(P,xL(pe,_e),{flushSync:ze});let Oe=new AbortController,Et=nl(e.history,B,Oe.signal,pe);if(Me){let Ft=await of(be,B,Et.signal);if(Ft.type==="aborted")return;if(Ft.type==="error"){let{error:Qs}=Zi(B,Ft);mn(P,R,Qs,{flushSync:ze});return}else if(Ft.matches){if(be=Ft.matches,W=mu(be,B),Je(W))return}else{mn(P,R,Hn(404,{pathname:B}),{flushSync:ze});return}}J.set(P,Oe);let St=L,bt=(await rt("action",Et,[W],be))[0];if(Et.signal.aborted){J.get(P)===Oe&&J.delete(P);return}if(p.v7_fetcherPersist&&ne.has(P)){if(ri(bt)||mr(bt)){bn(P,Uo(void 0));return}}else{if(ri(bt))if(J.delete(P),A>St){bn(P,Uo(void 0));return}else return fe.add(P),bn(P,Yc(pe)),ke(Et,bt,{fetcherSubmission:pe});if(mr(bt)){mn(P,R,bt.error);return}}if(ni(bt))throw Hn(400,{type:"defer-action"});let xn=C.navigation.location||C.location,nn=nl(e.history,xn,Oe.signal),Uc=c||a,Do=C.navigation.state!=="idle"?Ya(Uc,C.navigation.location,u):C.matches;et(Do,"Didn't find any matches after fetcher action");let Yi=++L;X.set(P,Yi);let Xi=Yc(pe,bt.data);C.fetchers.set(P,Xi);let[el,Ss]=C0(e.history,C,Do,pe,xn,!1,p.v7_skipActionErrorRevalidation,q,Z,ee,ne,H,fe,Uc,u,[W.route.id,bt]);Ss.filter(Ft=>Ft.key!==P).forEach(Ft=>{let Qs=Ft.key,Zw=C.fetchers.get(Qs),rD=Yc(void 0,Zw?Zw.data:void 0);C.fetchers.set(Qs,rD),J.has(Qs)&&zn(Qs),Ft.controller&&J.set(Qs,Ft.controller)}),ve({fetchers:new Map(C.fetchers)});let af=()=>Ss.forEach(Ft=>zn(Ft.key));Oe.signal.addEventListener("abort",af);let{loaderResults:lf,fetcherResults:cf}=await Pt(C.matches,Do,el,Ss,nn);if(Oe.signal.aborted)return;Oe.signal.removeEventListener("abort",af),X.delete(P),J.delete(P),Ss.forEach(Ft=>J.delete(Ft.key));let Ze=R0([...lf,...cf]);if(Ze){if(Ze.idx>=el.length){let Ft=Ss[Ze.idx-el.length].key;fe.add(Ft)}return ke(nn,Ze.result)}let{loaderData:Jt,errors:ur}=M0(C,C.matches,el,lf,void 0,Ss,cf,le);if(C.fetchers.has(P)){let Ft=Uo(bt.data);C.fetchers.set(P,Ft)}Tt(Yi),C.navigation.state==="loading"&&Yi>A?(et(T,"Expected pending action"),_&&_.abort(),ot(C.navigation.location,{matches:Do,loaderData:Jt,errors:ur,fetchers:new Map(C.fetchers)})):(ve({errors:ur,loaderData:N0(C.loaderData,Jt,Do,ur),fetchers:new Map(C.fetchers)}),q=!1)}async function ae(P,R,B,W,be,Me,ze,pe){let Je=C.fetchers.get(P);bn(P,Yc(pe,Je?Je.data:void 0),{flushSync:ze});let _e=new AbortController,Oe=nl(e.history,B,_e.signal);if(Me){let bt=await of(be,B,Oe.signal);if(bt.type==="aborted")return;if(bt.type==="error"){let{error:xn}=Zi(B,bt);mn(P,R,xn,{flushSync:ze});return}else if(bt.matches)be=bt.matches,W=mu(be,B);else{mn(P,R,Hn(404,{pathname:B}),{flushSync:ze});return}}J.set(P,_e);let Et=L,kt=(await rt("loader",Oe,[W],be))[0];if(ni(kt)&&(kt=await ST(kt,Oe.signal,!0)||kt),J.get(P)===_e&&J.delete(P),!Oe.signal.aborted){if(ne.has(P)){bn(P,Uo(void 0));return}if(ri(kt))if(A>Et){bn(P,Uo(void 0));return}else{fe.add(P),await ke(Oe,kt);return}if(mr(kt)){mn(P,R,kt.error);return}et(!ni(kt),"Unhandled fetcher deferred data"),bn(P,Uo(kt.data))}}async function ke(P,R,B){let{submission:W,fetcherSubmission:be,replace:Me}=B===void 0?{}:B;R.response.headers.has("X-Remix-Revalidate")&&(q=!0);let ze=R.response.headers.get("Location");et(ze,"Expected a Location header on the redirect Response"),ze=j0(ze,new URL(P.url),u);let pe=od(C.location,ze,{_isRedirect:!0});if(n){let kt=!1;if(R.response.headers.has("X-Remix-Reload-Document"))kt=!0;else if(Rx.test(ze)){const bt=e.history.createURL(ze);kt=bt.origin!==t.location.origin||Cc(bt.pathname,u)==null}if(kt){Me?t.location.replace(ze):t.location.assign(ze);return}}_=null;let Je=Me===!0?rn.Replace:rn.Push,{formMethod:_e,formAction:Oe,formEncType:Et}=C.navigation;!W&&!be&&_e&&Oe&&Et&&(W=I0(C.navigation));let St=W||be;if(eL.has(R.response.status)&&St&&Yr(St.formMethod))await Xt(Je,pe,{submission:Kt({},St,{formAction:ze}),preventScrollReset:j});else{let kt=Lm(pe,W);await Xt(Je,pe,{overrideNavigation:kt,fetcherSubmission:be,preventScrollReset:j})}}async function rt(P,R,B,W){try{let be=await cL(i,P,R,B,W,o,s);return await Promise.all(be.map((Me,ze)=>{if(mL(Me)){let pe=Me.result;return{type:Mt.redirect,response:fL(pe,R,B[ze].route.id,W,u,p.v7_relativeSplatPath)}}return dL(Me)}))}catch(be){return B.map(()=>({type:Mt.error,error:be}))}}async function Pt(P,R,B,W,be){let[Me,...ze]=await Promise.all([B.length?rt("loader",be,B,R):[],...W.map(pe=>{if(pe.matches&&pe.match&&pe.controller){let Je=nl(e.history,pe.path,pe.controller.signal);return rt("loader",Je,[pe.match],pe.matches).then(_e=>_e[0])}else return Promise.resolve({type:Mt.error,error:Hn(404,{pathname:pe.path})})})]);return await Promise.all([O0(P,B,Me,Me.map(()=>be.signal),!1,C.loaderData),O0(P,W.map(pe=>pe.match),ze,W.map(pe=>pe.controller?pe.controller.signal:null),!0)]),{loaderResults:Me,fetcherResults:ze}}function hn(){q=!0,Z.push(...ws()),H.forEach((P,R)=>{J.has(R)&&(ee.push(R),zn(R))})}function bn(P,R,B){B===void 0&&(B={}),C.fetchers.set(P,R),ve({fetchers:new Map(C.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function mn(P,R,B,W){W===void 0&&(W={});let be=Tl(C.matches,R);bs(P),ve({errors:{[be.route.id]:B},fetchers:new Map(C.fetchers)},{flushSync:(W&&W.flushSync)===!0})}function Oo(P){return p.v7_fetcherPersist&&(se.set(P,(se.get(P)||0)+1),ne.has(P)&&ne.delete(P)),C.fetchers.get(P)||tL}function bs(P){let R=C.fetchers.get(P);J.has(P)&&!(R&&R.state==="loading"&&X.has(P))&&zn(P),H.delete(P),X.delete(P),fe.delete(P),ne.delete(P),C.fetchers.delete(P)}function qa(P){if(p.v7_fetcherPersist){let R=(se.get(P)||0)-1;R<=0?(se.delete(P),ne.add(P)):se.set(P,R)}else bs(P);ve({fetchers:new Map(C.fetchers)})}function zn(P){let R=J.get(P);et(R,"Expected fetch controller: "+P),R.abort(),J.delete(P)}function ue(P){for(let R of P){let B=Oo(R),W=Uo(B.data);C.fetchers.set(R,W)}}function He(){let P=[],R=!1;for(let B of fe){let W=C.fetchers.get(B);et(W,"Expected fetcher: "+B),W.state==="loading"&&(fe.delete(B),P.push(B),R=!0)}return ue(P),R}function Tt(P){let R=[];for(let[B,W]of X)if(W0}function vt(P,R){let B=C.blockers.get(P)||Zc;return oe.get(P)!==R&&oe.set(P,R),B}function _n(P){C.blockers.delete(P),oe.delete(P)}function xs(P,R){let B=C.blockers.get(P)||Zc;et(B.state==="unblocked"&&R.state==="blocked"||B.state==="blocked"&&R.state==="blocked"||B.state==="blocked"&&R.state==="proceeding"||B.state==="blocked"&&R.state==="unblocked"||B.state==="proceeding"&&R.state==="unblocked","Invalid blocker state transition: "+B.state+" -> "+R.state);let W=new Map(C.blockers);W.set(P,R),ve({blockers:W})}function Io(P){let{currentLocation:R,nextLocation:B,historyAction:W}=P;if(oe.size===0)return;oe.size>1&&dc(!1,"A router only supports one blocker at a time");let be=Array.from(oe.entries()),[Me,ze]=be[be.length-1],pe=C.blockers.get(Me);if(!(pe&&pe.state==="proceeding")&&ze({currentLocation:R,nextLocation:B,historyAction:W}))return Me}function Bc(P){let R=Hn(404,{pathname:P}),B=c||a,{matches:W,route:be}=P0(B);return ws(),{notFoundMatches:W,route:be,error:R}}function Zi(P,R){return{boundaryId:Tl(R.partialMatches).route.id,error:Hn(400,{type:"route-discovery",pathname:P,message:R.error!=null&&"message"in R.error?R.error:String(R.error)})}}function ws(P){let R=[];return le.forEach((B,W)=>{(!P||P(W))&&(B.cancel(),R.push(W),le.delete(W))}),R}function zc(P,R,B){if(h=P,x=R,m=B||null,!b&&C.navigation===Fm){b=!0;let W=Qw(C.location,C.matches);W!=null&&ve({restoreScrollPosition:W})}return()=>{h=null,x=null,m=null}}function Jw(P,R){return m&&m(P,R.map(W=>R2(W,C.loaderData)))||P.key}function eD(P,R){if(h&&x){let B=Jw(P,R);h[B]=x()}}function Qw(P,R){if(h){let B=Jw(P,R),W=h[B];if(typeof W=="number")return W}return null}function im(P,R,B){if(d)if(P){let W=P[P.length-1].route;if(W.path&&(W.path==="*"||W.path.endsWith("/*")))return{active:!0,matches:dp(R,B,u,!0)}}else return{active:!0,matches:dp(R,B,u,!0)||[]};return{active:!1,matches:null}}async function of(P,R,B){let W=P,be=W.length>0?W[W.length-1].route:null;for(;;){let Me=c==null,ze=c||a;try{await iL(d,R,W,ze,o,s,Q,B)}catch(Oe){return{type:"error",error:Oe,partialMatches:W}}finally{Me&&(a=[...a])}if(B.aborted)return{type:"aborted"};let pe=Ya(ze,R,u),Je=!1;if(pe){let Oe=pe[pe.length-1].route;if(Oe.index)return{type:"success",matches:pe};if(Oe.path&&Oe.path.length>0)if(Oe.path==="*")Je=!0;else return{type:"success",matches:pe}}let _e=dp(ze,R,u,!0);if(!_e||W.map(Oe=>Oe.route.id).join("-")===_e.map(Oe=>Oe.route.id).join("-"))return{type:"success",matches:Je?pe:null};if(W=_e,be=W[W.length-1].route,be.path==="*")return{type:"success",matches:W}}}function tD(P){o={},c=ad(P,s,void 0,o)}function nD(P,R){let B=c==null;bT(P,R,c||a,o,s),B&&(a=[...a],ve({}))}return E={get basename(){return u},get future(){return p},get state(){return C},get routes(){return a},get window(){return t},initialize:Pe,subscribe:Re,enableScrollRestoration:zc,navigate:Vt,fetch:he,revalidate:tn,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:Oo,deleteFetcher:qa,dispose:Be,getBlocker:vt,deleteBlocker:_n,patchRoutes:nD,_internalFetchControllers:J,_internalActiveDeferreds:le,_internalSetRoutes:tD},E}function sL(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ay(e,t,n,r,s,o,a,c){let u,i;if(a){u=[];for(let p of t)if(u.push(p),p.route.id===a){i=p;break}}else u=t,i=t[t.length-1];let d=Yg(s||".",Zg(u,o),Cc(e.pathname,n)||e.pathname,c==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&i&&i.route.index&&!Ox(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:ho([n,d.pathname])),Pi(d)}function S0(e,t,n,r){if(!r||!sL(r))return{path:n};if(r.formMethod&&!yL(r.formMethod))return{path:n,error:Hn(405,{method:r.formMethod})};let s=()=>({path:n,error:Hn(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),c=xT(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Yr(a))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,h)=>{let[m,x]=h;return""+g+m+"="+x+` -`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Yr(a))return s();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return s()}}}et(typeof FormData=="function","FormData is not available in this environment");let u,i;if(r.formData)u=Fy(r.formData),i=r.formData;else if(r.body instanceof FormData)u=Fy(r.body),i=r.body;else if(r.body instanceof URLSearchParams)u=r.body,i=T0(u);else if(r.body==null)u=new URLSearchParams,i=new FormData;else try{u=new URLSearchParams(r.body),i=T0(u)}catch{return s()}let d={formMethod:a,formAction:c,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Yr(d.formMethod))return{path:n,submission:d};let p=Ra(n);return t&&p.search&&Ox(p.search)&&u.append("index",""),p.search="?"+u,{path:Pi(p),submission:d}}function oL(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function C0(e,t,n,r,s,o,a,c,u,i,d,p,f,g,h,m){let x=m?mr(m[1])?m[1].error:m[1].data:void 0,b=e.createURL(t.location),y=e.createURL(s),w=m&&mr(m[1])?m[0]:void 0,S=w?oL(n,w):n,E=m?m[1].statusCode:void 0,C=a&&E&&E>=400,T=S.filter((_,O)=>{let{route:K}=_;if(K.lazy)return!0;if(K.loader==null)return!1;if(o)return typeof K.loader!="function"||K.loader.hydrate?!0:t.loaderData[K.id]===void 0&&(!t.errors||t.errors[K.id]===void 0);if(aL(t.loaderData,t.matches[O],_)||u.some(q=>q===_.route.id))return!0;let I=t.matches[O],Y=_;return E0(_,Kt({currentUrl:b,currentParams:I.params,nextUrl:y,nextParams:Y.params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:C?!1:c||b.pathname+b.search===y.pathname+y.search||b.search!==y.search||yT(I,Y)}))}),j=[];return p.forEach((_,O)=>{if(o||!n.some(Z=>Z.route.id===_.routeId)||d.has(O))return;let K=Ya(g,_.path,h);if(!K){j.push({key:O,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(O),Y=mu(K,_.path),q=!1;f.has(O)?q=!1:i.includes(O)?q=!0:I&&I.state!=="idle"&&I.data===void 0?q=c:q=E0(Y,Kt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:C?!1:c})),q&&j.push({key:O,routeId:_.routeId,path:_.path,matches:K,match:Y,controller:new AbortController})}),[T,j]}function aL(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function yT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function E0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function iL(e,t,n,r,s,o,a,c){let u=[t,...n.map(i=>i.route.id)].join("-");try{let i=a.get(u);i||(i=e({path:t,matches:n,patch:(d,p)=>{c.aborted||bT(d,p,r,s,o)}}),a.set(u,i)),i&&hL(i)&&await i}finally{a.delete(u)}}function bT(e,t,n,r,s){if(e){var o;let a=r[e];et(a,"No route found to patch children into: routeId = "+e);let c=ad(t,s,[e,"patch",String(((o=a.children)==null?void 0:o.length)||"0")],r);a.children?a.children.push(...c):a.children=c}else{let a=ad(t,s,["patch",String(n.length||"0")],r);n.push(...a)}}async function k0(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];et(s,"No route found in manifest");let o={};for(let a in r){let u=s[a]!==void 0&&a!=="hasErrorBoundary";dc(!u,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!_2.has(a)&&(o[a]=r[a])}Object.assign(s,o),Object.assign(s,Kt({},t(s),{lazy:void 0}))}function lL(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function cL(e,t,n,r,s,o,a,c){let u=r.reduce((p,f)=>p.add(f.route.id),new Set),i=new Set,d=await e({matches:s.map(p=>{let f=u.has(p.route.id);return Kt({},p,{shouldLoad:f,resolve:h=>(i.add(p.route.id),f?uL(t,n,p,o,a,h,c):Promise.resolve({type:Mt.data,result:void 0}))})}),request:n,params:s[0].params,context:c});return s.forEach(p=>et(i.has(p.route.id),'`match.resolve()` was not called for route id "'+p.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((p,f)=>u.has(s[f].route.id))}async function uL(e,t,n,r,s,o,a){let c,u,i=d=>{let p,f=new Promise((m,x)=>p=x);u=()=>p(),t.signal.addEventListener("abort",u);let g=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:a},...m!==void 0?[m]:[]),h;return o?h=o(m=>g(m)):h=(async()=>{try{return{type:"data",result:await g()}}catch(m){return{type:"error",result:m}}})(),Promise.race([h,f])};try{let d=n.route[e];if(n.route.lazy)if(d){let p,[f]=await Promise.all([i(d).catch(g=>{p=g}),k0(n.route,s,r)]);if(p!==void 0)throw p;c=f}else if(await k0(n.route,s,r),d=n.route[e],d)c=await i(d);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Hn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:Mt.data,result:void 0};else if(d)c=await i(d);else{let p=new URL(t.url),f=p.pathname+p.search;throw Hn(404,{pathname:f})}et(c.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:Mt.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function dL(e){let{result:t,type:n,status:r}=e;if(wT(t)){let a;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(c){return{type:Mt.error,error:c}}return n===Mt.error?{type:Mt.error,error:new Px(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:Mt.data,data:a,statusCode:t.status,headers:t.headers}}if(n===Mt.error)return{type:Mt.error,error:t,statusCode:Xg(t)?t.status:r};if(vL(t)){var s,o;return{type:Mt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:Mt.data,data:t,statusCode:r}}function fL(e,t,n,r,s,o){let a=e.headers.get("Location");if(et(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Rx.test(a)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=Ay(new URL(t.url),c,s,!0,a,o),e.headers.set("Location",a)}return e}function j0(e,t,n){if(Rx.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Cc(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function nl(e,t,n,r){let s=e.createURL(xT(t)).toString(),o={signal:n};if(r&&Yr(r.formMethod)){let{formMethod:a,formEncType:c}=r;o.method=a.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=Fy(r.formData):o.body=r.formData}return new Request(s,o)}function Fy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function T0(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function pL(e,t,n,r,s,o){let a={},c=null,u,i=!1,d={},p=r&&mr(r[1])?r[1].error:void 0;return n.forEach((f,g)=>{let h=t[g].route.id;if(et(!ri(f),"Cannot handle redirect results in processLoaderData"),mr(f)){let m=f.error;p!==void 0&&(m=p,p=void 0),c=c||{};{let x=Tl(e,h);c[x.route.id]==null&&(c[x.route.id]=m)}a[h]=void 0,i||(i=!0,u=Xg(f.error)?f.error.status:500),f.headers&&(d[h]=f.headers)}else ni(f)?(s.set(h,f.deferredData),a[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!i&&(u=f.statusCode),f.headers&&(d[h]=f.headers)):(a[h]=f.data,f.statusCode&&f.statusCode!==200&&!i&&(u=f.statusCode),f.headers&&(d[h]=f.headers))}),p!==void 0&&r&&(c={[r[0]]:p},a[r[0]]=void 0),{loaderData:a,errors:c,statusCode:u||200,loaderHeaders:d}}function M0(e,t,n,r,s,o,a,c){let{loaderData:u,errors:i}=pL(t,n,r,s,c);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function P0(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Hn(e,t){let{pathname:n,routeId:r,method:s,type:o,message:a}=t===void 0?{}:t,c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",o==="route-discovery"?u='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: -`+a):s&&n&&r?u="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(c="Not Found",u='No route matches URL "'+n+'"'):e===405&&(c="Method Not Allowed",s&&n&&r?u="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(u='Invalid request method "'+s.toUpperCase()+'"')),new Px(e||500,c,new Error(u),!0)}function R0(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ri(n))return{result:n,idx:t}}}function xT(e){let t=typeof e=="string"?Ra(e):e;return Pi(Kt({},t,{hash:""}))}function gL(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hL(e){return typeof e=="object"&&e!=null&&"then"in e}function mL(e){return wT(e.result)&&X2.has(e.result.status)}function ni(e){return e.type===Mt.deferred}function mr(e){return e.type===Mt.error}function ri(e){return(e&&e.type)===Mt.redirect}function vL(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function wT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function yL(e){return Y2.has(e.toLowerCase())}function Yr(e){return Q2.has(e.toLowerCase())}async function O0(e,t,n,r,s,o){for(let a=0;ap.route.id===u.route.id),d=i!=null&&!yT(i,u)&&(o&&o[u.route.id])!==void 0;if(ni(c)&&(s||d)){let p=r[a];et(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await ST(c,p,s).then(f=>{f&&(n[a]=f||n[a])})}}}async function ST(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Mt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:Mt.error,error:s}}return{type:Mt.data,data:e.deferredData.data}}}function Ox(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function mu(e,t){let n=typeof t=="string"?Ra(t).search:t.search;if(e[e.length-1].route.index&&Ox(n||""))return e[e.length-1];let r=hT(e);return r[r.length-1]}function I0(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:a}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Lm(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bL(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Yc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function xL(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Uo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function wL(e,t){try{let n=e.sessionStorage.getItem(vT);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function SL(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(vT,JSON.stringify(n))}catch(r){dc(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.25.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{c.current=!0}),v.useCallback(function(i,d){if(d===void 0&&(d={}),!c.current)return;if(typeof i=="number"){r.go(i);return}let p=Yg(i,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ho([t,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[t,r,a,o,e])}function gs(){let{matches:e}=v.useContext(jo),t=e[e.length-1];return t?t.params:{}}function jT(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Oa),{matches:s}=v.useContext(jo),{pathname:o}=kc(),a=JSON.stringify(Zg(s,r.v7_relativeSplatPath));return v.useMemo(()=>Yg(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function kL(e,t,n,r){Ec()||et(!1);let{navigator:s}=v.useContext(Oa),{matches:o}=v.useContext(jo),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let i=kc(),d;d=i;let p=d.pathname||"/",f=p;if(u!=="/"){let m=u.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=Ya(e,{pathname:f});return _L(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},c,m.params),pathname:ho([u,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?u:ho([u,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n,r)}function jL(){let e=IL(),t=Xg(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:s},n):null,null)}const TL=v.createElement(jL,null);class ML extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(jo.Provider,{value:this.props.routeContext},v.createElement(ET.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function NL(e){let{routeContext:t,match:n,children:r}=e,s=v.useContext(eh);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(jo.Provider,{value:t},r)}function _L(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let a=e,c=(s=n)==null?void 0:s.errors;if(c!=null){let d=a.findIndex(p=>p.route.id&&(c==null?void 0:c[p.route.id])!==void 0);d>=0||et(!1),a=a.slice(0,Math.min(a.length,d+1))}let u=!1,i=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,i+1):a=[a[0]];break}}}return a.reduceRight((d,p,f)=>{let g,h=!1,m=null,x=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,m=p.route.errorElement||TL,u&&(i<0&&f===0?(AL("route-fallback"),h=!0,x=null):i===f&&(h=!0,x=p.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,f+1)),y=()=>{let w;return g?w=m:h?w=x:p.route.Component?w=v.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=d,v.createElement(NL,{match:p,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||f===0)?v.createElement(ML,{location:n.location,revalidation:n.revalidation,component:m,error:g,children:y(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):y()},null)}var TT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(TT||{}),Xp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Xp||{});function PL(e){let t=v.useContext(eh);return t||et(!1),t}function RL(e){let t=v.useContext(CT);return t||et(!1),t}function OL(e){let t=v.useContext(jo);return t||et(!1),t}function MT(e){let t=OL(),n=t.matches[t.matches.length-1];return n.route.id||et(!1),n.route.id}function IL(){var e;let t=v.useContext(ET),n=RL(Xp.UseRouteError),r=MT(Xp.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function DL(){let{router:e}=PL(TT.UseNavigateStable),t=MT(Xp.UseNavigateStable),n=v.useRef(!1);return kT(()=>{n.current=!0}),v.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Yp({fromRouteId:t},o)))},[e,t])}const D0={};function AL(e,t,n){D0[e]||(D0[e]=!0)}function NT(e){let{to:t,replace:n,state:r,relative:s}=e;Ec()||et(!1);let{future:o,static:a}=v.useContext(Oa),{matches:c}=v.useContext(jo),{pathname:u}=kc(),i=an(),d=Yg(t,Zg(c,o.v7_relativeSplatPath),u,s==="path"),p=JSON.stringify(d);return v.useEffect(()=>i(JSON.parse(p),{replace:n,state:r,relative:s}),[i,p,s,n,r]),null}function FL(e){let{basename:t="/",children:n=null,location:r,navigationType:s=rn.Pop,navigator:o,static:a=!1,future:c}=e;Ec()&&et(!1);let u=t.replace(/^\/*/,"/"),i=v.useMemo(()=>({basename:u,navigator:o,static:a,future:Yp({v7_relativeSplatPath:!1},c)}),[u,c,o,a]);typeof r=="string"&&(r=Ra(r));let{pathname:d="/",search:p="",hash:f="",state:g=null,key:h="default"}=r,m=v.useMemo(()=>{let x=Cc(d,u);return x==null?null:{location:{pathname:x,search:p,hash:f,state:g,key:h},navigationType:s}},[u,d,p,f,g,h,s]);return m==null?null:v.createElement(Oa.Provider,{value:i},v.createElement(Ix.Provider,{children:n,value:m}))}new Promise(()=>{});function LL(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.25.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function BL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zL(e,t){return e.button===0&&(!t||t==="_self")&&!BL(e)}const UL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],VL="6";try{window.__reactRouterVersion=VL}catch{}function HL(e,t){return rL({basename:void 0,future:id({},void 0,{v7_prependBasename:!0}),history:T2({window:void 0}),hydrationData:KL(),routes:e,mapRouteProperties:LL,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function KL(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=id({},t,{errors:qL(t.errors)})),t}function qL(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Px(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let a=new o(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}const WL=v.createContext({isTransitioning:!1}),GL=v.createContext(new Map),JL="startTransition",A0=Dg[JL],QL="flushSync",F0=u2[QL];function ZL(e){A0?A0(e):e()}function Xc(e){F0?F0(e):e()}class YL{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function XL(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=v.useState(n.state),[a,c]=v.useState(),[u,i]=v.useState({isTransitioning:!1}),[d,p]=v.useState(),[f,g]=v.useState(),[h,m]=v.useState(),x=v.useRef(new Map),{v7_startTransition:b}=r||{},y=v.useCallback(j=>{b?ZL(j):j()},[b]),w=v.useCallback((j,_)=>{let{deletedFetchers:O,unstable_flushSync:K,unstable_viewTransitionOpts:I}=_;O.forEach(q=>x.current.delete(q)),j.fetchers.forEach((q,Z)=>{q.data!==void 0&&x.current.set(Z,q.data)});let Y=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!I||Y){K?Xc(()=>o(j)):y(()=>o(j));return}if(K){Xc(()=>{f&&(d&&d.resolve(),f.skipTransition()),i({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let q=n.window.document.startViewTransition(()=>{Xc(()=>o(j))});q.finished.finally(()=>{Xc(()=>{p(void 0),g(void 0),c(void 0),i({isTransitioning:!1})})}),Xc(()=>g(q));return}f?(d&&d.resolve(),f.skipTransition(),m({state:j,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(c(j),i({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[n.window,f,d,x,y]);v.useLayoutEffect(()=>n.subscribe(w),[n,w]),v.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new YL)},[u]),v.useEffect(()=>{if(d&&a&&n.window){let j=a,_=d.promise,O=n.window.document.startViewTransition(async()=>{y(()=>o(j)),await _});O.finished.finally(()=>{p(void 0),g(void 0),c(void 0),i({isTransitioning:!1})}),g(O)}},[y,a,d,n.window]),v.useEffect(()=>{d&&a&&s.location.key===a.location.key&&d.resolve()},[d,f,s.location,a]),v.useEffect(()=>{!u.isTransitioning&&h&&(c(h.state),i({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),m(void 0))},[u.isTransitioning,h]),v.useEffect(()=>{},[]);let S=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,_,O)=>n.navigate(j,{state:_,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(j,_,O)=>n.navigate(j,{replace:!0,state:_,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),E=n.basename||"/",C=v.useMemo(()=>({router:n,navigator:S,static:!1,basename:E}),[n,S,E]),T=v.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return v.createElement(v.Fragment,null,v.createElement(eh.Provider,{value:C},v.createElement(CT.Provider,{value:s},v.createElement(GL.Provider,{value:x.current},v.createElement(WL.Provider,{value:u},v.createElement(FL,{basename:E,location:s.location,navigationType:s.historyAction,navigator:S,future:T},s.initialized||n.future.v7_partialHydration?v.createElement(e$,{routes:n.routes,future:n.future,state:s}):t))))),null)}const e$=v.memo(t$);function t$(e){let{routes:t,future:n,state:r}=e;return kL(t,void 0,r,n)}const n$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",r$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ld=v.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:a,state:c,target:u,to:i,preventScrollReset:d,unstable_viewTransition:p}=t,f=$L(t,UL),{basename:g}=v.useContext(Oa),h,m=!1;if(typeof i=="string"&&r$.test(i)&&(h=i,n$))try{let w=new URL(window.location.href),S=i.startsWith("//")?new URL(w.protocol+i):new URL(i),E=Cc(S.pathname,g);S.origin===w.origin&&E!=null?i=E+S.search+S.hash:m=!0}catch{}let x=CL(i,{relative:s}),b=s$(i,{replace:a,state:c,target:u,preventScrollReset:d,relative:s,unstable_viewTransition:p});function y(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",id({},f,{href:h||x,onClick:m||o?r:y,ref:n,target:u}))});var L0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(L0||(L0={}));var $0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($0||($0={}));function s$(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:a,unstable_viewTransition:c}=t===void 0?{}:t,u=an(),i=kc(),d=jT(e,{relative:a});return v.useCallback(p=>{if(zL(p,n)){p.preventDefault();let f=r!==void 0?r:Pi(i)===Pi(d);u(e,{replace:f,state:s,preventScrollReset:o,relative:a,unstable_viewTransition:c})}},[i,u,d,r,s,n,e,o,a,c])}function _T(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),xi=e=>typeof e=="string",br=e=>typeof e=="function",fp=e=>xi(e)||br(e)?e:null,Ly=e=>v.isValidElement(e)||xi(e)||br(e)||cd(e);function o$(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function th(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(a){let{children:c,position:u,preventExitTransition:i,done:d,nodeRef:p,isIn:f,playToast:g}=a;const h=r?`${t}--${u}`:t,m=r?`${n}--${u}`:n,x=v.useRef(0);return v.useLayoutEffect(()=>{const b=p.current,y=h.split(" "),w=S=>{S.target===p.current&&(g(),b.removeEventListener("animationend",w),b.removeEventListener("animationcancel",w),x.current===0&&S.type!=="animationcancel"&&b.classList.remove(...y))};b.classList.add(...y),b.addEventListener("animationend",w),b.addEventListener("animationcancel",w)},[]),v.useEffect(()=>{const b=p.current,y=()=>{b.removeEventListener("animationend",y),s?o$(b,d,o):d()};f||(i?y():(x.current=1,b.className+=` ${m}`,b.addEventListener("animationend",y)))},[f]),je.createElement(je.Fragment,null,c)}}function B0(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Wn=new Map;let ud=[];const $y=new Set,a$=e=>$y.forEach(t=>t(e)),PT=()=>Wn.size>0;function RT(e,t){var n;if(t)return!((n=Wn.get(t))==null||!n.isToastActive(e));let r=!1;return Wn.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function OT(e,t){Ly(e)&&(PT()||ud.push({content:e,options:t}),Wn.forEach(n=>{n.buildToast(e,t)}))}function z0(e,t){Wn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function i$(e){const{subscribe:t,getSnapshot:n,setProps:r}=v.useRef(function(o){const a=o.containerId||1;return{subscribe(c){const u=function(d,p,f){let g=1,h=0,m=[],x=[],b=[],y=p;const w=new Map,S=new Set,E=()=>{b=Array.from(w.values()),S.forEach(j=>j())},C=j=>{x=j==null?[]:x.filter(_=>_!==j),E()},T=j=>{const{toastId:_,onOpen:O,updateId:K,children:I}=j.props,Y=K==null;j.staleId&&w.delete(j.staleId),w.set(_,j),x=[...x,j.props.toastId].filter(q=>q!==j.staleId),E(),f(B0(j,Y?"added":"updated")),Y&&br(O)&&O(v.isValidElement(I)&&I.props)};return{id:d,props:y,observe:j=>(S.add(j),()=>S.delete(j)),toggle:(j,_)=>{w.forEach(O=>{_!=null&&_!==O.props.toastId||br(O.toggle)&&O.toggle(j)})},removeToast:C,toasts:w,clearQueue:()=>{h-=m.length,m=[]},buildToast:(j,_)=>{if((H=>{let{containerId:se,toastId:ne,updateId:le}=H;const oe=se?se!==d:d!==1,Q=w.has(ne)&&le==null;return oe||Q})(_))return;const{toastId:O,updateId:K,data:I,staleId:Y,delay:q}=_,Z=()=>{C(O)},ee=K==null;ee&&h++;const J={...y,style:y.toastStyle,key:g++,...Object.fromEntries(Object.entries(_).filter(H=>{let[se,ne]=H;return ne!=null})),toastId:O,updateId:K,data:I,closeToast:Z,isIn:!1,className:fp(_.className||y.toastClassName),bodyClassName:fp(_.bodyClassName||y.bodyClassName),progressClassName:fp(_.progressClassName||y.progressClassName),autoClose:!_.isLoading&&(L=_.autoClose,A=y.autoClose,L===!1||cd(L)&&L>0?L:A),deleteToast(){const H=w.get(O),{onClose:se,children:ne}=H.props;br(se)&&se(v.isValidElement(ne)&&ne.props),f(B0(H,"removed")),w.delete(O),h--,h<0&&(h=0),m.length>0?T(m.shift()):E()}};var L,A;J.closeButton=y.closeButton,_.closeButton===!1||Ly(_.closeButton)?J.closeButton=_.closeButton:_.closeButton===!0&&(J.closeButton=!Ly(y.closeButton)||y.closeButton);let X=j;v.isValidElement(j)&&!xi(j.type)?X=v.cloneElement(j,{closeToast:Z,toastProps:J,data:I}):br(j)&&(X=j({closeToast:Z,toastProps:J,data:I}));const fe={content:X,props:J,staleId:Y};y.limit&&y.limit>0&&h>y.limit&&ee?m.push(fe):cd(q)?setTimeout(()=>{T(fe)},q):T(fe)},setProps(j){y=j},setToggle:(j,_)=>{w.get(j).toggle=_},isToastActive:j=>x.some(_=>_===j),getSnapshot:()=>y.newestOnTop?b.reverse():b}}(a,o,a$);Wn.set(a,u);const i=u.observe(c);return ud.forEach(d=>OT(d.content,d.options)),ud=[],()=>{i(),Wn.delete(a)}},setProps(c){var u;(u=Wn.get(a))==null||u.setProps(c)},getSnapshot(){var c;return(c=Wn.get(a))==null?void 0:c.getSnapshot()}}}(e)).current;r(e);const s=v.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!s)return[];const a=new Map;return s.forEach(c=>{const{position:u}=c.props;a.has(u)||a.set(u,[]),a.get(u).push(c)}),Array.from(a,c=>o(c[0],c[1]))},isToastActive:RT,count:s==null?void 0:s.length}}function l$(e){const[t,n]=v.useState(!1),[r,s]=v.useState(!1),o=v.useRef(null),a=v.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:u,closeToast:i,onClick:d,closeOnClick:p}=e;var f,g;function h(){n(!0)}function m(){n(!1)}function x(w){const S=o.current;a.canDrag&&S&&(a.didMove=!0,t&&m(),a.delta=e.draggableDirection==="x"?w.clientX-a.start:w.clientY-a.start,a.start!==w.clientX&&(a.canCloseOnClick=!1),S.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,S.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",b);const w=o.current;if(a.canDrag&&a.didMove&&w){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();w.style.transition="transform 0.2s, opacity 0.2s",w.style.removeProperty("transform"),w.style.removeProperty("opacity")}}(g=Wn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||g.setToggle(f.id,f.fn),v.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",h),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const y={onPointerDown:function(w){if(e.draggable===!0||e.draggable===w.pointerType){a.didMove=!1,document.addEventListener("pointermove",x),document.addEventListener("pointerup",b);const S=o.current;a.canCloseOnClick=!0,a.canDrag=!0,S.style.transition="none",e.draggableDirection==="x"?(a.start=w.clientX,a.removalDistance=S.offsetWidth*(e.draggablePercent/100)):(a.start=w.clientY,a.removalDistance=S.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(w){const{top:S,bottom:E,left:C,right:T}=o.current.getBoundingClientRect();w.nativeEvent.type!=="touchend"&&e.pauseOnHover&&w.clientX>=C&&w.clientX<=T&&w.clientY>=S&&w.clientY<=E?m():h()}};return c&&u&&(y.onMouseEnter=m,e.stacked||(y.onMouseLeave=h)),p&&(y.onClick=w=>{d&&d(w),a.canCloseOnClick&&i()}),{playToast:h,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:y}}function c$(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:o,className:a,style:c,controlledProgress:u,progress:i,rtl:d,isIn:p,theme:f}=e;const g=o||u&&i===0,h={...c,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};u&&(h.transform=`scaleX(${i})`);const m=uo("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":d}),x=br(a)?a({rtl:d,type:s,defaultClassName:m}):uo(m,a),b={[u&&i>=1?"onTransitionEnd":"onAnimationEnd"]:u&&i<1?null:()=>{p&&r()}};return je.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},je.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${s}`}),je.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:x,style:h,...b}))}let u$=1;const IT=()=>""+u$++;function d$(e){return e&&(xi(e.toastId)||cd(e.toastId))?e.toastId:IT()}function Ou(e,t){return OT(e,t),t.toastId}function eg(e,t){return{...t,type:t&&t.type||e,toastId:d$(t)}}function Nf(e){return(t,n)=>Ou(t,eg(e,n))}function G(e,t){return Ou(e,eg("default",t))}G.loading=(e,t)=>Ou(e,eg("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),G.promise=function(e,t,n){let r,{pending:s,error:o,success:a}=t;s&&(r=xi(s)?G.loading(s,n):G.loading(s.render,{...n,...s}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(d,p,f)=>{if(p==null)return void G.dismiss(r);const g={type:d,...c,...n,data:f},h=xi(p)?{render:p}:p;return r?G.update(r,{...g,...h}):G(h.render,{...g,...h}),f},i=br(e)?e():e;return i.then(d=>u("success",a,d)).catch(d=>u("error",o,d)),i},G.success=Nf("success"),G.info=Nf("info"),G.error=Nf("error"),G.warning=Nf("warning"),G.warn=G.warning,G.dark=(e,t)=>Ou(e,eg("default",{theme:"dark",...t})),G.dismiss=function(e){(function(t){var n;if(PT()){if(t==null||xi(n=t)||cd(n))Wn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Wn.get(t.containerId);r?r.removeToast(t.id):Wn.forEach(s=>{s.removeToast(t.id)})}}else ud=ud.filter(r=>t!=null&&r.options.toastId!==t)})(e)},G.clearWaitingQueue=function(e){e===void 0&&(e={}),Wn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},G.isActive=RT,G.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var o;let{containerId:a}=s;return(o=Wn.get(a||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:IT()};o.toastId!==e&&(o.staleId=e);const a=o.render||s;delete o.render,Ou(a,o)}},G.done=e=>{G.update(e,{progress:1})},G.onChange=function(e){return $y.add(e),()=>{$y.delete(e)}},G.play=e=>z0(!0,e),G.pause=e=>z0(!1,e);const f$=typeof window<"u"?v.useLayoutEffect:v.useEffect,_f=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return je.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},$m={info:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return je.createElement("div",{className:"Toastify__spinner"})}},p$=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:o}=l$(e),{closeButton:a,children:c,autoClose:u,onClick:i,type:d,hideProgressBar:p,closeToast:f,transition:g,position:h,className:m,style:x,bodyClassName:b,bodyStyle:y,progressClassName:w,progressStyle:S,updateId:E,role:C,progress:T,rtl:j,toastId:_,deleteToast:O,isIn:K,isLoading:I,closeOnClick:Y,theme:q}=e,Z=uo("Toastify__toast",`Toastify__toast-theme--${q}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":j},{"Toastify__toast--close-on-click":Y}),ee=br(m)?m({rtl:j,position:h,type:d,defaultClassName:Z}):uo(Z,m),J=function(fe){let{theme:H,type:se,isLoading:ne,icon:le}=fe,oe=null;const Q={theme:H,type:se};return le===!1||(br(le)?oe=le({...Q,isLoading:ne}):v.isValidElement(le)?oe=v.cloneElement(le,Q):ne?oe=$m.spinner():(Ee=>Ee in $m)(se)&&(oe=$m[se](Q))),oe}(e),L=!!T||!u,A={closeToast:f,type:d,theme:q};let X=null;return a===!1||(X=br(a)?a(A):v.isValidElement(a)?v.cloneElement(a,A):function(fe){let{closeToast:H,theme:se,ariaLabel:ne="close"}=fe;return je.createElement("button",{className:`Toastify__close-button Toastify__close-button--${se}`,type:"button",onClick:le=>{le.stopPropagation(),H(le)},"aria-label":ne},je.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},je.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(A)),je.createElement(g,{isIn:K,done:O,position:h,preventExitTransition:n,nodeRef:r,playToast:o},je.createElement("div",{id:_,onClick:i,"data-in":K,className:ee,...s,style:x,ref:r},je.createElement("div",{...K&&{role:C},className:br(b)?b({type:d}):uo("Toastify__toast-body",b),style:y},J!=null&&je.createElement("div",{className:uo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},J),je.createElement("div",null,c)),X,je.createElement(c$,{...E&&!L?{key:`pb-${E}`}:{},rtl:j,theme:q,delay:u,isRunning:t,isIn:K,closeToast:f,hide:p,type:d,style:S,className:w,controlledProgress:L,progress:T||0})))},nh=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},g$=th(nh("bounce",!0));th(nh("slide",!0));th(nh("zoom"));th(nh("flip"));const h$={position:"top-right",transition:g$,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function m$(e){let t={...h$,...e};const n=e.stacked,[r,s]=v.useState(!0),o=v.useRef(null),{getToastToRender:a,isToastActive:c,count:u}=i$(t),{className:i,style:d,rtl:p,containerId:f}=t;function g(m){const x=uo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":p});return br(i)?i({position:m,rtl:p,defaultClassName:x}):uo(x,fp(i))}function h(){n&&(s(!0),G.play())}return f$(()=>{if(n){var m;const x=o.current.querySelectorAll('[data-in="true"]'),b=12,y=(m=t.position)==null?void 0:m.includes("top");let w=0,S=0;Array.from(x).reverse().forEach((E,C)=>{const T=E;T.classList.add("Toastify__toast--stacked"),C>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=y?"top":"bot");const j=w*(r?.2:1)+(r?0:b*C);T.style.setProperty("--y",`${y?j:-1*j}px`),T.style.setProperty("--g",`${b}`),T.style.setProperty("--s",""+(1-(r?S:0))),w+=T.offsetHeight,S+=.025})}},[r,u,n]),je.createElement("div",{ref:o,className:"Toastify",id:f,onMouseEnter:()=>{n&&(s(!1),G.pause())},onMouseLeave:h},a((m,x)=>{const b=x.length?{...d}:{...d,pointerEvents:"none"};return je.createElement("div",{className:g(m),style:b,key:`container-${m}`},x.map(y=>{let{content:w,props:S}=y;return je.createElement(p$,{...S,stacked:n,collapseAll:h,isIn:c(S.toastId,S.containerId),style:S.style,key:`toast-${S.key}`},w)}))}))}const v$={theme:"system",setTheme:()=>null},DT=v.createContext(v$);function y$({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,o]=v.useState(()=>localStorage.getItem(n)||t);v.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),s==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(s)},[s]);const a={theme:s,setTheme:c=>{localStorage.setItem(n,c),o(c)}};return l.jsx(DT.Provider,{...r,value:a,children:e})}const Dx=()=>{const e=v.useContext(DT);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};let Bm=!1;const b$=new zD({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e){return e>=3?(Bm===!1&&(Bm=!0,G.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{Bm=!1}})),!1):!0}}}});var Fn=(e=>(e.API_URL="apiUrl",e.TOKEN="token",e.INSTANCE_ID="instanceId",e.INSTANCE_NAME="instanceName",e.INSTANCE_TOKEN="instanceToken",e.VERSION="version",e.FACEBOOK_APP_ID="facebookAppId",e.FACEBOOK_CONFIG_ID="facebookConfigId",e.FACEBOOK_USER_TOKEN="facebookUserToken",e.CLIENT_NAME="clientName",e))(Fn||{});const AT=async e=>{if(e.url){const t=e.url.endsWith("/")?e.url.slice(0,-1):e.url;localStorage.setItem("apiUrl",t)}e.token&&localStorage.setItem("token",e.token),e.version&&localStorage.setItem("version",e.version),e.facebookAppId&&localStorage.setItem("facebookAppId",e.facebookAppId),e.facebookConfigId&&localStorage.setItem("facebookConfigId",e.facebookConfigId),e.facebookUserToken&&localStorage.setItem("facebookUserToken",e.facebookUserToken),e.clientName&&localStorage.setItem("clientName",e.clientName)},FT=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName")},zr=e=>localStorage.getItem(e),Rt=({children:e})=>{const t=zr(Fn.API_URL),n=zr(Fn.TOKEN),r=zr(Fn.VERSION);return!t||!n||!r?l.jsx(NT,{to:"/manager/login"}):e},x$=({children:e})=>{const t=zr(Fn.API_URL),n=zr(Fn.TOKEN),r=zr(Fn.VERSION);return t&&n&&r?l.jsx(NT,{to:"/"}):e};function LT(e,t){return function(){return e.apply(t,arguments)}}const{toString:w$}=Object.prototype,{getPrototypeOf:Ax}=Object,rh=(e=>t=>{const n=w$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),hs=e=>(e=e.toLowerCase(),t=>rh(t)===e),sh=e=>t=>typeof t===e,{isArray:jc}=Array,dd=sh("undefined");function S$(e){return e!==null&&!dd(e)&&e.constructor!==null&&!dd(e.constructor)&&Ur(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $T=hs("ArrayBuffer");function C$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$T(e.buffer),t}const E$=sh("string"),Ur=sh("function"),BT=sh("number"),oh=e=>e!==null&&typeof e=="object",k$=e=>e===!0||e===!1,pp=e=>{if(rh(e)!=="object")return!1;const t=Ax(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},j$=hs("Date"),T$=hs("File"),M$=hs("Blob"),N$=hs("FileList"),_$=e=>oh(e)&&Ur(e.pipe),P$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ur(e.append)&&((t=rh(e))==="formdata"||t==="object"&&Ur(e.toString)&&e.toString()==="[object FormData]"))},R$=hs("URLSearchParams"),[O$,I$,D$,A$]=["ReadableStream","Request","Response","Headers"].map(hs),F$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),jc(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const UT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,VT=e=>!dd(e)&&e!==UT;function By(){const{caseless:e}=VT(this)&&this||{},t={},n=(r,s)=>{const o=e&&zT(t,s)||s;pp(t[o])&&pp(r)?t[o]=By(t[o],r):pp(r)?t[o]=By({},r):jc(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(qd(t,(s,o)=>{n&&Ur(s)?e[o]=LT(s,n):e[o]=s},{allOwnKeys:r}),e),$$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),B$=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},z$=(e,t,n,r)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&Ax(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},U$=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},V$=e=>{if(!e)return null;if(jc(e))return e;let t=e.length;if(!BT(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},H$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ax(Uint8Array)),K$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},q$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},W$=hs("HTMLFormElement"),G$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),U0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),J$=hs("RegExp"),HT=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};qd(n,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(r[o]=a||s)}),Object.defineProperties(e,r)},Q$=e=>{HT(e,(t,n)=>{if(Ur(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ur(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Z$=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return jc(e)?r(e):r(String(e).split(t)),n},Y$=()=>{},X$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,zm="abcdefghijklmnopqrstuvwxyz",V0="0123456789",KT={DIGIT:V0,ALPHA:zm,ALPHA_DIGIT:zm+zm.toUpperCase()+V0},e4=(e=16,t=KT.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function t4(e){return!!(e&&Ur(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const n4=e=>{const t=new Array(10),n=(r,s)=>{if(oh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=jc(r)?[]:{};return qd(r,(a,c)=>{const u=n(a,s+1);!dd(u)&&(o[c]=u)}),t[s]=void 0,o}}return r};return n(e,0)},r4=hs("AsyncFunction"),s4=e=>e&&(oh(e)||Ur(e))&&Ur(e.then)&&Ur(e.catch),U={isArray:jc,isArrayBuffer:$T,isBuffer:S$,isFormData:P$,isArrayBufferView:C$,isString:E$,isNumber:BT,isBoolean:k$,isObject:oh,isPlainObject:pp,isReadableStream:O$,isRequest:I$,isResponse:D$,isHeaders:A$,isUndefined:dd,isDate:j$,isFile:T$,isBlob:M$,isRegExp:J$,isFunction:Ur,isStream:_$,isURLSearchParams:R$,isTypedArray:H$,isFileList:N$,forEach:qd,merge:By,extend:L$,trim:F$,stripBOM:$$,inherits:B$,toFlatObject:z$,kindOf:rh,kindOfTest:hs,endsWith:U$,toArray:V$,forEachEntry:K$,matchAll:q$,isHTMLForm:W$,hasOwnProperty:U0,hasOwnProp:U0,reduceDescriptors:HT,freezeMethods:Q$,toObjectSet:Z$,toCamelCase:G$,noop:Y$,toFiniteNumber:X$,findKey:zT,global:UT,isContextDefined:VT,ALPHABET:KT,generateString:e4,isSpecCompliantForm:t4,toJSONObject:n4,isAsyncFn:r4,isThenable:s4};function We(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}U.inherits(We,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qT=We.prototype,WT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{WT[e]={value:e}});Object.defineProperties(We,WT);Object.defineProperty(qT,"isAxiosError",{value:!0});We.from=(e,t,n,r,s,o)=>{const a=Object.create(qT);return U.toFlatObject(e,a,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),We.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const o4=null;function zy(e){return U.isPlainObject(e)||U.isArray(e)}function GT(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function H0(e,t,n){return e?e.concat(t).map(function(s,o){return s=GT(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function a4(e){return U.isArray(e)&&!e.some(zy)}const i4=U.toFlatObject(U,{},null,function(t){return/^is[A-Z]/.test(t)});function ah(e,t,n){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,x){return!U.isUndefined(x[m])});const r=n.metaTokens,s=n.visitor||d,o=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(s))throw new TypeError("visitor must be a function");function i(h){if(h===null)return"";if(U.isDate(h))return h.toISOString();if(!u&&U.isBlob(h))throw new We("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(h)||U.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,m,x){let b=h;if(h&&!x&&typeof h=="object"){if(U.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(U.isArray(h)&&a4(h)||(U.isFileList(h)||U.endsWith(m,"[]"))&&(b=U.toArray(h)))return m=GT(m),b.forEach(function(w,S){!(U.isUndefined(w)||w===null)&&t.append(a===!0?H0([m],S,o):a===null?m:m+"[]",i(w))}),!1}return zy(h)?!0:(t.append(H0(x,m,o),i(h)),!1)}const p=[],f=Object.assign(i4,{defaultVisitor:d,convertValue:i,isVisitable:zy});function g(h,m){if(!U.isUndefined(h)){if(p.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(h),U.forEach(h,function(b,y){(!(U.isUndefined(b)||b===null)&&s.call(t,b,U.isString(y)?y.trim():y,m,f))===!0&&g(b,m?m.concat(y):[y])}),p.pop()}}if(!U.isObject(e))throw new TypeError("data must be an object");return g(e),t}function K0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Fx(e,t){this._pairs=[],e&&ah(e,this,t)}const JT=Fx.prototype;JT.append=function(t,n){this._pairs.push([t,n])};JT.toString=function(t){const n=t?function(r){return t.call(this,r,K0)}:K0;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function l4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function QT(e,t,n){if(!t)return e;const r=n&&n.encode||l4,s=n&&n.serialize;let o;if(s?o=s(t,n):o=U.isURLSearchParams(t)?t.toString():new Fx(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class q0{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){U.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ZT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},c4=typeof URLSearchParams<"u"?URLSearchParams:Fx,u4=typeof FormData<"u"?FormData:null,d4=typeof Blob<"u"?Blob:null,f4={isBrowser:!0,classes:{URLSearchParams:c4,FormData:u4,Blob:d4},protocols:["http","https","file","blob","url","data"]},Lx=typeof window<"u"&&typeof document<"u",p4=(e=>Lx&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),g4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",h4=Lx&&window.location.href||"http://localhost",m4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Lx,hasStandardBrowserEnv:p4,hasStandardBrowserWebWorkerEnv:g4,origin:h4},Symbol.toStringTag,{value:"Module"})),as={...m4,...f4};function v4(e,t){return ah(e,new as.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return as.isNode&&U.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function y4(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function b4(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return a=!a&&U.isArray(s)?s.length:a,u?(U.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!U.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],o)&&U.isArray(s[a])&&(s[a]=b4(s[a])),!c)}if(U.isFormData(e)&&U.isFunction(e.entries)){const n={};return U.forEachEntry(e,(r,s)=>{t(y4(r),s,n,0)}),n}return null}function x4(e,t,n){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wd={transitional:ZT,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=U.isObject(t);if(o&&U.isHTMLForm(t)&&(t=new FormData(t)),U.isFormData(t))return s?JSON.stringify(YT(t)):t;if(U.isArrayBuffer(t)||U.isBuffer(t)||U.isStream(t)||U.isFile(t)||U.isBlob(t)||U.isReadableStream(t))return t;if(U.isArrayBufferView(t))return t.buffer;if(U.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return v4(t,this.formSerializer).toString();if((c=U.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ah(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),x4(t)):t}],transformResponse:[function(t){const n=this.transitional||Wd.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(U.isResponse(t)||U.isReadableStream(t))return t;if(t&&U.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?We.from(c,We.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:as.classes.FormData,Blob:as.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],e=>{Wd.headers[e]={}});const w4=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),S4=e=>{const t={};let n,r,s;return e&&e.split(` -`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&w4[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},W0=Symbol("internals");function eu(e){return e&&String(e).trim().toLowerCase()}function gp(e){return e===!1||e==null?e:U.isArray(e)?e.map(gp):String(e)}function C4(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const E4=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Um(e,t,n,r,s){if(U.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!U.isString(t)){if(U.isString(r))return t.indexOf(r)!==-1;if(U.isRegExp(r))return r.test(t)}}function k4(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function j4(e,t){const n=U.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,a){return this[r].call(this,t,s,o,a)},configurable:!0})})}let lr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,u,i){const d=eu(u);if(!d)throw new Error("header name must be a non-empty string");const p=U.findKey(s,d);(!p||s[p]===void 0||i===!0||i===void 0&&s[p]!==!1)&&(s[p||u]=gp(c))}const a=(c,u)=>U.forEach(c,(i,d)=>o(i,d,u));if(U.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(U.isString(t)&&(t=t.trim())&&!E4(t))a(S4(t),n);else if(U.isHeaders(t))for(const[c,u]of t.entries())o(u,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=eu(t),t){const r=U.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return C4(s);if(U.isFunction(n))return n.call(this,s,r);if(U.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=eu(t),t){const r=U.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Um(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(a){if(a=eu(a),a){const c=U.findKey(r,a);c&&(!n||Um(r,r[c],c,n))&&(delete r[c],s=!0)}}return U.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Um(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return U.forEach(this,(s,o)=>{const a=U.findKey(r,o);if(a){n[a]=gp(s),delete n[o];return}const c=t?k4(o):String(o).trim();c!==o&&delete n[o],n[c]=gp(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return U.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&U.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[W0]=this[W0]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=eu(a);r[c]||(j4(s,a),r[c]=!0)}return U.isArray(t)?t.forEach(o):o(t),this}};lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);U.reduceDescriptors(lr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});U.freezeMethods(lr);function Vm(e,t){const n=this||Wd,r=t||n,s=lr.from(r.headers);let o=r.data;return U.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function XT(e){return!!(e&&e.__CANCEL__)}function Tc(e,t,n){We.call(this,e??"canceled",We.ERR_CANCELED,t,n),this.name="CanceledError"}U.inherits(Tc,We,{__CANCEL__:!0});function eM(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new We("Request failed with status code "+n.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function T4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function M4(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(u){const i=Date.now(),d=r[o];a||(a=i),n[s]=u,r[s]=i;let p=o,f=0;for(;p!==s;)f+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),i-ar)return s&&(clearTimeout(s),s=null),n=c,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),r-(c-n)))}}const tg=(e,t,n=3)=>{let r=0;const s=M4(50,250);return N4(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,u=a-r,i=s(u),d=a<=c;r=a;const p={loaded:a,total:c,progress:c?a/c:void 0,bytes:u,rate:i||void 0,estimated:i&&c&&d?(c-a)/i:void 0,event:o,lengthComputable:c!=null};p[t?"download":"upload"]=!0,e(p)},n)},_4=as.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const c=U.isString(a)?s(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),P4=as.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const a=[e+"="+encodeURIComponent(t)];U.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),U.isString(r)&&a.push("path="+r),U.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function R4(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function O4(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function tM(e,t){return e&&!R4(t)?O4(e,t):t}const G0=e=>e instanceof lr?{...e}:e;function Ri(e,t){t=t||{};const n={};function r(i,d,p){return U.isPlainObject(i)&&U.isPlainObject(d)?U.merge.call({caseless:p},i,d):U.isPlainObject(d)?U.merge({},d):U.isArray(d)?d.slice():d}function s(i,d,p){if(U.isUndefined(d)){if(!U.isUndefined(i))return r(void 0,i,p)}else return r(i,d,p)}function o(i,d){if(!U.isUndefined(d))return r(void 0,d)}function a(i,d){if(U.isUndefined(d)){if(!U.isUndefined(i))return r(void 0,i)}else return r(void 0,d)}function c(i,d,p){if(p in t)return r(i,d);if(p in e)return r(void 0,i)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(i,d)=>s(G0(i),G0(d),!0)};return U.forEach(Object.keys(Object.assign({},e,t)),function(d){const p=u[d]||s,f=p(e[d],t[d],d);U.isUndefined(f)&&p!==c||(n[d]=f)}),n}const nM=e=>{const t=Ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=lr.from(a),t.url=QT(tM(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(U.isFormData(n)){if(as.hasStandardBrowserEnv||as.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[i,...d]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([i||"multipart/form-data",...d].join("; "))}}if(as.hasStandardBrowserEnv&&(r&&U.isFunction(r)&&(r=r(t)),r||r!==!1&&_4(t.url))){const i=s&&o&&P4.read(o);i&&a.set(s,i)}return t},I4=typeof XMLHttpRequest<"u",D4=I4&&function(e){return new Promise(function(n,r){const s=nM(e);let o=s.data;const a=lr.from(s.headers).normalize();let{responseType:c}=s,u;function i(){s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(s.method.toUpperCase(),s.url,!0),d.timeout=s.timeout;function p(){if(!d)return;const g=lr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),m={data:!c||c==="text"||c==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:e,request:d};eM(function(b){n(b),i()},function(b){r(b),i()},m),d=null}"onloadend"in d?d.onloadend=p:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(p)},d.onabort=function(){d&&(r(new We("Request aborted",We.ECONNABORTED,s,d)),d=null)},d.onerror=function(){r(new We("Network Error",We.ERR_NETWORK,s,d)),d=null},d.ontimeout=function(){let h=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const m=s.transitional||ZT;s.timeoutErrorMessage&&(h=s.timeoutErrorMessage),r(new We(h,m.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,s,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&U.forEach(a.toJSON(),function(h,m){d.setRequestHeader(m,h)}),U.isUndefined(s.withCredentials)||(d.withCredentials=!!s.withCredentials),c&&c!=="json"&&(d.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&d.addEventListener("progress",tg(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",tg(s.onUploadProgress)),(s.cancelToken||s.signal)&&(u=g=>{d&&(r(!g||g.type?new Tc(null,e,d):g),d.abort(),d=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const f=T4(s.url);if(f&&as.protocols.indexOf(f)===-1){r(new We("Unsupported protocol "+f+":",We.ERR_BAD_REQUEST,e));return}d.send(o||null)})},A4=(e,t)=>{let n=new AbortController,r;const s=function(u){if(!r){r=!0,a();const i=u instanceof Error?u:this.reason;n.abort(i instanceof We?i:new Tc(i instanceof Error?i.message:i))}};let o=t&&setTimeout(()=>{s(new We(`timeout ${t} of ms exceeded`,We.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u&&(u.removeEventListener?u.removeEventListener("abort",s):u.unsubscribe(s))}),e=null)};e.forEach(u=>u&&u.addEventListener&&u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{o&&clearTimeout(o),o=null}]},F4=function*(e,t){let n=e.byteLength;if(!t||n{const o=L4(e,t,s);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:u,value:i}=await o.next();if(u){c.close(),r();return}let d=i.byteLength;n&&n(a+=d),c.enqueue(new Uint8Array(i))},cancel(c){return r(c),o.return()}},{highWaterMark:2})},Q0=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},ih=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",rM=ih&&typeof ReadableStream=="function",Uy=ih&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),$4=rM&&(()=>{let e=!1;const t=new Request(as.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),Z0=64*1024,Vy=rM&&!!(()=>{try{return U.isReadableStream(new Response("").body)}catch{}})(),ng={stream:Vy&&(e=>e.body)};ih&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ng[t]&&(ng[t]=U.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new We(`Response type '${t}' is not supported`,We.ERR_NOT_SUPPORT,r)})})})(new Response);const B4=async e=>{if(e==null)return 0;if(U.isBlob(e))return e.size;if(U.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(U.isArrayBufferView(e))return e.byteLength;if(U.isURLSearchParams(e)&&(e=e+""),U.isString(e))return(await Uy(e)).byteLength},z4=async(e,t)=>{const n=U.toFiniteNumber(e.getContentLength());return n??B4(t)},U4=ih&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:u,responseType:i,headers:d,withCredentials:p="same-origin",fetchOptions:f}=nM(e);i=i?(i+"").toLowerCase():"text";let[g,h]=s||o||a?A4([s,o],a):[],m,x;const b=()=>{!m&&setTimeout(()=>{g&&g.unsubscribe()}),m=!0};let y;try{if(u&&$4&&n!=="get"&&n!=="head"&&(y=await z4(d,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),T;U.isFormData(r)&&(T=C.headers.get("content-type"))&&d.setContentType(T),C.body&&(r=J0(C.body,Z0,Q0(y,tg(u)),null,Uy))}U.isString(p)||(p=p?"cors":"omit"),x=new Request(t,{...f,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",withCredentials:p});let w=await fetch(x);const S=Vy&&(i==="stream"||i==="response");if(Vy&&(c||S)){const C={};["status","statusText","headers"].forEach(j=>{C[j]=w[j]});const T=U.toFiniteNumber(w.headers.get("content-length"));w=new Response(J0(w.body,Z0,c&&Q0(T,tg(c,!0)),S&&b,Uy),C)}i=i||"text";let E=await ng[U.findKey(ng,i)||"text"](w,e);return!S&&b(),h&&h(),await new Promise((C,T)=>{eM(C,T,{data:E,headers:lr.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:x})})}catch(w){throw b(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,e,x),{cause:w.cause||w}):We.from(w,w&&w.code,e,x)}}),Hy={http:o4,xhr:D4,fetch:U4};U.forEach(Hy,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Y0=e=>`- ${e}`,V4=e=>U.isFunction(e)||e===null||e===!1,sM={getAdapter:e=>{e=U.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : -`+o.map(Y0).join(` -`):" "+Y0(o[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Hy};function Hm(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tc(null,e)}function X0(e){return Hm(e),e.headers=lr.from(e.headers),e.data=Vm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),sM.getAdapter(e.adapter||Wd.adapter)(e).then(function(r){return Hm(e),r.data=Vm.call(e,e.transformResponse,r),r.headers=lr.from(r.headers),r},function(r){return XT(r)||(Hm(e),r&&r.response&&(r.response.data=Vm.call(e,e.transformResponse,r.response),r.response.headers=lr.from(r.response.headers))),Promise.reject(r)})}const oM="1.7.2",$x={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$x[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const eC={};$x.transitional=function(t,n,r){function s(o,a){return"[Axios v"+oM+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(t===!1)throw new We(s(a," has been removed"+(n?" in "+n:"")),We.ERR_DEPRECATED);return n&&!eC[a]&&(eC[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function H4(e,t,n){if(typeof e!="object")throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],a=t[o];if(a){const c=e[o],u=c===void 0||a(c,o,e);if(u!==!0)throw new We("option "+o+" must be "+u,We.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new We("Unknown option "+o,We.ERR_BAD_OPTION)}}const Ky={assertOptions:H4,validators:$x},Fo=Ky.validators;let wi=class{constructor(t){this.defaults=t,this.interceptors={request:new q0,response:new q0}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ri(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Ky.assertOptions(r,{silentJSONParsing:Fo.transitional(Fo.boolean),forcedJSONParsing:Fo.transitional(Fo.boolean),clarifyTimeoutError:Fo.transitional(Fo.boolean)},!1),s!=null&&(U.isFunction(s)?n.paramsSerializer={serialize:s}:Ky.assertOptions(s,{encode:Fo.function,serialize:Fo.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&U.merge(o.common,o[n.method]);o&&U.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=lr.concat(a,o);const c=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const i=[];this.interceptors.response.forEach(function(m){i.push(m.fulfilled,m.rejected)});let d,p=0,f;if(!u){const h=[X0.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,i),f=h.length,d=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,c){r.reason||(r.reason=new Tc(o,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new aM(function(s){t=s}),cancel:t}}};function q4(e){return function(n){return e.apply(null,n)}}function W4(e){return U.isObject(e)&&e.isAxiosError===!0}const qy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qy).forEach(([e,t])=>{qy[t]=e});function iM(e){const t=new wi(e),n=LT(wi.prototype.request,t);return U.extend(n,wi.prototype,t,{allOwnKeys:!0}),U.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return iM(Ri(e,s))},n}const Bt=iM(Wd);Bt.Axios=wi;Bt.CanceledError=Tc;Bt.CancelToken=K4;Bt.isCancel=XT;Bt.VERSION=oM;Bt.toFormData=ah;Bt.AxiosError=We;Bt.Cancel=Bt.CanceledError;Bt.all=function(t){return Promise.all(t)};Bt.spread=q4;Bt.isAxiosError=W4;Bt.mergeConfig=Ri;Bt.AxiosHeaders=lr;Bt.formToJSON=e=>YT(U.isHTMLForm(e)?new FormData(e):e);Bt.getAdapter=sM.getAdapter;Bt.HttpStatusCode=qy;Bt.default=Bt;const{Axios:Loe,AxiosError:$oe,CanceledError:Boe,isCancel:zoe,CancelToken:Uoe,VERSION:Voe,all:Hoe,Cancel:Koe,isAxiosError:G4,spread:qoe,toFormData:Woe,AxiosHeaders:Goe,HttpStatusCode:Joe,formToJSON:Qoe,getAdapter:Zoe,mergeConfig:Yoe}=Bt,J4=e=>["auth","verifyServer",JSON.stringify(e)],lM=async({url:e})=>(await Bt.get(`${e}/`)).data,Q4=e=>{const{url:t,...n}=e;return qe({...n,queryKey:J4({url:t}),queryFn:()=>lM({url:t}),enabled:!!t})};function Z4(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lh(...e){return t=>e.forEach(n=>Z4(n,t))}function ct(...e){return v.useCallback(lh(...e),e)}var wo=v.forwardRef((e,t)=>{const{children:n,...r}=e,s=v.Children.toArray(n),o=s.find(X4);if(o){const a=o.props.children,c=s.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return l.jsx(Wy,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,c):null})}return l.jsx(Wy,{...r,ref:t,children:n})});wo.displayName="Slot";var Wy=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const s=tB(n);return v.cloneElement(n,{...eB(r,n.props),ref:t?lh(t,s):s})}return v.Children.count(n)>1?v.Children.only(null):null});Wy.displayName="SlotClone";var Y4=({children:e})=>l.jsx(l.Fragment,{children:e});function X4(e){return v.isValidElement(e)&&e.type===Y4}function eB(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{o(...c),s(...c)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function tB(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function cM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,nC=nB,ch=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(i=>{const d=n==null?void 0:n[i],p=o==null?void 0:o[i];if(d===null)return null;const f=tC(d)||tC(p);return s[i][f]}),c=n&&Object.entries(n).reduce((i,d)=>{let[p,f]=d;return f===void 0||(i[p]=f),i},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((i,d)=>{let{class:p,className:f,...g}=d;return Object.entries(g).every(h=>{let[m,x]=h;return Array.isArray(x)?x.includes({...o,...c}[m]):{...o,...c}[m]===x})?[...i,p,f]:i},[]);return nC(e,a,u,n==null?void 0:n.class,n==null?void 0:n.className)},Bx="-";function rB(e){const t=oB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(a){const c=a.split(Bx);return c[0]===""&&c.length!==1&&c.shift(),uM(c,t)||sB(a)}function o(a,c){const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function uM(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?uM(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Bx);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId}const rC=/^\[(.+)\]$/;function sB(e){if(rC.test(e)){const t=rC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function oB(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return iB(Object.entries(e.classGroups),n).forEach(([o,a])=>{Gy(a,r,o,t)}),r}function Gy(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:sC(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(aB(s)){Gy(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{Gy(a,sC(t,o),n,r)})})}function sC(e,t){let n=e;return t.split(Bx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function aB(e){return e.isThemeGetter}function iB(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e}function lB(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,a){n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}}const dM="!";function cB(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length;function a(c){const u=[];let i=0,d=0,p;for(let x=0;xd?p-d:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:m}}return n?function(u){return n({className:u,parseClassName:a})}:a}function uB(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function dB(e){return{cache:lB(e.cacheSize),parseClassName:cB(e),...rB(e)}}const fB=/\s+/;function pB(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(fB).map(a=>{const{modifiers:c,hasImportantModifier:u,baseClassName:i,maybePostfixModifierPosition:d}=n(a);let p=!!d,f=r(p?i.substring(0,d):i);if(!f){if(!p)return{isTailwindClass:!1,originalClassName:a};if(f=r(i),!f)return{isTailwindClass:!1,originalClassName:a};p=!1}const g=uB(c).join(":");return{isTailwindClass:!0,modifierId:u?g+dM:g,classGroupId:f,originalClassName:a,hasPostfixModifier:p}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:c,classGroupId:u,hasPostfixModifier:i}=a,d=c+u;return o.has(d)?!1:(o.add(d),s(u,i).forEach(p=>o.add(c+p)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function gB(){let e=0,t,n,r="";for(;ep(d),e());return n=dB(i),r=n.cache.get,s=n.cache.set,o=c,c(u)}function c(u){const i=r(u);if(i)return i;const d=pB(u,n);return s(u,d),d}return function(){return o(gB.apply(null,arguments))}}function Ot(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const pM=/^\[(?:([a-z-]+):)?(.+)\]$/i,mB=/^\d+\/\d+$/,vB=new Set(["px","full","screen"]),yB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Zs(e){return si(e)||vB.has(e)||mB.test(e)}function Lo(e){return Mc(e,"length",_B)}function si(e){return!!e&&!Number.isNaN(Number(e))}function Pf(e){return Mc(e,"number",si)}function tu(e){return!!e&&Number.isInteger(Number(e))}function CB(e){return e.endsWith("%")&&si(e.slice(0,-1))}function Qe(e){return pM.test(e)}function $o(e){return yB.test(e)}const EB=new Set(["length","size","percentage"]);function kB(e){return Mc(e,EB,gM)}function jB(e){return Mc(e,"position",gM)}const TB=new Set(["image","url"]);function MB(e){return Mc(e,TB,RB)}function NB(e){return Mc(e,"",PB)}function nu(){return!0}function Mc(e,t,n){const r=pM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function _B(e){return bB.test(e)&&!xB.test(e)}function gM(){return!1}function PB(e){return wB.test(e)}function RB(e){return SB.test(e)}function OB(){const e=Ot("colors"),t=Ot("spacing"),n=Ot("blur"),r=Ot("brightness"),s=Ot("borderColor"),o=Ot("borderRadius"),a=Ot("borderSpacing"),c=Ot("borderWidth"),u=Ot("contrast"),i=Ot("grayscale"),d=Ot("hueRotate"),p=Ot("invert"),f=Ot("gap"),g=Ot("gradientColorStops"),h=Ot("gradientColorStopPositions"),m=Ot("inset"),x=Ot("margin"),b=Ot("opacity"),y=Ot("padding"),w=Ot("saturate"),S=Ot("scale"),E=Ot("sepia"),C=Ot("skew"),T=Ot("space"),j=Ot("translate"),_=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",Qe,t],I=()=>[Qe,t],Y=()=>["",Zs,Lo],q=()=>["auto",si,Qe],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",Qe],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[si,Pf],H=()=>[si,Qe];return{cacheSize:500,separator:":",theme:{colors:[nu],spacing:[Zs,Lo],blur:["none","",$o,Qe],brightness:fe(),borderColor:[e],borderRadius:["none","","full",$o,Qe],borderSpacing:I(),borderWidth:Y(),contrast:fe(),grayscale:A(),hueRotate:H(),invert:A(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[CB,Lo],inset:K(),margin:K(),opacity:fe(),padding:I(),saturate:fe(),scale:fe(),sepia:A(),skew:H(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Qe]}],container:["container"],columns:[{columns:[$o]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Z(),Qe]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tu,Qe]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qe]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",tu,Qe]}],"grid-cols":[{"grid-cols":[nu]}],"col-start-end":[{col:["auto",{span:["full",tu,Qe]},Qe]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[nu]}],"row-start-end":[{row:["auto",{span:[tu,Qe]},Qe]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qe,t]}],"min-w":[{"min-w":[Qe,t,"min","max","fit"]}],"max-w":[{"max-w":[Qe,t,"none","full","min","max","fit","prose",{screen:[$o]},$o]}],h:[{h:[Qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$o,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pf]}],"font-family":[{font:[nu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Qe]}],"line-clamp":[{"line-clamp":["none",si,Pf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zs,Qe]}],"list-image":[{"list-image":["none",Qe]}],"list-style-type":[{list:["none","disc","decimal",Qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zs,Lo]}],"underline-offset":[{"underline-offset":["auto",Zs,Qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),jB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},MB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:ee()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[Zs,Qe]}],"outline-w":[{outline:[Zs,Lo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Zs,Lo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$o,NB]}],"shadow-color":[{shadow:[nu]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",$o,Qe]}],grayscale:[{grayscale:[i]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[i]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Qe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Qe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[tu,Qe]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zs,Lo,Pf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const IB=hB(OB);function me(...e){return IB(uo(e))}const DB=ch("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",warning:"bg-amber-600 shadow-sm hover:bg-amber-600/90 data-active:bg-amber-600/90 text-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),z=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const a=r?wo:"button";return l.jsx(a,{className:me(DB({variant:t,size:n,className:e})),ref:o,...s})});z.displayName="Button";function zx(){const{t:e}=Te(),t=zr(Fn.API_URL),{data:n}=Q4({url:t}),r=v.useMemo(()=>n==null?void 0:n.clientName,[n]),s=v.useMemo(()=>n==null?void 0:n.version,[n]),o=[{name:"Discord",url:"https://evolution-api.com/discord"},{name:"Postman",url:"https://evolution-api.com/postman"},{name:"GitHub",url:"https://github.com/EvolutionAPI/evolution-api"},{name:"Docs",url:"https://doc.evolution-api.com"}];return l.jsxs("footer",{className:"flex w-full flex-col items-center justify-between p-6 text-xs text-secondary-foreground sm:flex-row",children:[l.jsxs("div",{className:"flex items-center space-x-3 divide-x",children:[r&&r!==""&&l.jsxs("span",{children:[e("footer.clientName"),": ",l.jsx("strong",{children:r})]}),s&&s!==""&&l.jsxs("span",{className:"pl-3",children:[e("footer.version"),": ",l.jsx("strong",{children:s})]})]}),l.jsx("div",{className:"flex gap-2",children:o.map(a=>l.jsx(z,{variant:"link",asChild:!0,size:"sm",className:"text-xs",children:l.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",children:a.name})},a.url))})]})}/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const AB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hM=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var FB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LB=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>v.createElement("svg",{ref:u,...FB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:hM("lucide",s),...c},[...a.map(([i,d])=>v.createElement(i,d)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nt=(e,t)=>{const n=v.forwardRef(({className:r,...s},o)=>v.createElement(LB,{ref:o,iconNode:t,className:hM(`lucide-${AB(e)}`,r),...s}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $B=nt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BB=nt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mM=nt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uh=nt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zB=nt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UB=nt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VB=nt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HB=nt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ui=nt("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vM=nt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KB=nt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const To=nt("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qB=nt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vi=nt("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WB=nt("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ia=nt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GB=nt("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JB=nt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QB=nt("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZB=nt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YB=nt("IterationCcw",[["path",{d:"M20 10c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8h8",key:"4znkd0"}],["polyline",{points:"16 14 20 18 16 22",key:"11njsm"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XB=nt("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e3=nt("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t3=nt("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hi=nt("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n3=nt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dh=nt("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r3=nt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const s3=nt("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ki=nt("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qi=nt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ws=nt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rg=nt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wi=nt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o3=nt("Sparkle",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a3=nt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const i3=nt("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l3=nt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yM=nt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ie=Bt.create({timeout:3e4});ie.interceptors.request.use(async e=>{const t=zr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=zr(Fn.INSTANCE_TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const Gd=Bt.create({timeout:3e4});Gd.interceptors.request.use(async e=>{const t=zr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=zr(Fn.TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const c3=e=>["instance","fetchInstance",JSON.stringify(e)],u3=async({instanceId:e})=>{const t=await Gd.get("/instance/fetchInstances",{params:{instanceId:e}});return Array.isArray(t.data)?t.data[0]:t.data},bM=e=>{const{instanceId:t,...n}=e;return qe({...n,queryKey:c3({instanceId:t}),queryFn:()=>u3({instanceId:t}),enabled:!!t})};function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function d3(e,t){const n=v.createContext(t);function r(o){const{children:a,...c}=o,u=v.useMemo(()=>c,Object.values(c));return l.jsx(n.Provider,{value:u,children:a})}function s(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function qr(e,t=[]){let n=[];function r(o,a){const c=v.createContext(a),u=n.length;n=[...n,a];function i(p){const{scope:f,children:g,...h}=p,m=(f==null?void 0:f[e][u])||c,x=v.useMemo(()=>h,Object.values(h));return l.jsx(m.Provider,{value:x,children:g})}function d(p,f){const g=(f==null?void 0:f[e][u])||c,h=v.useContext(g);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return i.displayName=o+"Provider",[i,d]}const s=()=>{const o=n.map(a=>v.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,f3(s,...t)]}function f3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:i})=>{const p=u(o)[`__scope${i}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function on(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ya({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=p3({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,c=on(n),u=v.useCallback(i=>{if(o){const p=typeof i=="function"?i(e):i;p!==e&&c(p)}else s(i)},[o,e,s,c]);return[a,u]}function p3({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,s=v.useRef(r),o=on(t);return v.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var g3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ie=g3.reduce((e,t)=>{const n=v.forwardRef((r,s)=>{const{asChild:o,...a}=r,c=o?wo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xM(e,t){e&&Pa.flushSync(()=>e.dispatchEvent(t))}function Ux(e){const t=e+"CollectionProvider",[n,r]=qr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:h,children:m}=g,x=je.useRef(null),b=je.useRef(new Map).current;return l.jsx(s,{scope:h,itemMap:b,collectionRef:x,children:m})};a.displayName=t;const c=e+"CollectionSlot",u=je.forwardRef((g,h)=>{const{scope:m,children:x}=g,b=o(c,m),y=ct(h,b.collectionRef);return l.jsx(wo,{ref:y,children:x})});u.displayName=c;const i=e+"CollectionItemSlot",d="data-radix-collection-item",p=je.forwardRef((g,h)=>{const{scope:m,children:x,...b}=g,y=je.useRef(null),w=ct(h,y),S=o(i,m);return je.useEffect(()=>(S.itemMap.set(y,{ref:y,...b}),()=>void S.itemMap.delete(y))),l.jsx(wo,{[d]:"",ref:w,children:x})});p.displayName=i;function f(g){const h=o(e+"CollectionConsumer",g);return je.useCallback(()=>{const x=h.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((S,E)=>b.indexOf(S.ref.current)-b.indexOf(E.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},f,r]}var h3=v.createContext(void 0);function Jd(e){const t=v.useContext(h3);return e||t||"ltr"}function m3(e,t=globalThis==null?void 0:globalThis.document){const n=on(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var v3="DismissableLayer",Jy="dismissableLayer.update",y3="dismissableLayer.pointerDownOutside",b3="dismissableLayer.focusOutside",oC,wM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fh=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,i=v.useContext(wM),[d,p]=v.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=v.useState({}),h=ct(t,T=>p(T)),m=Array.from(i.layers),[x]=[...i.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),y=d?m.indexOf(d):-1,w=i.layersWithOutsidePointerEventsDisabled.size>0,S=y>=b,E=S3(T=>{const j=T.target,_=[...i.branches].some(O=>O.contains(j));!S||_||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},f),C=C3(T=>{const j=T.target;[...i.branches].some(O=>O.contains(j))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},f);return m3(T=>{y===i.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},f),v.useEffect(()=>{if(d)return n&&(i.layersWithOutsidePointerEventsDisabled.size===0&&(oC=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),i.layersWithOutsidePointerEventsDisabled.add(d)),i.layers.add(d),aC(),()=>{n&&i.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=oC)}},[d,f,n,i]),v.useEffect(()=>()=>{d&&(i.layers.delete(d),i.layersWithOutsidePointerEventsDisabled.delete(d),aC())},[d,i]),v.useEffect(()=>{const T=()=>g({});return document.addEventListener(Jy,T),()=>document.removeEventListener(Jy,T)},[]),l.jsx(Ie.div,{...u,ref:h,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,E.onPointerDownCapture)})});fh.displayName=v3;var x3="DismissableLayerBranch",w3=v.forwardRef((e,t)=>{const n=v.useContext(wM),r=v.useRef(null),s=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),l.jsx(Ie.div,{...e,ref:s})});w3.displayName=x3;function S3(e,t=globalThis==null?void 0:globalThis.document){const n=on(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){SM(y3,n,i,{discrete:!0})};const i={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function C3(e,t=globalThis==null?void 0:globalThis.document){const n=on(e),r=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!r.current&&SM(b3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function aC(){const e=new CustomEvent(Jy);document.dispatchEvent(e)}function SM(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xM(s,o):s.dispatchEvent(o)}var Km=0;function Vx(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iC()),document.body.insertAdjacentElement("beforeend",e[1]??iC()),Km++,()=>{Km===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Km--}},[])}function iC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var qm="focusScope.autoFocusOnMount",Wm="focusScope.autoFocusOnUnmount",lC={bubbles:!1,cancelable:!0},E3="FocusScope",ph=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=v.useState(null),i=on(s),d=on(o),p=v.useRef(null),f=ct(t,m=>u(m)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(g.paused||!c)return;const S=w.target;c.contains(S)?p.current=S:Vo(p.current,{select:!0})},x=function(w){if(g.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||Vo(p.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Vo(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const y=new MutationObserver(b);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),y.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){uC.add(g);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(qm,lC);c.addEventListener(qm,i),c.dispatchEvent(b),b.defaultPrevented||(k3(_3(CM(c)),{select:!0}),document.activeElement===m&&Vo(c))}return()=>{c.removeEventListener(qm,i),setTimeout(()=>{const b=new CustomEvent(Wm,lC);c.addEventListener(Wm,d),c.dispatchEvent(b),b.defaultPrevented||Vo(m??document.body,{select:!0}),c.removeEventListener(Wm,d),uC.remove(g)},0)}}},[c,i,d,g]);const h=v.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(x&&b){const y=m.currentTarget,[w,S]=j3(y);w&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&Vo(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&Vo(S,{select:!0})):b===y&&m.preventDefault()}},[n,r,g.paused]);return l.jsx(Ie.div,{tabIndex:-1,...a,ref:f,onKeyDown:h})});ph.displayName=E3;function k3(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vo(r,{select:t}),document.activeElement!==n)return}function j3(e){const t=CM(e),n=cC(t,e),r=cC(t.reverse(),e);return[n,r]}function CM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function cC(e,t){for(const n of e)if(!T3(n,{upTo:t}))return n}function T3(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function M3(e){return e instanceof HTMLInputElement&&"select"in e}function Vo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&M3(e)&&t&&e.select()}}var uC=N3();function N3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dC(e,t),e.unshift(t)},remove(t){var n;e=dC(e,t),(n=e[0])==null||n.resume()}}}function dC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _3(e){return e.filter(t=>t.tagName!=="A")}var pn=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},P3=Dg.useId||(()=>{}),R3=0;function is(e){const[t,n]=v.useState(P3());return pn(()=>{n(r=>r??String(R3++))},[e]),t?`radix-${t}`:""}const O3=["top","right","bottom","left"],Ds=Math.min,vr=Math.max,sg=Math.round,Rf=Math.floor,ba=e=>({x:e,y:e}),I3={left:"right",right:"left",bottom:"top",top:"bottom"},D3={start:"end",end:"start"};function Qy(e,t,n){return vr(e,Ds(t,n))}function So(e,t){return typeof e=="function"?e(t):e}function Co(e){return e.split("-")[0]}function Nc(e){return e.split("-")[1]}function Hx(e){return e==="x"?"y":"x"}function Kx(e){return e==="y"?"height":"width"}function xa(e){return["top","bottom"].includes(Co(e))?"y":"x"}function qx(e){return Hx(xa(e))}function A3(e,t,n){n===void 0&&(n=!1);const r=Nc(e),s=qx(e),o=Kx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=og(a)),[a,og(a)]}function F3(e){const t=og(e);return[Zy(e),t,Zy(t)]}function Zy(e){return e.replace(/start|end/g,t=>D3[t])}function L3(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:a;default:return[]}}function $3(e,t,n,r){const s=Nc(e);let o=L3(Co(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Zy)))),o}function og(e){return e.replace(/left|right|bottom|top/g,t=>I3[t])}function B3(e){return{top:0,right:0,bottom:0,left:0,...e}}function EM(e){return typeof e!="number"?B3(e):{top:e,right:e,bottom:e,left:e}}function ag(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function fC(e,t,n){let{reference:r,floating:s}=e;const o=xa(t),a=qx(t),c=Kx(a),u=Co(t),i=o==="y",d=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,f=r[c]/2-s[c]/2;let g;switch(u){case"top":g={x:d,y:r.y-s.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-s.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Nc(t)){case"start":g[a]-=f*(n&&i?-1:1);break;case"end":g[a]+=f*(n&&i?-1:1);break}return g}const z3=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let i=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:p}=fC(i,r,u),f=r,g={},h=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:i,padding:d=0}=So(e,t)||{};if(i==null)return{};const p=EM(d),f={x:n,y:r},g=qx(s),h=Kx(g),m=await a.getDimensions(i),x=g==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=o.reference[h]+o.reference[g]-f[g]-o.floating[h],E=f[g]-o.reference[g],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i));let T=C?C[w]:0;(!T||!await(a.isElement==null?void 0:a.isElement(C)))&&(T=c.floating[w]||o.floating[h]);const j=S/2-E/2,_=T/2-m[h]/2-1,O=Ds(p[b],_),K=Ds(p[y],_),I=O,Y=T-m[h]-K,q=T/2-m[h]/2+j,Z=Qy(I,q,Y),ee=!u.arrow&&Nc(s)!=null&&q!==Z&&o.reference[h]/2-(qq<=0)){var K,I;const q=(((K=o.flip)==null?void 0:K.index)||0)+1,Z=T[q];if(Z)return{data:{index:q,overflows:O},reset:{placement:Z}};let ee=(I=O.filter(J=>J.overflows[0]<=0).sort((J,L)=>J.overflows[1]-L.overflows[1])[0])==null?void 0:I.placement;if(!ee)switch(g){case"bestFit":{var Y;const J=(Y=O.filter(L=>{if(C){const A=xa(L.placement);return A===y||A==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(A=>A>0).reduce((A,X)=>A+X,0)]).sort((L,A)=>L[1]-A[1])[0])==null?void 0:Y[0];J&&(ee=J);break}case"initialPlacement":ee=c;break}if(s!==ee)return{reset:{placement:ee}}}return{}}}};function pC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gC(e){return O3.some(t=>e[t]>=0)}const H3=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=So(e,t);switch(r){case"referenceHidden":{const o=await fd(t,{...s,elementContext:"reference"}),a=pC(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:gC(a)}}}case"escaped":{const o=await fd(t,{...s,altBoundary:!0}),a=pC(o,n.floating);return{data:{escapedOffsets:a,escaped:gC(a)}}}default:return{}}}}};async function K3(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Co(n),c=Nc(n),u=xa(n)==="y",i=["left","top"].includes(a)?-1:1,d=o&&u?-1:1,p=So(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return c&&typeof h=="number"&&(g=c==="end"?h*-1:h),u?{x:g*d,y:f*i}:{x:f*i,y:g*d}}const q3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await K3(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},W3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...u}=So(e,t),i={x:n,y:r},d=await fd(t,u),p=xa(Co(s)),f=Hx(p);let g=i[f],h=i[p];if(o){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=g+d[x],w=g-d[b];g=Qy(y,g,w)}if(a){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+d[x],w=h-d[b];h=Qy(y,h,w)}const m=c.fn({...t,[f]:g,[p]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},G3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:i=!0}=So(e,t),d={x:n,y:r},p=xa(s),f=Hx(p);let g=d[f],h=d[p];const m=So(c,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const w=f==="y"?"height":"width",S=o.reference[f]-o.floating[w]+x.mainAxis,E=o.reference[f]+o.reference[w]-x.mainAxis;gE&&(g=E)}if(i){var b,y;const w=f==="y"?"width":"height",S=["top","left"].includes(Co(s)),E=o.reference[p]-o.floating[w]+(S&&((b=a.offset)==null?void 0:b[p])||0)+(S?0:x.crossAxis),C=o.reference[p]+o.reference[w]+(S?0:((y=a.offset)==null?void 0:y[p])||0)-(S?x.crossAxis:0);hC&&(h=C)}return{[f]:g,[p]:h}}}},J3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:a=()=>{},...c}=So(e,t),u=await fd(t,c),i=Co(n),d=Nc(n),p=xa(n)==="y",{width:f,height:g}=r.floating;let h,m;i==="top"||i==="bottom"?(h=i,m=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(m=i,h=d==="end"?"top":"bottom");const x=g-u.top-u.bottom,b=f-u.left-u.right,y=Ds(g-u[h],x),w=Ds(f-u[m],b),S=!t.middlewareData.shift;let E=y,C=w;if(p?C=d||S?Ds(w,b):b:E=d||S?Ds(y,x):x,S&&!d){const j=vr(u.left,0),_=vr(u.right,0),O=vr(u.top,0),K=vr(u.bottom,0);p?C=f-2*(j!==0||_!==0?j+_:vr(u.left,u.right)):E=g-2*(O!==0||K!==0?O+K:vr(u.top,u.bottom))}await a({...t,availableWidth:C,availableHeight:E});const T=await s.getDimensions(o.floating);return f!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function _c(e){return kM(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(kM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kM(e){return e instanceof Node||e instanceof wr(e).Node}function Us(e){return e instanceof Element||e instanceof wr(e).Element}function Vs(e){return e instanceof HTMLElement||e instanceof wr(e).HTMLElement}function hC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function Qd(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=fs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Q3(e){return["table","td","th"].includes(_c(e))}function gh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Wx(e){const t=Gx(),n=fs(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Z3(e){let t=wa(e);for(;Vs(t)&&!fc(t);){if(gh(t))return null;if(Wx(t))return t;t=wa(t)}return null}function Gx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fc(e){return["html","body","#document"].includes(_c(e))}function fs(e){return wr(e).getComputedStyle(e)}function hh(e){return Us(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wa(e){if(_c(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hC(e)&&e.host||Mo(e);return hC(t)?t.host:t}function jM(e){const t=wa(e);return fc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vs(t)&&Qd(t)?t:jM(t)}function pd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=jM(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=wr(s);return o?t.concat(a,a.visualViewport||[],Qd(s)?s:[],a.frameElement&&n?pd(a.frameElement):[]):t.concat(s,pd(s,[],n))}function TM(e){const t=fs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Vs(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=sg(n)!==o||sg(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function Jx(e){return Us(e)?e:e.contextElement}function Ll(e){const t=Jx(e);if(!Vs(t))return ba(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=TM(t);let a=(o?sg(n.width):n.width)/r,c=(o?sg(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Y3=ba(0);function MM(e){const t=wr(e);return!Gx()||!t.visualViewport?Y3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function X3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wr(e)?!1:t}function Oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Jx(e);let a=ba(1);t&&(r?Us(r)&&(a=Ll(r)):a=Ll(e));const c=X3(o,n,r)?MM(o):ba(0);let u=(s.left+c.x)/a.x,i=(s.top+c.y)/a.y,d=s.width/a.x,p=s.height/a.y;if(o){const f=wr(o),g=r&&Us(r)?wr(r):r;let h=f,m=h.frameElement;for(;m&&r&&g!==h;){const x=Ll(m),b=m.getBoundingClientRect(),y=fs(m),w=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,S=b.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;u*=x.x,i*=x.y,d*=x.x,p*=x.y,u+=w,i+=S,h=wr(m),m=h.frameElement}}return ag({width:d,height:p,x:u,y:i})}function ez(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=Mo(r),c=t?gh(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},i=ba(1);const d=ba(0),p=Vs(r);if((p||!p&&!o)&&((_c(r)!=="body"||Qd(a))&&(u=hh(r)),Vs(r))){const f=Oi(r);i=Ll(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*i.x,height:n.height*i.y,x:n.x*i.x-u.scrollLeft*i.x+d.x,y:n.y*i.y-u.scrollTop*i.y+d.y}}function tz(e){return Array.from(e.getClientRects())}function NM(e){return Oi(Mo(e)).left+hh(e).scrollLeft}function nz(e){const t=Mo(e),n=hh(e),r=e.ownerDocument.body,s=vr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=vr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+NM(e);const c=-n.scrollTop;return fs(r).direction==="rtl"&&(a+=vr(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}function rz(e,t){const n=wr(e),r=Mo(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const i=Gx();(!i||i&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:c,y:u}}function sz(e,t){const n=Oi(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Vs(e)?Ll(e):ba(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,i=r*o.y;return{width:a,height:c,x:u,y:i}}function mC(e,t,n){let r;if(t==="viewport")r=rz(e,n);else if(t==="document")r=nz(Mo(e));else if(Us(t))r=sz(t,n);else{const s=MM(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return ag(r)}function _M(e,t){const n=wa(e);return n===t||!Us(n)||fc(n)?!1:fs(n).position==="fixed"||_M(n,t)}function oz(e,t){const n=t.get(e);if(n)return n;let r=pd(e,[],!1).filter(c=>Us(c)&&_c(c)!=="body"),s=null;const o=fs(e).position==="fixed";let a=o?wa(e):e;for(;Us(a)&&!fc(a);){const c=fs(a),u=Wx(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Qd(a)&&!u&&_M(e,a))?r=r.filter(d=>d!==a):s=c,a=wa(a)}return t.set(e,r),r}function az(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?gh(t)?[]:oz(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((i,d)=>{const p=mC(t,d,s);return i.top=vr(p.top,i.top),i.right=Ds(p.right,i.right),i.bottom=Ds(p.bottom,i.bottom),i.left=vr(p.left,i.left),i},mC(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function iz(e){const{width:t,height:n}=TM(e);return{width:t,height:n}}function lz(e,t,n){const r=Vs(t),s=Mo(t),o=n==="fixed",a=Oi(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=ba(0);if(r||!r&&!o)if((_c(t)!=="body"||Qd(s))&&(c=hh(t)),r){const p=Oi(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else s&&(u.x=NM(s));const i=a.left+c.scrollLeft-u.x,d=a.top+c.scrollTop-u.y;return{x:i,y:d,width:a.width,height:a.height}}function Gm(e){return fs(e).position==="static"}function vC(e,t){return!Vs(e)||fs(e).position==="fixed"?null:t?t(e):e.offsetParent}function PM(e,t){const n=wr(e);if(gh(e))return n;if(!Vs(e)){let s=wa(e);for(;s&&!fc(s);){if(Us(s)&&!Gm(s))return s;s=wa(s)}return n}let r=vC(e,t);for(;r&&Q3(r)&&Gm(r);)r=vC(r,t);return r&&fc(r)&&Gm(r)&&!Wx(r)?n:r||Z3(e)||n}const cz=async function(e){const t=this.getOffsetParent||PM,n=this.getDimensions,r=await n(e.floating);return{reference:lz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uz(e){return fs(e).direction==="rtl"}const dz={convertOffsetParentRelativeRectToViewportRelativeRect:ez,getDocumentElement:Mo,getClippingRect:az,getOffsetParent:PM,getElementRects:cz,getClientRects:tz,getDimensions:iz,getScale:Ll,isElement:Us,isRTL:uz};function fz(e,t){let n=null,r;const s=Mo(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const{left:i,top:d,width:p,height:f}=e.getBoundingClientRect();if(c||t(),!p||!f)return;const g=Rf(d),h=Rf(s.clientWidth-(i+p)),m=Rf(s.clientHeight-(d+f)),x=Rf(i),y={rootMargin:-g+"px "+-h+"px "+-m+"px "+-x+"px",threshold:vr(0,Ds(1,u))||1};let w=!0;function S(E){const C=E[0].intersectionRatio;if(C!==u){if(!w)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(e)}return a(!0),o}function pz(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,i=Jx(e),d=s||o?[...i?pd(i):[],...pd(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const p=i&&c?fz(i,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(b=>{let[y]=b;y&&y.target===i&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),i&&!u&&g.observe(i),g.observe(t));let h,m=u?Oi(e):null;u&&x();function x(){const b=Oi(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,h=requestAnimationFrame(x)}return n(),()=>{var b;d.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),p==null||p(),(b=g)==null||b.disconnect(),g=null,u&&cancelAnimationFrame(h)}}const gz=q3,hz=W3,mz=V3,vz=J3,yz=H3,yC=U3,bz=G3,xz=(e,t,n)=>{const r=new Map,s={platform:dz,...n},o={...s.platform,_c:r};return z3(e,t,{...s,platform:o})};var hp=typeof document<"u"?v.useLayoutEffect:v.useEffect;function ig(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ig(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!ig(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bC(e,t){const n=RM(e);return Math.round(t*n)/n}function xC(e){const t=v.useRef(e);return hp(()=>{t.current=e}),t}function wz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:i}=e,[d,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=v.useState(r);ig(f,r)||g(r);const[h,m]=v.useState(null),[x,b]=v.useState(null),y=v.useCallback(J=>{J!==C.current&&(C.current=J,m(J))},[]),w=v.useCallback(J=>{J!==T.current&&(T.current=J,b(J))},[]),S=o||h,E=a||x,C=v.useRef(null),T=v.useRef(null),j=v.useRef(d),_=u!=null,O=xC(u),K=xC(s),I=v.useCallback(()=>{if(!C.current||!T.current)return;const J={placement:t,strategy:n,middleware:f};K.current&&(J.platform=K.current),xz(C.current,T.current,J).then(L=>{const A={...L,isPositioned:!0};Y.current&&!ig(j.current,A)&&(j.current=A,Pa.flushSync(()=>{p(A)}))})},[f,t,n,K]);hp(()=>{i===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,p(J=>({...J,isPositioned:!1})))},[i]);const Y=v.useRef(!1);hp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),hp(()=>{if(S&&(C.current=S),E&&(T.current=E),S&&E){if(O.current)return O.current(S,E,I);I()}},[S,E,I,O,_]);const q=v.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:w}),[y,w]),Z=v.useMemo(()=>({reference:S,floating:E}),[S,E]),ee=v.useMemo(()=>{const J={position:n,left:0,top:0};if(!Z.floating)return J;const L=bC(Z.floating,d.x),A=bC(Z.floating,d.y);return c?{...J,transform:"translate("+L+"px, "+A+"px)",...RM(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:A}},[n,c,Z.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:I,refs:q,elements:Z,floatingStyles:ee}),[d,I,q,Z,ee])}const Sz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yC({element:r.current,padding:s}).fn(n):{}:r?yC({element:r,padding:s}).fn(n):{}}}},Cz=(e,t)=>({...gz(e),options:[e,t]}),Ez=(e,t)=>({...hz(e),options:[e,t]}),kz=(e,t)=>({...bz(e),options:[e,t]}),jz=(e,t)=>({...mz(e),options:[e,t]}),Tz=(e,t)=>({...vz(e),options:[e,t]}),Mz=(e,t)=>({...yz(e),options:[e,t]}),Nz=(e,t)=>({...Sz(e),options:[e,t]});var _z="Arrow",OM=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return l.jsx(Ie.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});OM.displayName=_z;var Pz=OM;function IM(e){const[t,n]=v.useState(void 0);return pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,i=Array.isArray(u)?u[0]:u;a=i.inlineSize,c=i.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Qx="Popper",[DM,mh]=qr(Qx),[Rz,AM]=DM(Qx),FM=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return l.jsx(Rz,{scope:t,anchor:r,onAnchorChange:s,children:n})};FM.displayName=Qx;var LM="PopperAnchor",$M=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=AM(LM,n),a=v.useRef(null),c=ct(t,a);return v.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:l.jsx(Ie.div,{...s,ref:c})});$M.displayName=LM;var Zx="PopperContent",[Oz,Iz]=DM(Zx),BM=v.forwardRef((e,t)=>{var Q,Ee,Pe,Be,Re,ve;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:i=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:h,...m}=e,x=AM(Zx,n),[b,y]=v.useState(null),w=ct(t,ot=>y(ot)),[S,E]=v.useState(null),C=IM(S),T=(C==null?void 0:C.width)??0,j=(C==null?void 0:C.height)??0,_=r+(o!=="center"?"-"+o:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},K=Array.isArray(i)?i:[i],I=K.length>0,Y={padding:O,boundary:K.filter(Az),altBoundary:I},{refs:q,floatingStyles:Z,placement:ee,isPositioned:J,middlewareData:L}=wz({strategy:"fixed",placement:_,whileElementsMounted:(...ot)=>pz(...ot,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Cz({mainAxis:s+j,alignmentAxis:a}),u&&Ez({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kz():void 0,...Y}),u&&jz({...Y}),Tz({...Y,apply:({elements:ot,rects:Vt,availableWidth:tn,availableHeight:Xt})=>{const{width:ln,height:M}=Vt.reference,D=ot.floating.style;D.setProperty("--radix-popper-available-width",`${tn}px`),D.setProperty("--radix-popper-available-height",`${Xt}px`),D.setProperty("--radix-popper-anchor-width",`${ln}px`),D.setProperty("--radix-popper-anchor-height",`${M}px`)}}),S&&Nz({element:S,padding:c}),Fz({arrowWidth:T,arrowHeight:j}),f&&Mz({strategy:"referenceHidden",...Y})]}),[A,X]=VM(ee),fe=on(h);pn(()=>{J&&(fe==null||fe())},[J,fe]);const H=(Q=L.arrow)==null?void 0:Q.x,se=(Ee=L.arrow)==null?void 0:Ee.y,ne=((Pe=L.arrow)==null?void 0:Pe.centerOffset)!==0,[le,oe]=v.useState();return pn(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),l.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:J?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(Be=L.transformOrigin)==null?void 0:Be.x,(Re=L.transformOrigin)==null?void 0:Re.y].join(" "),...((ve=L.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Oz,{scope:n,placedSide:A,onArrowChange:E,arrowX:H,arrowY:se,shouldHideArrow:ne,children:l.jsx(Ie.div,{"data-side":A,"data-align":X,...m,ref:w,style:{...m.style,animation:J?void 0:"none"}})})})});BM.displayName=Zx;var zM="PopperArrow",Dz={top:"bottom",right:"left",bottom:"top",left:"right"},UM=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=Iz(zM,r),a=Dz[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(Pz,{...s,ref:n,style:{...s.style,display:"block"}})})});UM.displayName=zM;function Az(e){return e!==null}var Fz=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:n,rects:r,middlewareData:s}=t,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[i,d]=VM(n),p={start:"0%",center:"50%",end:"100%"}[d],f=(((b=s.arrow)==null?void 0:b.x)??0)+c/2,g=(((y=s.arrow)==null?void 0:y.y)??0)+u/2;let h="",m="";return i==="bottom"?(h=a?p:`${f}px`,m=`${-u}px`):i==="top"?(h=a?p:`${f}px`,m=`${r.floating.height+u}px`):i==="right"?(h=`${-u}px`,m=a?p:`${g}px`):i==="left"&&(h=`${r.floating.width+u}px`,m=a?p:`${g}px`),{data:{x:h,y:m}}}});function VM(e){const[t,n="center"]=e.split("-");return[t,n]}var HM=FM,KM=$M,qM=BM,WM=UM,Lz="Portal",vh=v.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=v.useState(!1);pn(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?lT.createPortal(l.jsx(Ie.div,{...r,ref:t}),a):null});vh.displayName=Lz;function $z(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var cr=e=>{const{present:t,children:n}=e,r=Bz(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=ct(r.ref,zz(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:o}):null};cr.displayName="Presence";function Bz(e){const[t,n]=v.useState(),r=v.useRef({}),s=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[c,u]=$z(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const i=Of(r.current);o.current=c==="mounted"?i:"none"},[c]),pn(()=>{const i=r.current,d=s.current;if(d!==e){const f=o.current,g=Of(i);e?u("MOUNT"):g==="none"||(i==null?void 0:i.display)==="none"?u("UNMOUNT"):u(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),pn(()=>{if(t){const i=p=>{const g=Of(r.current).includes(p.animationName);p.target===t&&g&&Pa.flushSync(()=>u("ANIMATION_END"))},d=p=>{p.target===t&&(o.current=Of(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(i=>{i&&(r.current=getComputedStyle(i)),n(i)},[])}}function Of(e){return(e==null?void 0:e.animationName)||"none"}function zz(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jm="rovingFocusGroup.onEntryFocus",Uz={bubbles:!1,cancelable:!0},yh="RovingFocusGroup",[Yy,GM,Vz]=Ux(yh),[Hz,bh]=qr(yh,[Vz]),[Kz,qz]=Hz(yh),JM=v.forwardRef((e,t)=>l.jsx(Yy.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Yy.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Wz,{...e,ref:t})})}));JM.displayName=yh;var Wz=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:i,preventScrollOnEntryFocus:d=!1,...p}=e,f=v.useRef(null),g=ct(t,f),h=Jd(o),[m=null,x]=ya({prop:a,defaultProp:c,onChange:u}),[b,y]=v.useState(!1),w=on(i),S=GM(n),E=v.useRef(!1),[C,T]=v.useState(0);return v.useEffect(()=>{const j=f.current;if(j)return j.addEventListener(Jm,w),()=>j.removeEventListener(Jm,w)},[w]),l.jsx(Kz,{scope:n,orientation:r,dir:h,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(j=>x(j),[x]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>T(j=>j+1),[]),onFocusableItemRemove:v.useCallback(()=>T(j=>j-1),[]),children:l.jsx(Ie.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{E.current=!0}),onFocus:Ce(e.onFocus,j=>{const _=!E.current;if(j.target===j.currentTarget&&_&&!b){const O=new CustomEvent(Jm,Uz);if(j.currentTarget.dispatchEvent(O),!O.defaultPrevented){const K=S().filter(ee=>ee.focusable),I=K.find(ee=>ee.active),Y=K.find(ee=>ee.id===m),Z=[I,Y,...K].filter(Boolean).map(ee=>ee.ref.current);YM(Z,d)}}E.current=!1}),onBlur:Ce(e.onBlur,()=>y(!1))})})}),QM="RovingFocusGroupItem",ZM=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...a}=e,c=is(),u=o||c,i=qz(QM,n),d=i.currentTabStopId===u,p=GM(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=i;return v.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),l.jsx(Yy.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(Ie.span,{tabIndex:d?0:-1,"data-orientation":i.orientation,...a,ref:t,onMouseDown:Ce(e.onMouseDown,h=>{r?i.onItemFocus(u):h.preventDefault()}),onFocus:Ce(e.onFocus,()=>i.onItemFocus(u)),onKeyDown:Ce(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){i.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const m=Qz(h,i.orientation,i.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let b=p().filter(y=>y.focusable).map(y=>y.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const y=b.indexOf(h.currentTarget);b=i.loop?Zz(b,y+1):b.slice(y+1)}setTimeout(()=>YM(b))}})})})});ZM.displayName=QM;var Gz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qz(e,t,n){const r=Jz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gz[r]}function YM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Zz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var XM=JM,eN=ZM,Yz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rl=new WeakMap,If=new WeakMap,Df={},Qm=0,tN=function(e){return e&&(e.host||tN(e.parentNode))},Xz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=tN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},eU=function(e,t,n,r){var s=Xz(t,Array.isArray(e)?e:[e]);Df[n]||(Df[n]=new WeakMap);var o=Df[n],a=[],c=new Set,u=new Set(s),i=function(p){!p||c.has(p)||(c.add(p),i(p.parentNode))};s.forEach(i);var d=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(f){if(c.has(f))d(f);else try{var g=f.getAttribute(r),h=g!==null&&g!=="false",m=(rl.get(f)||0)+1,x=(o.get(f)||0)+1;rl.set(f,m),o.set(f,x),a.push(f),m===1&&h&&If.set(f,!0),x===1&&f.setAttribute(n,"true"),h||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),c.clear(),Qm++,function(){a.forEach(function(p){var f=rl.get(p)-1,g=o.get(p)-1;rl.set(p,f),o.set(p,g),f||(If.has(p)||p.removeAttribute(r),If.delete(p)),g||p.removeAttribute(n)}),Qm--,Qm||(rl=new WeakMap,rl=new WeakMap,If=new WeakMap,Df={})}},Yx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Yz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),eU(r,s,n,"aria-hidden")):function(){return null}},Ps=function(){return Ps=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return vU;var t=yU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xU=oN(),$l="data-scroll-locked",wU=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),` - .`.concat(nU,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(c,"px ").concat(r,`; - } - body[`).concat($l,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(c,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(mp,` { - right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(vp,` { - margin-right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(mp," .").concat(mp,` { - right: 0 `).concat(r,`; - } - - .`).concat(vp," .").concat(vp,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat($l,`] { - `).concat(rU,": ").concat(c,`px; - } -`)},SC=function(){var e=parseInt(document.body.getAttribute($l)||"0",10);return isFinite(e)?e:0},SU=function(){v.useEffect(function(){return document.body.setAttribute($l,(SC()+1).toString()),function(){var e=SC()-1;e<=0?document.body.removeAttribute($l):document.body.setAttribute($l,e.toString())}},[])},CU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;SU();var o=v.useMemo(function(){return bU(s)},[s]);return v.createElement(xU,{styles:wU(o,!t,s,n?"":"!important")})},Xy=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return Xy=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{Xy=!1}var sl=Xy?{passive:!1}:!1,EU=function(e){return e.tagName==="TEXTAREA"},aN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EU(e)&&n[t]==="visible")},kU=function(e){return aN(e,"overflowY")},jU=function(e){return aN(e,"overflowX")},CC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=iN(e,r);if(s){var o=lN(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},MU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},iN=function(e,t){return e==="v"?kU(t):jU(t)},lN=function(e,t){return e==="v"?TU(t):MU(t)},NU=function(e,t){return e==="h"&&t==="rtl"?-1:1},_U=function(e,t,n,r,s){var o=NU(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),i=!1,d=a>0,p=0,f=0;do{var g=lN(e,c),h=g[0],m=g[1],x=g[2],b=m-x-o*h;(h||b)&&iN(e,c)&&(p+=b,f+=h),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(d&&(Math.abs(p)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(i=!0),i},Ff=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},EC=function(e){return[e.deltaX,e.deltaY]},kC=function(e){return e&&"current"in e?e.current:e},PU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RU=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},OU=0,ol=[];function IU(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(OU++)[0],o=v.useState(oN)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=tU([e.lockRef.current],(e.shards||[]).map(kC),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=Ff(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-b[0],S="deltaY"in m?m.deltaY:y[1]-b[1],E,C=m.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&T==="h"&&C.type==="range")return!1;var j=CC(T,C);if(!j)return!0;if(j?E=T:(E=T==="v"?"h":"v",j=CC(T,C)),!j)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=E),!E)return!0;var _=r.current||E;return _U(_,x,m,_==="h"?w:S,!0)},[]),u=v.useCallback(function(m){var x=m;if(!(!ol.length||ol[ol.length-1]!==o)){var b="deltaY"in x?EC(x):Ff(x),y=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&PU(E.delta,b)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(kC).filter(Boolean).filter(function(E){return E.contains(x.target)}),S=w.length>0?c(x,w[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),i=v.useCallback(function(m,x,b,y){var w={name:m,delta:x,target:b,should:y,shadowParent:DU(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(m){n.current=Ff(m),r.current=void 0},[]),p=v.useCallback(function(m){i(m.type,EC(m),m.target,c(m,e.lockRef.current))},[]),f=v.useCallback(function(m){i(m.type,Ff(m),m.target,c(m,e.lockRef.current))},[]);v.useEffect(function(){return ol.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",u,sl),document.addEventListener("touchmove",u,sl),document.addEventListener("touchstart",d,sl),function(){ol=ol.filter(function(m){return m!==o}),document.removeEventListener("wheel",u,sl),document.removeEventListener("touchmove",u,sl),document.removeEventListener("touchstart",d,sl)}},[]);var g=e.removeScrollBar,h=e.inert;return v.createElement(v.Fragment,null,h?v.createElement(o,{styles:RU(s)}):null,g?v.createElement(CU,{gapMode:e.gapMode}):null)}function DU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AU=uU(sN,IU);var wh=v.forwardRef(function(e,t){return v.createElement(xh,Ps({},e,{ref:t,sideCar:AU}))});wh.classNames=xh.classNames;var eb=["Enter"," "],FU=["ArrowDown","PageUp","Home"],cN=["ArrowUp","PageDown","End"],LU=[...FU,...cN],$U={ltr:[...eb,"ArrowRight"],rtl:[...eb,"ArrowLeft"]},BU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zd="Menu",[gd,zU,UU]=Ux(Zd),[Gi,uN]=qr(Zd,[UU,mh,bh]),Sh=mh(),dN=bh(),[VU,Ji]=Gi(Zd),[HU,Yd]=Gi(Zd),fN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=Sh(t),[u,i]=v.useState(null),d=v.useRef(!1),p=on(o),f=Jd(s);return v.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(HM,{...c,children:l.jsx(VU,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:i,children:l.jsx(HU,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};fN.displayName=Zd;var KU="MenuAnchor",Xx=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sh(n);return l.jsx(KM,{...s,...r,ref:t})});Xx.displayName=KU;var ew="MenuPortal",[qU,pN]=Gi(ew,{forceMount:void 0}),gN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Ji(ew,t);return l.jsx(qU,{scope:t,forceMount:n,children:l.jsx(cr,{present:n||o.open,children:l.jsx(vh,{asChild:!0,container:s,children:r})})})};gN.displayName=ew;var Vr="MenuContent",[WU,tw]=Gi(Vr),hN=v.forwardRef((e,t)=>{const n=pN(Vr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ji(Vr,e.__scopeMenu),a=Yd(Vr,e.__scopeMenu);return l.jsx(gd.Provider,{scope:e.__scopeMenu,children:l.jsx(cr,{present:r||o.open,children:l.jsx(gd.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(GU,{...s,ref:t}):l.jsx(JU,{...s,ref:t})})})})}),GU=v.forwardRef((e,t)=>{const n=Ji(Vr,e.__scopeMenu),r=v.useRef(null),s=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Yx(o)},[]),l.jsx(nw,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JU=v.forwardRef((e,t)=>{const n=Ji(Vr,e.__scopeMenu);return l.jsx(nw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nw=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:g,disableOutsideScroll:h,...m}=e,x=Ji(Vr,n),b=Yd(Vr,n),y=Sh(n),w=dN(n),S=zU(n),[E,C]=v.useState(null),T=v.useRef(null),j=ct(t,T,x.onContentChange),_=v.useRef(0),O=v.useRef(""),K=v.useRef(0),I=v.useRef(null),Y=v.useRef("right"),q=v.useRef(0),Z=h?wh:v.Fragment,ee=h?{as:wo,allowPinchZoom:!0}:void 0,J=A=>{var Q,Ee;const X=O.current+A,fe=S().filter(Pe=>!Pe.disabled),H=document.activeElement,se=(Q=fe.find(Pe=>Pe.ref.current===H))==null?void 0:Q.textValue,ne=fe.map(Pe=>Pe.textValue),le=i5(ne,X,se),oe=(Ee=fe.find(Pe=>Pe.textValue===le))==null?void 0:Ee.ref.current;(function Pe(Be){O.current=Be,window.clearTimeout(_.current),Be!==""&&(_.current=window.setTimeout(()=>Pe(""),1e3))})(X),oe&&setTimeout(()=>oe.focus())};v.useEffect(()=>()=>window.clearTimeout(_.current),[]),Vx();const L=v.useCallback(A=>{var fe,H;return Y.current===((fe=I.current)==null?void 0:fe.side)&&c5(A,(H=I.current)==null?void 0:H.area)},[]);return l.jsx(WU,{scope:n,searchRef:O,onItemEnter:v.useCallback(A=>{L(A)&&A.preventDefault()},[L]),onItemLeave:v.useCallback(A=>{var X;L(A)||((X=T.current)==null||X.focus(),C(null))},[L]),onTriggerLeave:v.useCallback(A=>{L(A)&&A.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:v.useCallback(A=>{I.current=A},[]),children:l.jsx(Z,{...ee,children:l.jsx(ph,{asChild:!0,trapped:s,onMountAutoFocus:Ce(o,A=>{var X;A.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(fh,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:g,children:l.jsx(XM,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:Ce(u,A=>{b.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(qM,{role:"menu","aria-orientation":"vertical","data-state":PN(x.open),"data-radix-menu-content":"",dir:b.dir,...y,...m,ref:j,style:{outline:"none",...m.style},onKeyDown:Ce(m.onKeyDown,A=>{const fe=A.target.closest("[data-radix-menu-content]")===A.currentTarget,H=A.ctrlKey||A.altKey||A.metaKey,se=A.key.length===1;fe&&(A.key==="Tab"&&A.preventDefault(),!H&&se&&J(A.key));const ne=T.current;if(A.target!==ne||!LU.includes(A.key))return;A.preventDefault();const oe=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);cN.includes(A.key)&&oe.reverse(),o5(oe)}),onBlur:Ce(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(_.current),O.current="")}),onPointerMove:Ce(e.onPointerMove,hd(A=>{const X=A.target,fe=q.current!==A.clientX;if(A.currentTarget.contains(X)&&fe){const H=A.clientX>q.current?"right":"left";Y.current=H,q.current=A.clientX}}))})})})})})})});hN.displayName=Vr;var QU="MenuGroup",rw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{role:"group",...r,ref:t})});rw.displayName=QU;var ZU="MenuLabel",mN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{...r,ref:t})});mN.displayName=ZU;var lg="MenuItem",jC="menu.itemSelect",Ch=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),a=Yd(lg,e.__scopeMenu),c=tw(lg,e.__scopeMenu),u=ct(t,o),i=v.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const f=new CustomEvent(jC,{bubbles:!0,cancelable:!0});p.addEventListener(jC,g=>r==null?void 0:r(g),{once:!0}),xM(p,f),f.defaultPrevented?i.current=!1:a.onClose()}};return l.jsx(vN,{...s,ref:u,disabled:n,onClick:Ce(e.onClick,d),onPointerDown:p=>{var f;(f=e.onPointerDown)==null||f.call(e,p),i.current=!0},onPointerUp:Ce(e.onPointerUp,p=>{var f;i.current||(f=p.currentTarget)==null||f.click()}),onKeyDown:Ce(e.onKeyDown,p=>{const f=c.searchRef.current!=="";n||f&&p.key===" "||eb.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ch.displayName=lg;var vN=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=tw(lg,n),c=dN(n),u=v.useRef(null),i=ct(t,u),[d,p]=v.useState(!1),[f,g]=v.useState("");return v.useEffect(()=>{const h=u.current;h&&g((h.textContent??"").trim())},[o.children]),l.jsx(gd.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:l.jsx(eN,{asChild:!0,...c,focusable:!r,children:l.jsx(Ie.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:i,onPointerMove:Ce(e.onPointerMove,hd(h=>{r?a.onItemLeave(h):(a.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,hd(h=>a.onItemLeave(h))),onFocus:Ce(e.onFocus,()=>p(!0)),onBlur:Ce(e.onBlur,()=>p(!1))})})})}),YU="MenuCheckboxItem",yN=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(CN,{scope:e.__scopeMenu,checked:n,children:l.jsx(Ch,{role:"menuitemcheckbox","aria-checked":cg(n)?"mixed":n,...s,ref:t,"data-state":ow(n),onSelect:Ce(s.onSelect,()=>r==null?void 0:r(cg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});yN.displayName=YU;var bN="MenuRadioGroup",[XU,e5]=Gi(bN,{value:void 0,onValueChange:()=>{}}),xN=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=on(r);return l.jsx(XU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(rw,{...s,ref:t})})});xN.displayName=bN;var wN="MenuRadioItem",SN=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=e5(wN,e.__scopeMenu),o=n===s.value;return l.jsx(CN,{scope:e.__scopeMenu,checked:o,children:l.jsx(Ch,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":ow(o),onSelect:Ce(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});SN.displayName=wN;var sw="MenuItemIndicator",[CN,t5]=Gi(sw,{checked:!1}),EN=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=t5(sw,n);return l.jsx(cr,{present:r||cg(o.checked)||o.checked===!0,children:l.jsx(Ie.span,{...s,ref:t,"data-state":ow(o.checked)})})});EN.displayName=sw;var n5="MenuSeparator",kN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kN.displayName=n5;var r5="MenuArrow",jN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sh(n);return l.jsx(WM,{...s,...r,ref:t})});jN.displayName=r5;var s5="MenuSub",[Xoe,TN]=Gi(s5),vu="MenuSubTrigger",MN=v.forwardRef((e,t)=>{const n=Ji(vu,e.__scopeMenu),r=Yd(vu,e.__scopeMenu),s=TN(vu,e.__scopeMenu),o=tw(vu,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,i={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),l.jsx(Xx,{asChild:!0,...i,children:l.jsx(vN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":PN(n.open),...e,ref:lh(t,s.onTriggerChange),onClick:p=>{var f;(f=e.onClick)==null||f.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,hd(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ce(e.onPointerLeave,hd(p=>{var g,h;d();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const m=(h=n.content)==null?void 0:h.dataset.side,x=m==="right",b=x?-5:5,y=f[x?"left":"right"],w=f[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:y,y:f.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,p=>{var g;const f=o.searchRef.current!=="";e.disabled||f&&p.key===" "||$U[r.dir].includes(p.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),p.preventDefault())})})})});MN.displayName=vu;var NN="MenuSubContent",_N=v.forwardRef((e,t)=>{const n=pN(Vr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ji(Vr,e.__scopeMenu),a=Yd(Vr,e.__scopeMenu),c=TN(NN,e.__scopeMenu),u=v.useRef(null),i=ct(t,u);return l.jsx(gd.Provider,{scope:e.__scopeMenu,children:l.jsx(cr,{present:r||o.open,children:l.jsx(gd.Slot,{scope:e.__scopeMenu,children:l.jsx(nw,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:i,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,d=>{d.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{var g;const p=d.currentTarget.contains(d.target),f=BU[a.dir].includes(d.key);p&&f&&(o.onOpenChange(!1),(g=c.trigger)==null||g.focus(),d.preventDefault())})})})})})});_N.displayName=NN;function PN(e){return e?"open":"closed"}function cg(e){return e==="indeterminate"}function ow(e){return cg(e)?"indeterminate":e?"checked":"unchecked"}function o5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function a5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function i5(e,t,n){const s=t.length>1&&Array.from(t).every(i=>i===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=a5(e,Math.max(o,0));s.length===1&&(a=a.filter(i=>i!==n));const u=a.find(i=>i.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function l5(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(i-c)*(r-u)/(d-u)+c&&(s=!s)}return s}function c5(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return l5(n,t)}function hd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var u5=fN,d5=Xx,f5=gN,p5=hN,g5=rw,h5=mN,m5=Ch,v5=yN,y5=xN,b5=SN,x5=EN,w5=kN,S5=jN,C5=MN,E5=_N,aw="DropdownMenu",[k5,eae]=qr(aw,[uN]),Yn=uN(),[j5,RN]=k5(aw),iw=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,u=Yn(t),i=v.useRef(null),[d=!1,p]=ya({prop:s,defaultProp:o,onChange:a});return l.jsx(j5,{scope:t,triggerId:is(),triggerRef:i,contentId:is(),open:d,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(f=>!f),[p]),modal:c,children:l.jsx(u5,{...u,open:d,onOpenChange:p,dir:r,modal:c,children:n})})};iw.displayName=aw;var ON="DropdownMenuTrigger",lw=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=RN(ON,n),a=Yn(n);return l.jsx(d5,{asChild:!0,...a,children:l.jsx(Ie.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:lh(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:Ce(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});lw.displayName=ON;var T5="DropdownMenuPortal",IN=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yn(t);return l.jsx(f5,{...r,...n})};IN.displayName=T5;var DN="DropdownMenuContent",AN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=RN(DN,n),o=Yn(n),a=v.useRef(!1);return l.jsx(p5,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,c=>{const u=c.detail.originalEvent,i=u.button===0&&u.ctrlKey===!0,d=u.button===2||i;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});AN.displayName=DN;var M5="DropdownMenuGroup",N5=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(g5,{...s,...r,ref:t})});N5.displayName=M5;var _5="DropdownMenuLabel",FN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(h5,{...s,...r,ref:t})});FN.displayName=_5;var P5="DropdownMenuItem",LN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(m5,{...s,...r,ref:t})});LN.displayName=P5;var R5="DropdownMenuCheckboxItem",$N=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(v5,{...s,...r,ref:t})});$N.displayName=R5;var O5="DropdownMenuRadioGroup",I5=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(y5,{...s,...r,ref:t})});I5.displayName=O5;var D5="DropdownMenuRadioItem",BN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(b5,{...s,...r,ref:t})});BN.displayName=D5;var A5="DropdownMenuItemIndicator",zN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(x5,{...s,...r,ref:t})});zN.displayName=A5;var F5="DropdownMenuSeparator",UN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(w5,{...s,...r,ref:t})});UN.displayName=F5;var L5="DropdownMenuArrow",$5=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(S5,{...s,...r,ref:t})});$5.displayName=L5;var B5="DropdownMenuSubTrigger",VN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(C5,{...s,...r,ref:t})});VN.displayName=B5;var z5="DropdownMenuSubContent",HN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(E5,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HN.displayName=z5;var U5=iw,V5=lw,H5=IN,KN=AN,qN=FN,WN=LN,GN=$N,JN=BN,QN=zN,Da=UN,ZN=VN,YN=HN;const ms=U5,vs=V5,K5=v.forwardRef(({className:e,inset:t,children:n,...r},s)=>l.jsxs(ZN,{ref:s,className:me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,l.jsx(zB,{className:"ml-auto h-4 w-4"})]}));K5.displayName=ZN.displayName;const q5=v.forwardRef(({className:e,...t},n)=>l.jsx(YN,{ref:n,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));q5.displayName=YN.displayName;const Mr=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(H5,{children:l.jsx(KN,{ref:r,sideOffset:t,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Mr.displayName=KN.displayName;const tt=v.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(WN,{ref:r,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));tt.displayName=WN.displayName;const XN=v.forwardRef(({className:e,children:t,checked:n,...r},s)=>l.jsxs(GN,{ref:s,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(QN,{children:l.jsx(mM,{className:"h-4 w-4"})})}),t]}));XN.displayName=GN.displayName;const W5=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(JN,{ref:r,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(QN,{children:l.jsx(KB,{className:"h-2 w-2 fill-current"})})}),t]}));W5.displayName=JN.displayName;const No=v.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(qN,{ref:r,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));No.displayName=qN.displayName;const Gs=v.forwardRef(({className:e,...t},n)=>l.jsx(Da,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Gs.displayName=Da.displayName;function G5(){const{t:e,i18n:t}=Te(),n=r=>{t.changeLanguage(r),localStorage.setItem("i18nextLng",r),window.location.reload()};return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"outline",size:"icon",children:[l.jsx(XB,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"}),l.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(tt,{className:t.language==="pt-BR"?"font-bold":"",onClick:()=>n("pt-BR"),children:e("header.language.portuguese")}),l.jsx(tt,{className:t.language==="en-US"?"font-bold":"",onClick:()=>n("en-US"),children:e("header.language.english")}),l.jsx(tt,{className:t.language==="es-ES"?"font-bold":"",onClick:()=>n("es-ES"),children:e("header.language.spanish")}),l.jsx(tt,{className:t.language==="fr-FR"?"font-bold":"",onClick:()=>n("fr-FR"),children:e("header.language.french")})]})]})}function J5(){const{t:e}=Te(),{setTheme:t}=Dx();return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"outline",size:"icon",children:[l.jsx(a3,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l.jsx(r3,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),l.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(tt,{onClick:()=>t("light"),children:e("header.theme.light")}),l.jsx(tt,{onClick:()=>t("dark"),children:e("header.theme.dark")}),l.jsx(tt,{onClick:()=>t("system"),children:e("header.theme.system")})]})]})}var cw="Avatar",[Q5,tae]=qr(cw),[Z5,e_]=Q5(cw),t_=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,o]=v.useState("idle");return l.jsx(Z5,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:l.jsx(Ie.span,{...r,ref:t})})});t_.displayName=cw;var n_="AvatarImage",r_=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=e,a=e_(n_,n),c=Y5(r),u=on(i=>{s(i),a.onImageLoadingStatusChange(i)});return pn(()=>{c!=="idle"&&u(c)},[c,u]),c==="loaded"?l.jsx(Ie.img,{...o,ref:t,src:r}):null});r_.displayName=n_;var s_="AvatarFallback",o_=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,o=e_(s_,n),[a,c]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?l.jsx(Ie.span,{...s,ref:t}):null});o_.displayName=s_;function Y5(e){const[t,n]=v.useState("idle");return pn(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,()=>{r=!1}},[e]),t}var a_=t_,i_=r_,l_=o_;const Eh=v.forwardRef(({className:e,...t},n)=>l.jsx(a_,{ref:n,className:me("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Eh.displayName=a_.displayName;const kh=v.forwardRef(({className:e,...t},n)=>l.jsx(i_,{ref:n,className:me("aspect-square h-full w-full",e),...t}));kh.displayName=i_.displayName;const X5=v.forwardRef(({className:e,...t},n)=>l.jsx(l_,{ref:n,className:me("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));X5.displayName=l_.displayName;var uw="Dialog",[c_,nae]=qr(uw),[eV,ys]=c_(uw),u_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=v.useRef(null),u=v.useRef(null),[i=!1,d]=ya({prop:r,defaultProp:s,onChange:o});return l.jsx(eV,{scope:t,triggerRef:c,contentRef:u,contentId:is(),titleId:is(),descriptionId:is(),open:i,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(p=>!p),[d]),modal:a,children:n})};u_.displayName=uw;var d_="DialogTrigger",f_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(d_,n),o=ct(t,s.triggerRef);return l.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":pw(s.open),...r,ref:o,onClick:Ce(e.onClick,s.onOpenToggle)})});f_.displayName=d_;var dw="DialogPortal",[tV,p_]=c_(dw,{forceMount:void 0}),g_=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=ys(dw,t);return l.jsx(tV,{scope:t,forceMount:n,children:v.Children.map(r,a=>l.jsx(cr,{present:n||o.open,children:l.jsx(vh,{asChild:!0,container:s,children:a})}))})};g_.displayName=dw;var ug="DialogOverlay",h_=v.forwardRef((e,t)=>{const n=p_(ug,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ys(ug,e.__scopeDialog);return o.modal?l.jsx(cr,{present:r||o.open,children:l.jsx(nV,{...s,ref:t})}):null});h_.displayName=ug;var nV=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(ug,n);return l.jsx(wh,{as:wo,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Ie.div,{"data-state":pw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ii="DialogContent",m_=v.forwardRef((e,t)=>{const n=p_(Ii,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ys(Ii,e.__scopeDialog);return l.jsx(cr,{present:r||o.open,children:o.modal?l.jsx(rV,{...s,ref:t}):l.jsx(sV,{...s,ref:t})})});m_.displayName=Ii;var rV=v.forwardRef((e,t)=>{const n=ys(Ii,e.__scopeDialog),r=v.useRef(null),s=ct(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Yx(o)},[]),l.jsx(v_,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())})}),sV=v.forwardRef((e,t)=>{const n=ys(Ii,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return l.jsx(v_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,i;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((i=n.triggerRef.current)==null?void 0:i.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),v_=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=ys(Ii,n),u=v.useRef(null),i=ct(t,u);return Vx(),l.jsxs(l.Fragment,{children:[l.jsx(ph,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(fh,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":pw(c.open),...a,ref:i,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(oV,{titleId:c.titleId}),l.jsx(iV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),fw="DialogTitle",y_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(fw,n);return l.jsx(Ie.h2,{id:s.titleId,...r,ref:t})});y_.displayName=fw;var b_="DialogDescription",x_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(b_,n);return l.jsx(Ie.p,{id:s.descriptionId,...r,ref:t})});x_.displayName=b_;var w_="DialogClose",S_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(w_,n);return l.jsx(Ie.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>s.onOpenChange(!1))})});S_.displayName=w_;function pw(e){return e?"open":"closed"}var C_="DialogTitleWarning",[rae,E_]=d3(C_,{contentName:Ii,titleName:fw,docsSlug:"dialog"}),oV=({titleId:e})=>{const t=E_(C_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aV="DialogDescriptionWarning",iV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${E_(aV).contentName}}.`;return v.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},lV=u_,cV=f_,uV=g_,k_=h_,j_=m_,T_=y_,M_=x_,N_=S_;const pt=lV,mt=cV,dV=uV,__=N_,P_=v.forwardRef(({className:e,...t},n)=>l.jsx(k_,{ref:n,className:me("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));P_.displayName=k_.displayName;const ut=v.forwardRef(({className:e,children:t,closeBtn:n=!0,...r},s)=>l.jsx(dV,{children:l.jsx(P_,{className:"fixed inset-0 grid place-items-center overflow-y-auto",children:l.jsxs(j_,{ref:s,className:me("relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:m-4 sm:rounded-lg md:w-full",e),...r,children:[t,n&&l.jsxs(N_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(l3,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})})}));ut.displayName=j_.displayName;const dt=({className:e,...t})=>l.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dt.displayName="DialogHeader";const _t=({className:e,...t})=>l.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_t.displayName="DialogFooter";const yt=v.forwardRef(({className:e,...t},n)=>l.jsx(T_,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));yt.displayName=T_.displayName;const _o=v.forwardRef(({className:e,...t},n)=>l.jsx(M_,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));_o.displayName=M_.displayName;function R_({instanceId:e}){const[t,n]=v.useState(!1),r=an(),{theme:s}=Dx(),o=()=>{FT(),r("/manager/login")},a=()=>{r("/manager/")},{data:c}=bM({instanceId:e});return l.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[l.jsx(ld,{to:"/manager",onClick:a,className:"flex h-8 items-center gap-4",children:l.jsx("img",{src:s==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"Logo",className:"h-full"})}),l.jsxs("div",{className:"flex items-center gap-4",children:[e&&l.jsx(Eh,{className:"h-8 w-8",children:l.jsx(kh,{src:(c==null?void 0:c.profilePicUrl)||"/assets/images/evolution-logo.png",alt:c==null?void 0:c.name})}),l.jsx(G5,{}),l.jsx(J5,{}),l.jsx(z,{onClick:()=>n(!0),variant:"destructive",size:"icon",children:l.jsx(WB,{size:"18"})})]}),t&&l.jsx(pt,{onOpenChange:n,open:t,children:l.jsxs(ut,{children:[l.jsx(__,{}),l.jsx(dt,{children:"Deseja realmente sair?"}),l.jsx(_t,{children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(z,{onClick:()=>n(!1),size:"sm",variant:"outline",children:"Cancelar"}),l.jsx(z,{onClick:o,variant:"destructive",children:"Sair"})]})})]})})]})}const O_=v.createContext(null),Ve=()=>{const e=v.useContext(O_);if(!e)throw new Error("useInstance must be used within an InstanceProvider");return e},fV=({children:e})=>{const t=gs(),[n,r]=v.useState(null),{data:s,refetch:o}=bM({instanceId:n});return v.useEffect(()=>{t.instanceId?r(t.instanceId):r(null)},[t]),l.jsx(O_.Provider,{value:{instance:s??null,reloadInstance:async()=>{await o()}},children:e})};var gw="Collapsible",[pV,sae]=qr(gw),[gV,hw]=pV(gw),I_=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:a,...c}=e,[u=!1,i]=ya({prop:r,defaultProp:s,onChange:a});return l.jsx(gV,{scope:n,disabled:o,contentId:is(),open:u,onOpenToggle:v.useCallback(()=>i(d=>!d),[i]),children:l.jsx(Ie.div,{"data-state":vw(u),"data-disabled":o?"":void 0,...c,ref:t})})});I_.displayName=gw;var D_="CollapsibleTrigger",A_=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=hw(D_,n);return l.jsx(Ie.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":vw(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ce(e.onClick,s.onOpenToggle)})});A_.displayName=D_;var mw="CollapsibleContent",F_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=hw(mw,e.__scopeCollapsible);return l.jsx(cr,{present:n||s.open,children:({present:o})=>l.jsx(hV,{...r,ref:t,present:o})})});F_.displayName=mw;var hV=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,a=hw(mw,n),[c,u]=v.useState(r),i=v.useRef(null),d=ct(t,i),p=v.useRef(0),f=p.current,g=v.useRef(0),h=g.current,m=a.open||c,x=v.useRef(m),b=v.useRef();return v.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),pn(()=>{const y=i.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,g.current=w.width,x.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),u(r)}},[a.open,r]),l.jsx(Ie.div,{"data-state":vw(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...o,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:m&&s})});function vw(e){return e?"open":"closed"}var mV=I_;const vV=mV,yV=A_,bV=F_;function xV(){const{t:e}=Te(),t=v.useMemo(()=>[{id:"dashboard",title:e("sidebar.dashboard"),icon:e3,path:"dashboard"},{navLabel:!0,title:e("sidebar.configurations"),icon:To,children:[{id:"settings",title:e("sidebar.settings"),path:"settings"},{id:"proxy",title:e("sidebar.proxy"),path:"proxy"}]},{title:e("sidebar.events"),icon:YB,children:[{id:"webhook",title:e("sidebar.webhook"),path:"webhook"},{id:"websocket",title:e("sidebar.websocket"),path:"websocket"},{id:"rabbitmq",title:e("sidebar.rabbitmq"),path:"rabbitmq"},{id:"sqs",title:e("sidebar.sqs"),path:"sqs"}]},{title:e("sidebar.integrations"),icon:yM,children:[{id:"evoai",title:e("sidebar.evoai"),path:"evoai"},{id:"n8n",title:e("sidebar.n8n"),path:"n8n"},{id:"evolutionBot",title:e("sidebar.evolutionBot"),path:"evolutionBot"},{id:"chatwoot",title:e("sidebar.chatwoot"),path:"chatwoot"},{id:"typebot",title:e("sidebar.typebot"),path:"typebot"},{id:"openai",title:e("sidebar.openai"),path:"openai"},{id:"dify",title:e("sidebar.dify"),path:"dify"},{id:"flowise",title:e("sidebar.flowise"),path:"flowise"}]},{id:"documentation",title:e("sidebar.documentation"),icon:QB,link:"https://doc.evolution-api.com",divider:!0},{id:"postman",title:e("sidebar.postman"),icon:HB,link:"https://evolution-api.com/postman"},{id:"discord",title:e("sidebar.discord"),icon:dh,link:"https://evolution-api.com/discord"},{id:"support-premium",title:e("sidebar.supportPremium"),icon:t3,link:"https://evolution-api.com/suporte-pro"}],[e]),n=an(),{pathname:r}=kc(),{instance:s}=Ve(),o=c=>{!c||!s||(c.path&&n(`/manager/instance/${s.id}/${c.path}`),c.link&&window.open(c.link,"_blank"))},a=v.useMemo(()=>t.map(c=>{var u;return{...c,children:"children"in c?(u=c.children)==null?void 0:u.map(i=>({...i,isActive:"path"in i?r.includes(i.path):!1})):void 0,isActive:"path"in c&&c.path?r.includes(c.path):!1}}).map(c=>{var u;return{...c,isActive:c.isActive||"children"in c&&((u=c.children)==null?void 0:u.some(i=>i.isActive))}}),[t,r]);return l.jsx("ul",{className:"flex h-full w-full flex-col gap-2 border-r border-border px-2",children:a.map(c=>l.jsx("li",{className:"divider"in c?"mt-auto":void 0,children:c.children?l.jsxs(vV,{defaultOpen:c.isActive,children:[l.jsx(yV,{asChild:!0,children:l.jsxs(z,{className:me("flex w-full items-center justify-start gap-2"),variant:c.isActive?"secondary":"link",children:[c.icon&&l.jsx(c.icon,{size:"15"}),l.jsx("span",{children:c.title}),l.jsx(uh,{size:"15",className:"ml-auto"})]})}),l.jsx(bV,{children:l.jsx("ul",{className:"my-4 ml-6 flex flex-col gap-2 text-sm",children:c.children.map(u=>l.jsx("li",{children:l.jsx("button",{onClick:()=>o(u),className:me(u.isActive?"text-foreground":"text-muted-foreground"),children:l.jsx("span",{className:"nav-label",children:u.title})})},u.id))})})]}):l.jsxs(z,{className:me("relative flex w-full items-center justify-start gap-2",c.isActive&&"pointer-events-none"),variant:c.isActive?"secondary":"link",children:["link"in c&&l.jsx("a",{href:c.link,target:"_blank",rel:"noreferrer",className:"absolute inset-0 h-full w-full"}),"path"in c&&l.jsx(ld,{to:`/manager/instance/${s==null?void 0:s.id}/${c.path}`,className:"absolute inset-0 h-full w-full"}),c.icon&&l.jsx(c.icon,{size:"15"}),l.jsx("span",{children:c.title})]})},c.title))})}function tb(e,[t,n]){return Math.min(n,Math.max(t,e))}function wV(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var yw="ScrollArea",[L_,oae]=qr(yw),[SV,Wr]=L_(yw),$_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[c,u]=v.useState(null),[i,d]=v.useState(null),[p,f]=v.useState(null),[g,h]=v.useState(null),[m,x]=v.useState(null),[b,y]=v.useState(0),[w,S]=v.useState(0),[E,C]=v.useState(!1),[T,j]=v.useState(!1),_=ct(t,K=>u(K)),O=Jd(s);return l.jsx(SV,{scope:n,type:r,dir:O,scrollHideDelay:o,scrollArea:c,viewport:i,onViewportChange:d,content:p,onContentChange:f,scrollbarX:g,onScrollbarXChange:h,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:T,onScrollbarYEnabledChange:j,onCornerWidthChange:y,onCornerHeightChange:S,children:l.jsx(Ie.div,{dir:O,...a,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});$_.displayName=yw;var B_="ScrollAreaViewport",z_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=Wr(B_,n),c=v.useRef(null),u=ct(t,c,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});z_.displayName=B_;var Js="ScrollAreaScrollbar",bw=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Wr(Js,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,c=e.orientation==="horizontal";return v.useEffect(()=>(c?o(!0):a(!0),()=>{c?o(!1):a(!1)}),[c,o,a]),s.type==="hover"?l.jsx(CV,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(EV,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(U_,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx(xw,{...r,ref:t}):null});bw.displayName=Js;var CV=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Wr(Js,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const c=s.scrollArea;let u=0;if(c){const i=()=>{window.clearTimeout(u),a(!0)},d=()=>{u=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",i),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",i),c.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(cr,{present:n||o,children:l.jsx(U_,{"data-state":o?"visible":"hidden",...r,ref:t})})}),EV=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Wr(Js,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Th(()=>u("SCROLL_END"),100),[c,u]=wV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(c==="idle"){const i=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(i)}},[c,s.scrollHideDelay,u]),v.useEffect(()=>{const i=s.viewport,d=o?"scrollLeft":"scrollTop";if(i){let p=i[d];const f=()=>{const g=i[d];p!==g&&(u("SCROLL"),a()),p=g};return i.addEventListener("scroll",f),()=>i.removeEventListener("scroll",f)}},[s.viewport,o,u,a]),l.jsx(cr,{present:n||c!=="hidden",children:l.jsx(xw,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),U_=v.forwardRef((e,t)=>{const n=Wr(Js,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=v.useState(!1),c=e.orientation==="horizontal",u=Th(()=>{if(n.viewport){const i=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=Wr(Js,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[c,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),i=W_(c.viewport,c.content),d={...r,sizes:c,onSizesChange:u,hasThumb:i>0&&i<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function p(f,g){return _V(f,a.current,c,g)}return n==="horizontal"?l.jsx(kV,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,g=TC(f,c,s.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=p(f,s.dir))}}):n==="vertical"?l.jsx(jV,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,g=TC(f,c);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=p(f))}}):null}),kV=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Wr(Js,e.__scopeScrollArea),[a,c]=v.useState(),u=v.useRef(null),i=ct(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(H_,{"data-orientation":"horizontal",...s,ref:i,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const f=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),J_(f,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:fg(a.paddingLeft),paddingEnd:fg(a.paddingRight)}})}})}),jV=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Wr(Js,e.__scopeScrollArea),[a,c]=v.useState(),u=v.useRef(null),i=ct(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(H_,{"data-orientation":"vertical",...s,ref:i,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const f=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),J_(f,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:fg(a.paddingTop),paddingEnd:fg(a.paddingBottom)}})}})}),[TV,V_]=L_(Js),H_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:i,onWheelScroll:d,onResize:p,...f}=e,g=Wr(Js,n),[h,m]=v.useState(null),x=ct(t,_=>m(_)),b=v.useRef(null),y=v.useRef(""),w=g.viewport,S=r.content-r.viewport,E=on(d),C=on(u),T=Th(p,10);function j(_){if(b.current){const O=_.clientX-b.current.left,K=_.clientY-b.current.top;i({x:O,y:K})}}return v.useEffect(()=>{const _=O=>{const K=O.target;(h==null?void 0:h.contains(K))&&E(O,S)};return document.addEventListener("wheel",_,{passive:!1}),()=>document.removeEventListener("wheel",_,{passive:!1})},[w,h,S,E]),v.useEffect(C,[r,C]),pc(h,T),pc(g.content,T),l.jsx(TV,{scope:n,scrollbar:h,hasThumb:s,onThumbChange:on(o),onThumbPointerUp:on(a),onThumbPositionChange:C,onThumbPointerDown:on(c),children:l.jsx(Ie.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:Ce(e.onPointerDown,_=>{_.button===0&&(_.target.setPointerCapture(_.pointerId),b.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),j(_))}),onPointerMove:Ce(e.onPointerMove,j),onPointerUp:Ce(e.onPointerUp,_=>{const O=_.target;O.hasPointerCapture(_.pointerId)&&O.releasePointerCapture(_.pointerId),document.body.style.webkitUserSelect=y.current,g.viewport&&(g.viewport.style.scrollBehavior=""),b.current=null})})})}),dg="ScrollAreaThumb",K_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=V_(dg,e.__scopeScrollArea);return l.jsx(cr,{present:n||s.hasThumb,children:l.jsx(MV,{ref:t,...r})})}),MV=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=Wr(dg,n),a=V_(dg,n),{onThumbPositionChange:c}=a,u=ct(t,p=>a.onThumbChange(p)),i=v.useRef(),d=Th(()=>{i.current&&(i.current(),i.current=void 0)},100);return v.useEffect(()=>{const p=o.viewport;if(p){const f=()=>{if(d(),!i.current){const g=PV(p,c);i.current=g,c()}};return c(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[o.viewport,d,c]),l.jsx(Ie.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),h=p.clientX-g.left,m=p.clientY-g.top;a.onThumbPointerDown({x:h,y:m})}),onPointerUp:Ce(e.onPointerUp,a.onThumbPointerUp)})});K_.displayName=dg;var ww="ScrollAreaCorner",q_=v.forwardRef((e,t)=>{const n=Wr(ww,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(NV,{...e,ref:t}):null});q_.displayName=ww;var NV=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Wr(ww,n),[o,a]=v.useState(0),[c,u]=v.useState(0),i=!!(o&&c);return pc(s.scrollbarX,()=>{var p;const d=((p=s.scrollbarX)==null?void 0:p.offsetHeight)||0;s.onCornerHeightChange(d),u(d)}),pc(s.scrollbarY,()=>{var p;const d=((p=s.scrollbarY)==null?void 0:p.offsetWidth)||0;s.onCornerWidthChange(d),a(d)}),i?l.jsx(Ie.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function fg(e){return e?parseInt(e,10):0}function W_(e,t){const n=e/t;return isNaN(n)?0:n}function jh(e){const t=W_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _V(e,t,n,r="ltr"){const s=jh(n),o=s/2,a=t||o,c=s-a,u=n.scrollbar.paddingStart+a,i=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,p=r==="ltr"?[0,d]:[d*-1,0];return G_([u,i],p)(e)}function TC(e,t,n="ltr"){const r=jh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,c=o-r,u=n==="ltr"?[0,a]:[a*-1,0],i=tb(e,u);return G_([0,a],[0,c])(i)}function G_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function J_(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,c=n.top!==o.top;(a||c)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Th(e,t){const n=on(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function pc(e,t){const n=on(t);pn(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var Q_=$_,RV=z_,OV=q_;const nb=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Q_,{ref:r,className:me("relative overflow-hidden",e),...n,children:[l.jsx(RV,{className:"h-full w-full rounded-[inherit] [&>div[style]]:!block [&>div[style]]:h-full",children:t}),l.jsx(Z_,{}),l.jsx(OV,{})]}));nb.displayName=Q_.displayName;const Z_=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(bw,{ref:r,orientation:t,className:me("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:l.jsx(K_,{className:me("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));Z_.displayName=bw.displayName;function Lt({children:e}){const{instanceId:t}=gs();return l.jsx(fV,{children:l.jsxs("div",{className:"flex h-screen flex-col",children:[l.jsx(R_,{instanceId:t}),l.jsxs("div",{className:"flex min-h-[calc(100vh_-_56px)] flex-1 flex-col md:flex-row",children:[l.jsx(nb,{className:"mr-2 py-6 md:w-64",children:l.jsx("div",{className:"flex h-full",children:l.jsx(xV,{})})}),l.jsx(nb,{className:"w-full",children:l.jsxs("div",{className:"flex h-full flex-col",children:[l.jsx("div",{className:"my-6 flex flex-1 flex-col gap-2 pl-2 pr-4",children:e}),l.jsx(zx,{})]})})]})]})})}function IV({children:e}){return l.jsxs("div",{className:"flex h-full min-h-screen flex-col",children:[l.jsx(R_,{}),l.jsx("main",{className:"flex-1",children:e}),l.jsx(zx,{})]})}const DV=ch("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",warning:"border-transparent bg-amber-600 text-amber-100 hover:bg-amber-600/80"}},defaultVariants:{variant:"default"}});function Lf({className:e,variant:t,...n}){return l.jsx("div",{className:me(DV({variant:t}),e),...n})}function Y_({status:e}){const{t}=Te();return e?e==="open"?l.jsx(Lf,{children:t("status.open")}):e==="connecting"?l.jsx(Lf,{variant:"warning",children:t("status.connecting")}):e==="close"||e==="closed"?l.jsx(Lf,{variant:"destructive",children:t("status.closed")}):l.jsx(Lf,{variant:"secondary",children:e}):null}const AV=e=>{navigator.clipboard.writeText(e),G.success("Copiado para a área de transferência")};function X_({token:e,className:t}){const[n,r]=v.useState(!1);return l.jsxs("div",{className:me("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",t),children:[l.jsx("pre",{className:"block truncate text-xs",children:n?e:e==null?void 0:e.replace(/\w/g,"*")}),l.jsx(z,{variant:"ghost",size:"icon",onClick:()=>{AV(e)},children:l.jsx(qB,{size:"15"})}),l.jsx(z,{variant:"ghost",size:"icon",onClick:()=>{r(s=>!s)},children:n?l.jsx(GB,{size:"15"}):l.jsx(JB,{size:"15"})})]})}const oi=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("flex flex-col rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));oi.displayName="Card";const ai=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));ai.displayName="CardHeader";const Iu=v.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));Iu.displayName="CardTitle";const eP=v.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));eP.displayName="CardDescription";const ii=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));ii.displayName="CardContent";const Mh=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));Mh.displayName="CardFooter";const tP="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",F=v.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:me(tP,e),ref:r,...n}));F.displayName="Input";const FV=["instance","fetchInstances"],LV=async()=>(await Gd.get("/instance/fetchInstances")).data,$V=e=>qe({...e,queryKey:FV,queryFn:()=>LV()});function Le(e,t){const n=Bb(),r=oA({mutationFn:e});return(s,o)=>r.mutateAsync(s,{onSuccess:async(a,c,u)=>{var i;t!=null&&t.invalidateKeys&&await Promise.all(t.invalidateKeys.map(d=>n.invalidateQueries({queryKey:d}))),(i=o==null?void 0:o.onSuccess)==null||i.call(o,a,c,u)},onError(a,c,u){var i;(i=o==null?void 0:o.onError)==null||i.call(o,a,c,u)},onSettled(a,c,u,i){var d;(d=o==null?void 0:o.onSettled)==null||d.call(o,a,c,u,i)}})}const BV=async e=>(await Gd.post("/instance/create",e)).data,zV=async e=>(await ie.post(`/instance/restart/${e}`)).data,UV=async e=>(await ie.delete(`/instance/logout/${e}`)).data,VV=async e=>(await Gd.delete(`/instance/delete/${e}`)).data,HV=async({instanceName:e,token:t,number:n})=>(await ie.get(`/instance/connect/${e}`,{headers:{apikey:t},params:{number:n}})).data,KV=async({instanceName:e,token:t,data:n})=>(await ie.post(`/settings/set/${e}`,n,{headers:{apikey:t}})).data;function Nh(){const e=Le(HV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),t=Le(KV,{invalidateKeys:[["instance","fetchSettings"]]}),n=Le(VV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),r=Le(UV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),s=Le(zV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),o=Le(BV,{invalidateKeys:[["instance","fetchInstances"]]});return{connect:e,updateSettings:t,deleteInstance:n,logout:r,restart:s,createInstance:o}}var Xd=e=>e.type==="checkbox",Ml=e=>e instanceof Date,qn=e=>e==null;const nP=e=>typeof e=="object";var gn=e=>!qn(e)&&!Array.isArray(e)&&nP(e)&&!Ml(e),rP=e=>gn(e)&&e.target?Xd(e.target)?e.target.checked:e.target.value:e,qV=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,sP=(e,t)=>e.has(qV(t)),WV=e=>{const t=e.constructor&&e.constructor.prototype;return gn(t)&&t.hasOwnProperty("isPrototypeOf")},Sw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xn(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Sw&&(e instanceof Blob||e instanceof FileList))&&(n||gn(e)))if(t=n?[]:{},!n&&!WV(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Xn(e[r]));else return e;return t}var _h=e=>Array.isArray(e)?e.filter(Boolean):[],Yt=e=>e===void 0,de=(e,t,n)=>{if(!t||!gn(e))return n;const r=_h(t.split(/[,[\].]+?/)).reduce((s,o)=>qn(s)?s:s[o],e);return Yt(r)||r===e?Yt(e[t])?n:e[t]:r},Rs=e=>typeof e=="boolean",Cw=e=>/^\w*$/.test(e),oP=e=>_h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),xt=(e,t,n)=>{let r=-1;const s=Cw(t)?[t]:oP(t),o=s.length,a=o-1;for(;++rje.useContext(aP),Mn=e=>{const{children:t,...n}=e;return je.createElement(aP.Provider,{value:n},t)};var iP=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==ts.all&&(t._proxyFormState[a]=!r||ts.all),n&&(n[a]=!0),e[a]}});return s},pr=e=>gn(e)&&!Object.keys(e).length,lP=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return pr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||ts.all))},Du=e=>Array.isArray(e)?e:[e],cP=(e,t,n)=>!e||!t||e===t||Du(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Ew(e){const t=je.useRef(e);t.current=e,je.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function GV(e){const t=Ph(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[a,c]=je.useState(n._formState),u=je.useRef(!0),i=je.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=je.useRef(s);return d.current=s,Ew({disabled:r,next:p=>u.current&&cP(d.current,p.name,o)&&lP(p,i.current,n._updateFormState)&&c({...n._formState,...p}),subject:n._subjects.state}),je.useEffect(()=>(u.current=!0,i.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),iP(a,n,i.current,!1)}var As=e=>typeof e=="string",uP=(e,t,n,r,s)=>As(e)?(r&&t.watch.add(e),de(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),de(n,o))):(r&&(t.watchAll=!0),n);function JV(e){const t=Ph(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:a}=e||{},c=je.useRef(r);c.current=r,Ew({disabled:o,subject:n._subjects.values,next:d=>{cP(c.current,d.name,a)&&i(Xn(uP(c.current,n._names,d.values||n._formValues,!1,s)))}});const[u,i]=je.useState(n._getWatch(r,s));return je.useEffect(()=>n._removeUnmounted()),u}function QV(e){const t=Ph(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,a=sP(s._names.array,n),c=JV({control:s,name:n,defaultValue:de(s._formValues,n,de(s._defaultValues,n,e.defaultValue)),exact:!0}),u=GV({control:s,name:n}),i=je.useRef(s.register(n,{...e.rules,value:c,...Rs(e.disabled)?{disabled:e.disabled}:{}}));return je.useEffect(()=>{const d=s._options.shouldUnregister||o,p=(f,g)=>{const h=de(s._fields,f);h&&h._f&&(h._f.mount=g)};if(p(n,!0),d){const f=Xn(de(s._options.defaultValues,n));xt(s._defaultValues,n,f),Yt(de(s._formValues,n))&&xt(s._formValues,n,f)}return()=>{(a?d&&!s._state.action:d)?s.unregister(n):p(n,!1)}},[n,s,a,o]),je.useEffect(()=>{de(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:de(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:c,...Rs(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:je.useCallback(d=>i.current.onChange({target:{value:rP(d),name:n},type:pg.CHANGE}),[n]),onBlur:je.useCallback(()=>i.current.onBlur({target:{value:de(s._formValues,n),name:n},type:pg.BLUR}),[n,s]),ref:d=>{const p=de(s._fields,n);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:f=>d.setCustomValidity(f),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(u.validatingFields,n)},error:{enumerable:!0,get:()=>de(u.errors,n)}})}}const ZV=e=>e.render(QV(e));var dP=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},MC=e=>({isOnSubmit:!e||e===ts.onSubmit,isOnBlur:e===ts.onBlur,isOnChange:e===ts.onChange,isOnAll:e===ts.all,isOnTouch:e===ts.onTouched}),NC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Au=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=de(e,s);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!r)break;if(a.ref&&t(a.ref,a.name)&&!r)break;Au(c,t)}else gn(c)&&Au(c,t)}}};var YV=(e,t,n)=>{const r=Du(de(e,n));return xt(r,"root",t[n]),xt(e,n,r),e},kw=e=>e.type==="file",aa=e=>typeof e=="function",gg=e=>{if(!Sw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},yp=e=>As(e),jw=e=>e.type==="radio",hg=e=>e instanceof RegExp;const _C={value:!1,isValid:!1},PC={value:!0,isValid:!0};var fP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Yt(e[0].attributes.value)?Yt(e[0].value)||e[0].value===""?PC:{value:e[0].value,isValid:!0}:PC:_C}return _C};const RC={isValid:!1,value:null};var pP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,RC):RC;function OC(e,t,n="validate"){if(yp(e)||Array.isArray(e)&&e.every(yp)||Rs(e)&&!e)return{type:n,message:yp(e)?e:"",ref:t}}var al=e=>gn(e)&&!hg(e)?e:{value:e,message:""},IC=async(e,t,n,r,s)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:i,min:d,max:p,pattern:f,validate:g,name:h,valueAsNumber:m,mount:x,disabled:b}=e._f,y=de(t,h);if(!x||b)return{};const w=a?a[0]:o,S=I=>{r&&w.reportValidity&&(w.setCustomValidity(Rs(I)?"":I||""),w.reportValidity())},E={},C=jw(o),T=Xd(o),j=C||T,_=(m||kw(o))&&Yt(o.value)&&Yt(y)||gg(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,O=dP.bind(null,h,n,E),K=(I,Y,q,Z=Ys.maxLength,ee=Ys.minLength)=>{const J=I?Y:q;E[h]={type:I?Z:ee,message:J,ref:o,...O(I?Z:ee,J)}};if(s?!Array.isArray(y)||!y.length:c&&(!j&&(_||qn(y))||Rs(y)&&!y||T&&!fP(a).isValid||C&&!pP(a).isValid)){const{value:I,message:Y}=yp(c)?{value:!!c,message:c}:al(c);if(I&&(E[h]={type:Ys.required,message:Y,ref:w,...O(Ys.required,Y)},!n))return S(Y),E}if(!_&&(!qn(d)||!qn(p))){let I,Y;const q=al(p),Z=al(d);if(!qn(y)&&!isNaN(y)){const ee=o.valueAsNumber||y&&+y;qn(q.value)||(I=ee>q.value),qn(Z.value)||(Y=eenew Date(new Date().toDateString()+" "+X),L=o.type=="time",A=o.type=="week";As(q.value)&&y&&(I=L?J(y)>J(q.value):A?y>q.value:ee>new Date(q.value)),As(Z.value)&&y&&(Y=L?J(y)+I.value,Z=!qn(Y.value)&&y.length<+Y.value;if((q||Z)&&(K(q,I.message,Y.message),!n))return S(E[h].message),E}if(f&&!_&&As(y)){const{value:I,message:Y}=al(f);if(hg(I)&&!y.match(I)&&(E[h]={type:Ys.pattern,message:Y,ref:o,...O(Ys.pattern,Y)},!n))return S(Y),E}if(g){if(aa(g)){const I=await g(y,t),Y=OC(I,w);if(Y&&(E[h]={...Y,...O(Ys.validate,Y.message)},!n))return S(Y.message),E}else if(gn(g)){let I={};for(const Y in g){if(!pr(I)&&!n)break;const q=OC(await g[Y](y,t),w,Y);q&&(I={...q,...O(Y,q.message)},S(q.message),n&&(E[h]=I))}if(!pr(I)&&(E[h]={ref:w,...I},!n))return E}}return S(!0),E};function XV(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},mg=e=>qn(e)||!nP(e);function li(e,t){if(mg(e)||mg(t))return e===t;if(Ml(e)&&Ml(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const a=t[s];if(Ml(o)&&Ml(a)||gn(o)&&gn(a)||Array.isArray(o)&&Array.isArray(a)?!li(o,a):o!==a)return!1}}return!0}var gP=e=>e.type==="select-multiple",t8=e=>jw(e)||Xd(e),tv=e=>gg(e)&&e.isConnected,hP=e=>{for(const t in e)if(aa(e[t]))return!0;return!1};function vg(e,t={}){const n=Array.isArray(e);if(gn(e)||n)for(const r in e)Array.isArray(e[r])||gn(e[r])&&!hP(e[r])?(t[r]=Array.isArray(e[r])?[]:{},vg(e[r],t[r])):qn(e[r])||(t[r]=!0);return t}function mP(e,t,n){const r=Array.isArray(e);if(gn(e)||r)for(const s in e)Array.isArray(e[s])||gn(e[s])&&!hP(e[s])?Yt(t)||mg(n[s])?n[s]=Array.isArray(e[s])?vg(e[s],[]):{...vg(e[s])}:mP(e[s],qn(t)?{}:t[s],n[s]):n[s]=!li(e[s],t[s]);return n}var $f=(e,t)=>mP(e,t,vg(t)),vP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Yt(e)?e:t?e===""?NaN:e&&+e:n&&As(e)?new Date(e):r?r(e):e;function nv(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return kw(t)?t.files:jw(t)?pP(e.refs).value:gP(t)?[...t.selectedOptions].map(({value:n})=>n):Xd(t)?fP(e.refs).value:vP(Yt(t.value)?e.ref.value:t.value,e)}var n8=(e,t,n,r)=>{const s={};for(const o of e){const a=de(t,o);a&&xt(s,o,a._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},ru=e=>Yt(e)?e:hg(e)?e.source:gn(e)?hg(e.value)?e.value.source:e.value:e,r8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function DC(e,t,n){const r=de(e,n);if(r||Cw(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),a=de(t,o),c=de(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};s.pop()}return{name:n}}var s8=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,o8=(e,t)=>!_h(de(e,t)).length&&cn(e,t);const a8={mode:ts.onSubmit,reValidateMode:ts.onChange,shouldFocusError:!0};function i8(e={}){let t={...a8,...e},n={submitCount:0,isDirty:!1,isLoading:aa(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=gn(t.defaultValues)||gn(t.values)?Xn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Xn(s),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,i=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:ev(),array:ev(),state:ev()},f=MC(t.mode),g=MC(t.reValidateMode),h=t.criteriaMode===ts.all,m=M=>D=>{clearTimeout(i),i=setTimeout(M,D)},x=async M=>{if(d.isValid||M){const D=t.resolver?pr((await j()).errors):await O(r,!0);D!==n.isValid&&p.state.next({isValid:D})}},b=(M,D)=>{(d.isValidating||d.validatingFields)&&((M||Array.from(c.mount)).forEach(V=>{V&&(D?xt(n.validatingFields,V,D):cn(n.validatingFields,V))}),p.state.next({validatingFields:n.validatingFields,isValidating:!pr(n.validatingFields)}))},y=(M,D=[],V,he,ce=!0,ae=!0)=>{if(he&&V){if(a.action=!0,ae&&Array.isArray(de(r,M))){const ke=V(de(r,M),he.argA,he.argB);ce&&xt(r,M,ke)}if(ae&&Array.isArray(de(n.errors,M))){const ke=V(de(n.errors,M),he.argA,he.argB);ce&&xt(n.errors,M,ke),o8(n.errors,M)}if(d.touchedFields&&ae&&Array.isArray(de(n.touchedFields,M))){const ke=V(de(n.touchedFields,M),he.argA,he.argB);ce&&xt(n.touchedFields,M,ke)}d.dirtyFields&&(n.dirtyFields=$f(s,o)),p.state.next({name:M,isDirty:I(M,D),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else xt(o,M,D)},w=(M,D)=>{xt(n.errors,M,D),p.state.next({errors:n.errors})},S=M=>{n.errors=M,p.state.next({errors:n.errors,isValid:!1})},E=(M,D,V,he)=>{const ce=de(r,M);if(ce){const ae=de(o,M,Yt(V)?de(s,M):V);Yt(ae)||he&&he.defaultChecked||D?xt(o,M,D?ae:nv(ce._f)):Z(M,ae),a.mount&&x()}},C=(M,D,V,he,ce)=>{let ae=!1,ke=!1;const rt={name:M},Pt=!!(de(r,M)&&de(r,M)._f&&de(r,M)._f.disabled);if(!V||he){d.isDirty&&(ke=n.isDirty,n.isDirty=rt.isDirty=I(),ae=ke!==rt.isDirty);const hn=Pt||li(de(s,M),D);ke=!!(!Pt&&de(n.dirtyFields,M)),hn||Pt?cn(n.dirtyFields,M):xt(n.dirtyFields,M,!0),rt.dirtyFields=n.dirtyFields,ae=ae||d.dirtyFields&&ke!==!hn}if(V){const hn=de(n.touchedFields,M);hn||(xt(n.touchedFields,M,V),rt.touchedFields=n.touchedFields,ae=ae||d.touchedFields&&hn!==V)}return ae&&ce&&p.state.next(rt),ae?rt:{}},T=(M,D,V,he)=>{const ce=de(n.errors,M),ae=d.isValid&&Rs(D)&&n.isValid!==D;if(e.delayError&&V?(u=m(()=>w(M,V)),u(e.delayError)):(clearTimeout(i),u=null,V?xt(n.errors,M,V):cn(n.errors,M)),(V?!li(ce,V):ce)||!pr(he)||ae){const ke={...he,...ae&&Rs(D)?{isValid:D}:{},errors:n.errors,name:M};n={...n,...ke},p.state.next(ke)}},j=async M=>{b(M,!0);const D=await t.resolver(o,t.context,n8(M||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(M),D},_=async M=>{const{errors:D}=await j(M);if(M)for(const V of M){const he=de(D,V);he?xt(n.errors,V,he):cn(n.errors,V)}else n.errors=D;return D},O=async(M,D,V={valid:!0})=>{for(const he in M){const ce=M[he];if(ce){const{_f:ae,...ke}=ce;if(ae){const rt=c.array.has(ae.name);b([he],!0);const Pt=await IC(ce,o,h,t.shouldUseNativeValidation&&!D,rt);if(b([he]),Pt[ae.name]&&(V.valid=!1,D))break;!D&&(de(Pt,ae.name)?rt?YV(n.errors,Pt,ae.name):xt(n.errors,ae.name,Pt[ae.name]):cn(n.errors,ae.name))}ke&&await O(ke,D,V)}}return V.valid},K=()=>{for(const M of c.unMount){const D=de(r,M);D&&(D._f.refs?D._f.refs.every(V=>!tv(V)):!tv(D._f.ref))&&oe(M)}c.unMount=new Set},I=(M,D)=>(M&&D&&xt(o,M,D),!li(fe(),s)),Y=(M,D,V)=>uP(M,c,{...a.mount?o:Yt(D)?s:As(M)?{[M]:D}:D},V,D),q=M=>_h(de(a.mount?o:s,M,e.shouldUnregister?de(s,M,[]):[])),Z=(M,D,V={})=>{const he=de(r,M);let ce=D;if(he){const ae=he._f;ae&&(!ae.disabled&&xt(o,M,vP(D,ae)),ce=gg(ae.ref)&&qn(D)?"":D,gP(ae.ref)?[...ae.ref.options].forEach(ke=>ke.selected=ce.includes(ke.value)):ae.refs?Xd(ae.ref)?ae.refs.length>1?ae.refs.forEach(ke=>(!ke.defaultChecked||!ke.disabled)&&(ke.checked=Array.isArray(ce)?!!ce.find(rt=>rt===ke.value):ce===ke.value)):ae.refs[0]&&(ae.refs[0].checked=!!ce):ae.refs.forEach(ke=>ke.checked=ke.value===ce):kw(ae.ref)?ae.ref.value="":(ae.ref.value=ce,ae.ref.type||p.values.next({name:M,values:{...o}})))}(V.shouldDirty||V.shouldTouch)&&C(M,ce,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&X(M)},ee=(M,D,V)=>{for(const he in D){const ce=D[he],ae=`${M}.${he}`,ke=de(r,ae);(c.array.has(M)||!mg(ce)||ke&&!ke._f)&&!Ml(ce)?ee(ae,ce,V):Z(ae,ce,V)}},J=(M,D,V={})=>{const he=de(r,M),ce=c.array.has(M),ae=Xn(D);xt(o,M,ae),ce?(p.array.next({name:M,values:{...o}}),(d.isDirty||d.dirtyFields)&&V.shouldDirty&&p.state.next({name:M,dirtyFields:$f(s,o),isDirty:I(M,ae)})):he&&!he._f&&!qn(ae)?ee(M,ae,V):Z(M,ae,V),NC(M,c)&&p.state.next({...n}),p.values.next({name:a.mount?M:void 0,values:{...o}})},L=async M=>{a.mount=!0;const D=M.target;let V=D.name,he=!0;const ce=de(r,V),ae=()=>D.type?nv(ce._f):rP(M),ke=rt=>{he=Number.isNaN(rt)||rt===de(o,V,rt)};if(ce){let rt,Pt;const hn=ae(),bn=M.type===pg.BLUR||M.type===pg.FOCUS_OUT,mn=!r8(ce._f)&&!t.resolver&&!de(n.errors,V)&&!ce._f.deps||s8(bn,de(n.touchedFields,V),n.isSubmitted,g,f),Oo=NC(V,c,bn);xt(o,V,hn),bn?(ce._f.onBlur&&ce._f.onBlur(M),u&&u(0)):ce._f.onChange&&ce._f.onChange(M);const bs=C(V,hn,bn,!1),qa=!pr(bs)||Oo;if(!bn&&p.values.next({name:V,type:M.type,values:{...o}}),mn)return d.isValid&&x(),qa&&p.state.next({name:V,...Oo?{}:bs});if(!bn&&Oo&&p.state.next({...n}),t.resolver){const{errors:zn}=await j([V]);if(ke(hn),he){const ue=DC(n.errors,r,V),He=DC(zn,r,ue.name||V);rt=He.error,V=He.name,Pt=pr(zn)}}else b([V],!0),rt=(await IC(ce,o,h,t.shouldUseNativeValidation))[V],b([V]),ke(hn),he&&(rt?Pt=!1:d.isValid&&(Pt=await O(r,!0)));he&&(ce._f.deps&&X(ce._f.deps),T(V,Pt,rt,bs))}},A=(M,D)=>{if(de(n.errors,D)&&M.focus)return M.focus(),1},X=async(M,D={})=>{let V,he;const ce=Du(M);if(t.resolver){const ae=await _(Yt(M)?M:ce);V=pr(ae),he=M?!ce.some(ke=>de(ae,ke)):V}else M?(he=(await Promise.all(ce.map(async ae=>{const ke=de(r,ae);return await O(ke&&ke._f?{[ae]:ke}:ke)}))).every(Boolean),!(!he&&!n.isValid)&&x()):he=V=await O(r);return p.state.next({...!As(M)||d.isValid&&V!==n.isValid?{}:{name:M},...t.resolver||!M?{isValid:V}:{},errors:n.errors}),D.shouldFocus&&!he&&Au(r,A,M?ce:c.mount),he},fe=M=>{const D={...a.mount?o:s};return Yt(M)?D:As(M)?de(D,M):M.map(V=>de(D,V))},H=(M,D)=>({invalid:!!de((D||n).errors,M),isDirty:!!de((D||n).dirtyFields,M),error:de((D||n).errors,M),isValidating:!!de(n.validatingFields,M),isTouched:!!de((D||n).touchedFields,M)}),se=M=>{M&&Du(M).forEach(D=>cn(n.errors,D)),p.state.next({errors:M?n.errors:{}})},ne=(M,D,V)=>{const he=(de(r,M,{_f:{}})._f||{}).ref,ce=de(n.errors,M)||{},{ref:ae,message:ke,type:rt,...Pt}=ce;xt(n.errors,M,{...Pt,...D,ref:he}),p.state.next({name:M,errors:n.errors,isValid:!1}),V&&V.shouldFocus&&he&&he.focus&&he.focus()},le=(M,D)=>aa(M)?p.values.subscribe({next:V=>M(Y(void 0,D),V)}):Y(M,D,!0),oe=(M,D={})=>{for(const V of M?Du(M):c.mount)c.mount.delete(V),c.array.delete(V),D.keepValue||(cn(r,V),cn(o,V)),!D.keepError&&cn(n.errors,V),!D.keepDirty&&cn(n.dirtyFields,V),!D.keepTouched&&cn(n.touchedFields,V),!D.keepIsValidating&&cn(n.validatingFields,V),!t.shouldUnregister&&!D.keepDefaultValue&&cn(s,V);p.values.next({values:{...o}}),p.state.next({...n,...D.keepDirty?{isDirty:I()}:{}}),!D.keepIsValid&&x()},Q=({disabled:M,name:D,field:V,fields:he,value:ce})=>{if(Rs(M)&&a.mount||M){const ae=M?void 0:Yt(ce)?nv(V?V._f:de(he,D)._f):ce;xt(o,D,ae),C(D,ae,!1,!1,!0)}},Ee=(M,D={})=>{let V=de(r,M);const he=Rs(D.disabled);return xt(r,M,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:M}},name:M,mount:!0,...D}}),c.mount.add(M),V?Q({field:V,disabled:D.disabled,name:M,value:D.value}):E(M,!0,D.value),{...he?{disabled:D.disabled}:{},...t.progressive?{required:!!D.required,min:ru(D.min),max:ru(D.max),minLength:ru(D.minLength),maxLength:ru(D.maxLength),pattern:ru(D.pattern)}:{},name:M,onChange:L,onBlur:L,ref:ce=>{if(ce){Ee(M,D),V=de(r,M);const ae=Yt(ce.value)&&ce.querySelectorAll&&ce.querySelectorAll("input,select,textarea")[0]||ce,ke=t8(ae),rt=V._f.refs||[];if(ke?rt.find(Pt=>Pt===ae):ae===V._f.ref)return;xt(r,M,{_f:{...V._f,...ke?{refs:[...rt.filter(tv),ae,...Array.isArray(de(s,M))?[{}]:[]],ref:{type:ae.type,name:M}}:{ref:ae}}}),E(M,!1,void 0,ae)}else V=de(r,M,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(sP(c.array,M)&&a.action)&&c.unMount.add(M)}}},Pe=()=>t.shouldFocusError&&Au(r,A,c.mount),Be=M=>{Rs(M)&&(p.state.next({disabled:M}),Au(r,(D,V)=>{const he=de(r,V);he&&(D.disabled=he._f.disabled||M,Array.isArray(he._f.refs)&&he._f.refs.forEach(ce=>{ce.disabled=he._f.disabled||M}))},0,!1))},Re=(M,D)=>async V=>{let he;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let ce=Xn(o);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:ae,values:ke}=await j();n.errors=ae,ce=ke}else await O(r);if(cn(n.errors,"root"),pr(n.errors)){p.state.next({errors:{}});try{await M(ce,V)}catch(ae){he=ae}}else D&&await D({...n.errors},V),Pe(),setTimeout(Pe);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:pr(n.errors)&&!he,submitCount:n.submitCount+1,errors:n.errors}),he)throw he},ve=(M,D={})=>{de(r,M)&&(Yt(D.defaultValue)?J(M,Xn(de(s,M))):(J(M,D.defaultValue),xt(s,M,Xn(D.defaultValue))),D.keepTouched||cn(n.touchedFields,M),D.keepDirty||(cn(n.dirtyFields,M),n.isDirty=D.defaultValue?I(M,Xn(de(s,M))):I()),D.keepError||(cn(n.errors,M),d.isValid&&x()),p.state.next({...n}))},ot=(M,D={})=>{const V=M?Xn(M):s,he=Xn(V),ce=pr(M),ae=ce?s:he;if(D.keepDefaultValues||(s=V),!D.keepValues){if(D.keepDirtyValues)for(const ke of c.mount)de(n.dirtyFields,ke)?xt(ae,ke,de(o,ke)):J(ke,de(ae,ke));else{if(Sw&&Yt(M))for(const ke of c.mount){const rt=de(r,ke);if(rt&&rt._f){const Pt=Array.isArray(rt._f.refs)?rt._f.refs[0]:rt._f.ref;if(gg(Pt)){const hn=Pt.closest("form");if(hn){hn.reset();break}}}}r={}}o=e.shouldUnregister?D.keepDefaultValues?Xn(s):{}:Xn(ae),p.array.next({values:{...ae}}),p.values.next({values:{...ae}})}c={mount:D.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!D.keepIsValid||!!D.keepDirtyValues,a.watch=!!e.shouldUnregister,p.state.next({submitCount:D.keepSubmitCount?n.submitCount:0,isDirty:ce?!1:D.keepDirty?n.isDirty:!!(D.keepDefaultValues&&!li(M,s)),isSubmitted:D.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ce?{}:D.keepDirtyValues?D.keepDefaultValues&&o?$f(s,o):n.dirtyFields:D.keepDefaultValues&&M?$f(s,M):D.keepDirty?n.dirtyFields:{},touchedFields:D.keepTouched?n.touchedFields:{},errors:D.keepErrors?n.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Vt=(M,D)=>ot(aa(M)?M(o):M,D);return{control:{register:Ee,unregister:oe,getFieldState:H,handleSubmit:Re,setError:ne,_executeSchema:j,_getWatch:Y,_getDirty:I,_updateValid:x,_removeUnmounted:K,_updateFieldArray:y,_updateDisabledField:Q,_getFieldArray:q,_reset:ot,_resetDefaultValues:()=>aa(t.defaultValues)&&t.defaultValues().then(M=>{Vt(M,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:M=>{n={...n,...M}},_disableForm:Be,_subjects:p,_proxyFormState:d,_setErrors:S,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(M){a=M},get _defaultValues(){return s},get _names(){return c},set _names(M){c=M},get _formState(){return n},set _formState(M){n=M},get _options(){return t},set _options(M){t={...t,...M}}},trigger:X,register:Ee,handleSubmit:Re,watch:le,setValue:J,getValues:fe,reset:Vt,resetField:ve,clearErrors:se,unregister:oe,setError:ne,setFocus:(M,D={})=>{const V=de(r,M),he=V&&V._f;if(he){const ce=he.refs?he.refs[0]:he.ref;ce.focus&&(ce.focus(),D.shouldSelect&&ce.select())}},getFieldState:H}}function zt(e={}){const t=je.useRef(),n=je.useRef(),[r,s]=je.useState({isDirty:!1,isValidating:!1,isLoading:aa(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:aa(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...i8(e),formState:r});const o=t.current.control;return o._options=e,Ew({subject:o._subjects.state,next:a=>{lP(a,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),je.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),je.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),je.useEffect(()=>{e.values&&!li(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),je.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),je.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),je.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=iP(r,o),t.current}const AC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=de(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},yP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?AC(r.ref,n,e):r.refs&&r.refs.forEach(s=>AC(s,n,e))}},l8=(e,t)=>{t.shouldUseNativeValidation&&yP(e,t);const n={};for(const r in e){const s=de(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(c8(t.names||Object.keys(e),r)){const a=Object.assign({},de(n,r));xt(a,"root",o),xt(n,r,a)}else xt(n,r,o)}return n},c8=(e,t)=>e.some(n=>n.startsWith(t+"."));var u8=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.code}}else n[a]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(p){return e.push(p)})}),t){var u=n[a].types,i=u&&u[r.code];n[a]=dP(a,t,n,s,i?[].concat(i,r.message):r.message)}e.shift()}return n},Ut=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(a,c){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return o.shouldUseNativeValidation&&yP({},o),{errors:{},values:n.raw?r:i}})}catch(i){return c(i)}return u&&u.then?u.then(void 0,c):u}(0,function(a){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(a))return{values:{},errors:l8(u8(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},wn=[];for(var rv=0;rv<256;++rv)wn.push((rv+256).toString(16).slice(1));function d8(e,t=0){return(wn[e[t+0]]+wn[e[t+1]]+wn[e[t+2]]+wn[e[t+3]]+"-"+wn[e[t+4]]+wn[e[t+5]]+"-"+wn[e[t+6]]+wn[e[t+7]]+"-"+wn[e[t+8]]+wn[e[t+9]]+"-"+wn[e[t+10]]+wn[e[t+11]]+wn[e[t+12]]+wn[e[t+13]]+wn[e[t+14]]+wn[e[t+15]]).toLowerCase()}var Bf,f8=new Uint8Array(16);function p8(){if(!Bf&&(Bf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bf(f8)}var g8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const FC={randomUUID:g8};function LC(e,t,n){if(FC.randomUUID&&!t&&!e)return FC.randomUUID();e=e||{};var r=e.random||(e.rng||p8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,d8(r)}var ft;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(ft||(ft={}));var rb;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(rb||(rb={}));const xe=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Go=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},re=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),h8=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,u=0;for(;un.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=e=>new Sr(e);const gc=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===xe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ft.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,ft.assertNever(e)}return{message:n}};let bP=gc;function m8(e){bP=e}function yg(){return bP}const bg=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let c="";const u=r.filter(i=>!!i).slice().reverse();for(const i of u)c=i(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}},v8=[];function ye(e,t){const n=yg(),r=bg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===gc?void 0:gc].filter(s=>!!s)});e.common.issues.push(r)}class $n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return Ue;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return $n.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ue;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Ue=Object.freeze({status:"aborted"}),Nl=e=>({status:"dirty",value:e}),Jn=e=>({status:"valid",value:e}),sb=e=>e.status==="aborted",ob=e=>e.status==="dirty",md=e=>e.status==="valid",vd=e=>typeof Promise<"u"&&e instanceof Promise;function xg(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function xP(e,t,n,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ne;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ne||(Ne={}));var yu,bu;class Hs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $C=(e,t)=>{if(md(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Sr(e.common.issues);return this._error=n,this._error}}};function Ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var u,i;const{message:d}=e;return a.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:(u=d??r)!==null&&u!==void 0?u:c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:(i=d??n)!==null&&i!==void 0?i:c.defaultError}},description:s}}class Xe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Go(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Go(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $n,ctx:{common:t.parent.common,data:t.data,parsedType:Go(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Go(t)},o=this._parseSync({data:t,path:s.path,parent:s});return $C(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Go(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(vd(s)?s:Promise.resolve(s));return $C(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:re.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ps({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return zs.create(this,this._def)}nullable(){return ka.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ls.create(this,this._def)}promise(){return mc.create(this,this._def)}or(t){return wd.create([this,t],this._def)}and(t){return Sd.create(this,t,this._def)}transform(t){return new ps({...Ge(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Td({...Ge(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new Tw({typeName:$e.ZodBranded,type:this,...Ge(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Md({...Ge(this._def),innerType:this,catchValue:n,typeName:$e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ef.create(this,t)}readonly(){return Nd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const y8=/^c[^\s-]{8,}$/i,b8=/^[0-9a-z]+$/,x8=/^[0-9A-HJKMNP-TV-Z]{26}$/,w8=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,S8=/^[a-z0-9_-]{21}$/i,C8=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,E8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sv;const j8=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T8=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,M8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",N8=new RegExp(`^${wP}$`);function SP(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function _8(e){return new RegExp(`^${SP(e)}$`)}function CP(e){let t=`${wP}T${SP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function P8(e,t){return!!((t==="v4"||!t)&&j8.test(e)||(t==="v6"||!t)&&T8.test(e))}class rs extends Xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.string,received:o.parsedType}),Ue}const r=new $n;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ye(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,c=t.data.lengtht.test(s),{validation:n,code:re.invalid_string,...Ne.errToObj(r)})}_addCheck(t){return new rs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ne.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ne.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ne.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ne.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ne.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ne.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ne.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ne.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ne.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ne.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ne.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ne.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ne.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ne.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ne.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ne.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ne.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ne.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ne.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ne.errToObj(n)})}nonempty(t){return this.min(1,Ne.errToObj(t))}trim(){return new rs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new rs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new rs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new rs({checks:[],typeName:$e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};function R8(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),a=parseInt(t.toFixed(s).replace(".",""));return o%a/Math.pow(10,s)}class Sa extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.number,received:o.parsedType}),Ue}let r;const s=new $n;for(const o of this._def.checks)o.kind==="int"?ft.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:re.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?R8(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:re.not_finite,message:o.message}),s.dirty()):ft.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ne.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ne.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ne.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ne.toString(n))}setLimit(t,n,r,s){return new Sa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ne.toString(s)}]})}_addCheck(t){return new Sa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ne.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ne.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ne.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ne.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ne.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ne.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ne.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ne.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ne.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&ft.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Sa({checks:[],typeName:$e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class Ca extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==xe.bigint){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.bigint,received:o.parsedType}),Ue}let r;const s=new $n;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):ft.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ne.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ne.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ne.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ne.toString(n))}setLimit(t,n,r,s){return new Ca({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ne.toString(s)}]})}_addCheck(t){return new Ca({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ne.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ne.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ne.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ne.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ne.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ca({checks:[],typeName:$e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};class yd extends Xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.boolean,received:r.parsedType}),Ue}return Jn(t.data)}}yd.create=e=>new yd({typeName:$e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class Di extends Xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.date,received:o.parsedType}),Ue}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_date}),Ue}const r=new $n;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ye(s,{code:re.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):ft.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Di({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ne.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ne.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Di({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$e.ZodDate,...Ge(e)});class wg extends Xe{_parse(t){if(this._getType(t)!==xe.symbol){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.symbol,received:r.parsedType}),Ue}return Jn(t.data)}}wg.create=e=>new wg({typeName:$e.ZodSymbol,...Ge(e)});class bd extends Xe{_parse(t){if(this._getType(t)!==xe.undefined){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.undefined,received:r.parsedType}),Ue}return Jn(t.data)}}bd.create=e=>new bd({typeName:$e.ZodUndefined,...Ge(e)});class xd extends Xe{_parse(t){if(this._getType(t)!==xe.null){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.null,received:r.parsedType}),Ue}return Jn(t.data)}}xd.create=e=>new xd({typeName:$e.ZodNull,...Ge(e)});class hc extends Xe{constructor(){super(...arguments),this._any=!0}_parse(t){return Jn(t.data)}}hc.create=e=>new hc({typeName:$e.ZodAny,...Ge(e)});class Si extends Xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Jn(t.data)}}Si.create=e=>new Si({typeName:$e.ZodUnknown,...Ge(e)});class Eo extends Xe{_parse(t){const n=this._getOrReturnCtx(t);return ye(n,{code:re.invalid_type,expected:xe.never,received:n.parsedType}),Ue}}Eo.create=e=>new Eo({typeName:$e.ZodNever,...Ge(e)});class Sg extends Xe{_parse(t){if(this._getType(t)!==xe.undefined){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.void,received:r.parsedType}),Ue}return Jn(t.data)}}Sg.create=e=>new Sg({typeName:$e.ZodVoid,...Ge(e)});class ls extends Xe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==xe.array)return ye(n,{code:re.invalid_type,expected:xe.array,received:n.parsedType}),Ue;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,c=n.data.lengths.maxLength.value&&(ye(n,{code:re.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>s.type._parseAsync(new Hs(n,a,n.path,c)))).then(a=>$n.mergeArray(r,a));const o=[...n.data].map((a,c)=>s.type._parseSync(new Hs(n,a,n.path,c)));return $n.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ls({...this._def,minLength:{value:t,message:Ne.toString(n)}})}max(t,n){return new ls({...this._def,maxLength:{value:t,message:Ne.toString(n)}})}length(t,n){return new ls({...this._def,exactLength:{value:t,message:Ne.toString(n)}})}nonempty(t){return this.min(1,t)}}ls.create=(e,t)=>new ls({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ge(t)});function pl(e){if(e instanceof Ht){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zs.create(pl(r))}return new Ht({...e._def,shape:()=>t})}else return e instanceof ls?new ls({...e._def,type:pl(e.element)}):e instanceof zs?zs.create(pl(e.unwrap())):e instanceof ka?ka.create(pl(e.unwrap())):e instanceof Ks?Ks.create(e.items.map(t=>pl(t))):e}class Ht extends Xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ft.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==xe.object){const i=this._getOrReturnCtx(t);return ye(i,{code:re.invalid_type,expected:xe.object,received:i.parsedType}),Ue}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Eo&&this._def.unknownKeys==="strip"))for(const i in s.data)a.includes(i)||c.push(i);const u=[];for(const i of a){const d=o[i],p=s.data[i];u.push({key:{status:"valid",value:i},value:d._parse(new Hs(s,p,s.path,i)),alwaysSet:i in s.data})}if(this._def.catchall instanceof Eo){const i=this._def.unknownKeys;if(i==="passthrough")for(const d of c)u.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(i==="strict")c.length>0&&(ye(s,{code:re.unrecognized_keys,keys:c}),r.dirty());else if(i!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const i=this._def.catchall;for(const d of c){const p=s.data[d];u.push({key:{status:"valid",value:d},value:i._parse(new Hs(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const i=[];for(const d of u){const p=await d.key,f=await d.value;i.push({key:p,value:f,alwaysSet:d.alwaysSet})}return i}).then(i=>$n.mergeObjectSync(r,i)):$n.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ne.errToObj,new Ht({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,a,c;const u=(a=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Ne.errToObj(t).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new Ht({...this._def,unknownKeys:"strip"})}passthrough(){return new Ht({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ht({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ht({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ht({...this._def,catchall:t})}pick(t){const n={};return ft.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ht({...this._def,shape:()=>n})}omit(t){const n={};return ft.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ht({...this._def,shape:()=>n})}deepPartial(){return pl(this)}partial(t){const n={};return ft.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new Ht({...this._def,shape:()=>n})}required(t){const n={};return ft.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof zs;)o=o._def.innerType;n[r]=o}}),new Ht({...this._def,shape:()=>n})}keyof(){return EP(ft.objectKeys(this.shape))}}Ht.create=(e,t)=>new Ht({shape:()=>e,unknownKeys:"strip",catchall:Eo.create(),typeName:$e.ZodObject,...Ge(t)});Ht.strictCreate=(e,t)=>new Ht({shape:()=>e,unknownKeys:"strict",catchall:Eo.create(),typeName:$e.ZodObject,...Ge(t)});Ht.lazycreate=(e,t)=>new Ht({shape:e,unknownKeys:"strip",catchall:Eo.create(),typeName:$e.ZodObject,...Ge(t)});class wd extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const a=o.map(c=>new Sr(c.ctx.common.issues));return ye(n,{code:re.invalid_union,unionErrors:a}),Ue}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const u of r){const i={...n,common:{...n.common,issues:[]},parent:null},d=u._parseSync({data:n.data,path:n.path,parent:i});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:i}),i.common.issues.length&&a.push(i.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const c=a.map(u=>new Sr(u));return ye(n,{code:re.invalid_union,unionErrors:c}),Ue}}get options(){return this._def.options}}wd.create=(e,t)=>new wd({options:e,typeName:$e.ZodUnion,...Ge(t)});const to=e=>e instanceof Ed?to(e.schema):e instanceof ps?to(e.innerType()):e instanceof kd?[e.value]:e instanceof Ea?e.options:e instanceof jd?ft.objectValues(e.enum):e instanceof Td?to(e._def.innerType):e instanceof bd?[void 0]:e instanceof xd?[null]:e instanceof zs?[void 0,...to(e.unwrap())]:e instanceof ka?[null,...to(e.unwrap())]:e instanceof Tw||e instanceof Nd?to(e.unwrap()):e instanceof Md?to(e._def.innerType):[];class Rh extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return ye(n,{code:re.invalid_type,expected:xe.object,received:n.parsedType}),Ue;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ye(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ue)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const a=to(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new Rh({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ge(r)})}}function ab(e,t){const n=Go(e),r=Go(t);if(e===t)return{valid:!0,data:e};if(n===xe.object&&r===xe.object){const s=ft.objectKeys(t),o=ft.objectKeys(e).filter(c=>s.indexOf(c)!==-1),a={...e,...t};for(const c of o){const u=ab(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===xe.array&&r===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(sb(o)||sb(a))return Ue;const c=ab(o.value,a.value);return c.valid?((ob(o)||ob(a))&&n.dirty(),{status:n.value,value:c.data}):(ye(r,{code:re.invalid_intersection_types}),Ue)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sd.create=(e,t,n)=>new Sd({left:e,right:t,typeName:$e.ZodIntersection,...Ge(n)});class Ks extends Xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.array)return ye(r,{code:re.invalid_type,expected:xe.array,received:r.parsedType}),Ue;if(r.data.lengththis._def.items.length&&(ye(r,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Hs(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>$n.mergeArray(n,a)):$n.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ks({...this._def,rest:t})}}Ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ks({items:e,typeName:$e.ZodTuple,rest:null,...Ge(t)})};class Cd extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return ye(r,{code:re.invalid_type,expected:xe.object,received:r.parsedType}),Ue;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in r.data)s.push({key:o._parse(new Hs(r,c,r.path,c)),value:a._parse(new Hs(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?$n.mergeObjectAsync(n,s):$n.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Xe?new Cd({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ge(r)}):new Cd({keyType:rs.create(),valueType:t,typeName:$e.ZodRecord,...Ge(n)})}}class Cg extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.map)return ye(r,{code:re.invalid_type,expected:xe.map,received:r.parsedType}),Ue;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([c,u],i)=>({key:s._parse(new Hs(r,c,r.path,[i,"key"])),value:o._parse(new Hs(r,u,r.path,[i,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of a){const i=await u.key,d=await u.value;if(i.status==="aborted"||d.status==="aborted")return Ue;(i.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(i.value,d.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of a){const i=u.key,d=u.value;if(i.status==="aborted"||d.status==="aborted")return Ue;(i.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(i.value,d.value)}return{status:n.value,value:c}}}}Cg.create=(e,t,n)=>new Cg({valueType:t,keyType:e,typeName:$e.ZodMap,...Ge(n)});class Ai extends Xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.set)return ye(r,{code:re.invalid_type,expected:xe.set,received:r.parsedType}),Ue;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(ye(r,{code:re.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const i=new Set;for(const d of u){if(d.status==="aborted")return Ue;d.status==="dirty"&&n.dirty(),i.add(d.value)}return{status:n.value,value:i}}const c=[...r.data.values()].map((u,i)=>o._parse(new Hs(r,u,r.path,i)));return r.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new Ai({...this._def,minSize:{value:t,message:Ne.toString(n)}})}max(t,n){return new Ai({...this._def,maxSize:{value:t,message:Ne.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ai.create=(e,t)=>new Ai({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ge(t)});class Bl extends Xe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.function)return ye(n,{code:re.invalid_type,expected:xe.function,received:n.parsedType}),Ue;function r(c,u){return bg({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yg(),gc].filter(i=>!!i),issueData:{code:re.invalid_arguments,argumentsError:u}})}function s(c,u){return bg({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yg(),gc].filter(i=>!!i),issueData:{code:re.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof mc){const c=this;return Jn(async function(...u){const i=new Sr([]),d=await c._def.args.parseAsync(u,o).catch(g=>{throw i.addIssue(r(u,g)),i}),p=await Reflect.apply(a,this,d);return await c._def.returns._def.type.parseAsync(p,o).catch(g=>{throw i.addIssue(s(p,g)),i})})}else{const c=this;return Jn(function(...u){const i=c._def.args.safeParse(u,o);if(!i.success)throw new Sr([r(u,i.error)]);const d=Reflect.apply(a,this,i.data),p=c._def.returns.safeParse(d,o);if(!p.success)throw new Sr([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Bl({...this._def,args:Ks.create(t).rest(Si.create())})}returns(t){return new Bl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Bl({args:t||Ks.create([]).rest(Si.create()),returns:n||Si.create(),typeName:$e.ZodFunction,...Ge(r)})}}class Ed extends Xe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ed.create=(e,t)=>new Ed({getter:e,typeName:$e.ZodLazy,...Ge(t)});class kd extends Xe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ye(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),Ue}return{status:"valid",value:t.data}}get value(){return this._def.value}}kd.create=(e,t)=>new kd({value:e,typeName:$e.ZodLiteral,...Ge(t)});function EP(e,t){return new Ea({values:e,typeName:$e.ZodEnum,...Ge(t)})}class Ea extends Xe{constructor(){super(...arguments),yu.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{expected:ft.joinValues(r),received:n.parsedType,code:re.invalid_type}),Ue}if(xg(this,yu)||xP(this,yu,new Set(this._def.values)),!xg(this,yu).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{received:n.data,code:re.invalid_enum_value,options:r}),Ue}return Jn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ea.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ea.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}yu=new WeakMap;Ea.create=EP;class jd extends Xe{constructor(){super(...arguments),bu.set(this,void 0)}_parse(t){const n=ft.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==xe.string&&r.parsedType!==xe.number){const s=ft.objectValues(n);return ye(r,{expected:ft.joinValues(s),received:r.parsedType,code:re.invalid_type}),Ue}if(xg(this,bu)||xP(this,bu,new Set(ft.getValidEnumValues(this._def.values))),!xg(this,bu).has(t.data)){const s=ft.objectValues(n);return ye(r,{received:r.data,code:re.invalid_enum_value,options:s}),Ue}return Jn(t.data)}get enum(){return this._def.values}}bu=new WeakMap;jd.create=(e,t)=>new jd({values:e,typeName:$e.ZodNativeEnum,...Ge(t)});class mc extends Xe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.promise&&n.common.async===!1)return ye(n,{code:re.invalid_type,expected:xe.promise,received:n.parsedType}),Ue;const r=n.parsedType===xe.promise?n.data:Promise.resolve(n.data);return Jn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}mc.create=(e,t)=>new mc({type:e,typeName:$e.ZodPromise,...Ge(t)});class ps extends Xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{ye(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ue;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?Ue:u.status==="dirty"||n.value==="dirty"?Nl(u.value):u});{if(n.value==="aborted")return Ue;const c=this._def.schema._parseSync({data:a,path:r.path,parent:r});return c.status==="aborted"?Ue:c.status==="dirty"||n.value==="dirty"?Nl(c.value):c}}if(s.type==="refinement"){const a=c=>{const u=s.refinement(c,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Ue:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?Ue:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!md(a))return a;const c=s.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>md(a)?Promise.resolve(s.transform(a.value,o)).then(c=>({status:n.value,value:c})):a);ft.assertNever(s)}}ps.create=(e,t,n)=>new ps({schema:e,typeName:$e.ZodEffects,effect:t,...Ge(n)});ps.createWithPreprocess=(e,t,n)=>new ps({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ge(n)});class zs extends Xe{_parse(t){return this._getType(t)===xe.undefined?Jn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}zs.create=(e,t)=>new zs({innerType:e,typeName:$e.ZodOptional,...Ge(t)});class ka extends Xe{_parse(t){return this._getType(t)===xe.null?Jn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ka.create=(e,t)=>new ka({innerType:e,typeName:$e.ZodNullable,...Ge(t)});class Td extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Td.create=(e,t)=>new Td({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ge(t)});class Md extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vd(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Md.create=(e,t)=>new Md({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ge(t)});class Eg extends Xe{_parse(t){if(this._getType(t)!==xe.nan){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.nan,received:r.parsedType}),Ue}return{status:"valid",value:t.data}}}Eg.create=e=>new Eg({typeName:$e.ZodNaN,...Ge(e)});const O8=Symbol("zod_brand");class Tw extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ef extends Xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ue:o.status==="dirty"?(n.dirty(),Nl(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ue:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new ef({in:t,out:n,typeName:$e.ZodPipeline})}}class Nd extends Xe{_parse(t){const n=this._def.innerType._parse(t),r=s=>(md(s)&&(s.value=Object.freeze(s.value)),s);return vd(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Nd.create=(e,t)=>new Nd({innerType:e,typeName:$e.ZodReadonly,...Ge(t)});function kP(e,t={},n){return e?hc.create().superRefine((r,s)=>{var o,a;if(!e(r)){const c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=c.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,i=typeof c=="string"?{message:c}:c;s.addIssue({code:"custom",...i,fatal:u})}}):hc.create()}const I8={object:Ht.lazycreate};var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const D8=(e,t={message:`Input not instance of ${e.name}`})=>kP(n=>n instanceof e,t),jP=rs.create,TP=Sa.create,A8=Eg.create,F8=Ca.create,MP=yd.create,L8=Di.create,$8=wg.create,B8=bd.create,z8=xd.create,U8=hc.create,V8=Si.create,H8=Eo.create,K8=Sg.create,q8=ls.create,W8=Ht.create,G8=Ht.strictCreate,J8=wd.create,Q8=Rh.create,Z8=Sd.create,Y8=Ks.create,X8=Cd.create,e6=Cg.create,t6=Ai.create,n6=Bl.create,r6=Ed.create,s6=kd.create,o6=Ea.create,a6=jd.create,i6=mc.create,BC=ps.create,l6=zs.create,c6=ka.create,u6=ps.createWithPreprocess,d6=ef.create,f6=()=>jP().optional(),p6=()=>TP().optional(),g6=()=>MP().optional(),h6={string:e=>rs.create({...e,coerce:!0}),number:e=>Sa.create({...e,coerce:!0}),boolean:e=>yd.create({...e,coerce:!0}),bigint:e=>Ca.create({...e,coerce:!0}),date:e=>Di.create({...e,coerce:!0})},m6=Ue;var k=Object.freeze({__proto__:null,defaultErrorMap:gc,setErrorMap:m8,getErrorMap:yg,makeIssue:bg,EMPTY_PATH:v8,addIssueToContext:ye,ParseStatus:$n,INVALID:Ue,DIRTY:Nl,OK:Jn,isAborted:sb,isDirty:ob,isValid:md,isAsync:vd,get util(){return ft},get objectUtil(){return rb},ZodParsedType:xe,getParsedType:Go,ZodType:Xe,datetimeRegex:CP,ZodString:rs,ZodNumber:Sa,ZodBigInt:Ca,ZodBoolean:yd,ZodDate:Di,ZodSymbol:wg,ZodUndefined:bd,ZodNull:xd,ZodAny:hc,ZodUnknown:Si,ZodNever:Eo,ZodVoid:Sg,ZodArray:ls,ZodObject:Ht,ZodUnion:wd,ZodDiscriminatedUnion:Rh,ZodIntersection:Sd,ZodTuple:Ks,ZodRecord:Cd,ZodMap:Cg,ZodSet:Ai,ZodFunction:Bl,ZodLazy:Ed,ZodLiteral:kd,ZodEnum:Ea,ZodNativeEnum:jd,ZodPromise:mc,ZodEffects:ps,ZodTransformer:ps,ZodOptional:zs,ZodNullable:ka,ZodDefault:Td,ZodCatch:Md,ZodNaN:Eg,BRAND:O8,ZodBranded:Tw,ZodPipeline:ef,ZodReadonly:Nd,custom:kP,Schema:Xe,ZodSchema:Xe,late:I8,get ZodFirstPartyTypeKind(){return $e},coerce:h6,any:U8,array:q8,bigint:F8,boolean:MP,date:L8,discriminatedUnion:Q8,effect:BC,enum:o6,function:n6,instanceof:D8,intersection:Z8,lazy:r6,literal:s6,map:e6,nan:A8,nativeEnum:a6,never:H8,null:z8,nullable:c6,number:TP,object:W8,oboolean:g6,onumber:p6,optional:l6,ostring:f6,pipeline:d6,preprocess:u6,promise:i6,record:X8,set:t6,strictObject:G8,string:jP,symbol:$8,transformer:BC,tuple:Y8,undefined:B8,union:J8,unknown:V8,void:K8,NEVER:m6,ZodIssueCode:re,quotelessJson:h8,ZodError:Sr}),NP=v.createContext({dragDropManager:void 0}),Lr;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Lr||(Lr={}));function Ke(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s-1})}var w6={type:Mw,payload:{clientOffset:null,sourceClientOffset:null}};function S6(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=r.publishSource,o=s===void 0?!0:s,a=r.clientOffset,c=r.getSourceClientOffset,u=e.getMonitor(),i=e.getRegistry();e.dispatch(zC(a)),C6(n,u,i);var d=j6(n,u);if(d===null){e.dispatch(w6);return}var p=null;if(a){if(!c)throw new Error("getSourceClientOffset must be defined");E6(c),p=c(d)}e.dispatch(zC(a,p));var f=i.getSource(d),g=f.beginDrag(u,d);if(g!=null){k6(g),i.pinSource(d);var h=i.getSourceType(d);return{type:Oh,payload:{itemType:h,item:g,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function C6(e,t,n){Ke(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){Ke(n.getSource(r),"Expected sourceIds to be registered.")})}function E6(e){Ke(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function k6(e){Ke(_P(e),"Item must be an object.")}function j6(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function T6(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:Nw}}}function ib(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function M6(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.clientOffset;N6(n);var o=n.slice(0),a=e.getMonitor(),c=e.getRegistry();_6(o,a,c);var u=a.getItemType();return P6(o,c,u),R6(o,a,c),{type:Ih,payload:{targetIds:o,clientOffset:s||null}}}}function N6(e){Ke(Array.isArray(e),"Expected targetIds to be an array.")}function _6(e,t,n){Ke(t.isDragging(),"Cannot call hover while not dragging."),Ke(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var s=e[r],o=t.getTargetType(s);ib(o,n)||e.splice(r,1)}}function R6(e,t,n){e.forEach(function(r){var s=n.getTarget(r);s.hover(t,r)})}function UC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function VC(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),s=e.getRegistry();D6(r);var o=L6(r);o.forEach(function(a,c){var u=A6(a,c,s,r),i={type:Dh,payload:{dropResult:VC(VC({},n),u)}};e.dispatch(i)})}}function D6(e){Ke(e.isDragging(),"Cannot call drop while not dragging."),Ke(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function A6(e,t,n,r){var s=n.getTarget(e),o=s?s.drop(r,e):void 0;return F6(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function F6(e){Ke(typeof e>"u"||_P(e),"Drop result must either be an object or undefined.")}function L6(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function $6(e){return function(){var n=e.getMonitor(),r=e.getRegistry();B6(n);var s=n.getSourceId();if(s!=null){var o=r.getSource(s,!0);o.endDrag(n,s),r.unpinSource()}return{type:Ah}}}function B6(e){Ke(e.isDragging(),"Cannot call endDrag while not dragging.")}function z6(e){return{beginDrag:S6(e),publishDragSource:T6(e),hover:M6(e),drop:I6(e),endDrag:$6(e)}}function U6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V6(e,t){for(var n=0;n0;r.backend&&(s&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!s&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return H6(e,[{key:"receiveBackend",value:function(n){this.backend=n}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var n=this,r=this.store.dispatch;function s(a){return function(){for(var c=arguments.length,u=new Array(c),i=0;i"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(_r(1));return n(PP)(e,t)}if(typeof e!="function")throw new Error(_r(2));var s=e,o=t,a=[],c=a,u=!1;function i(){c===a&&(c=a.slice())}function d(){if(u)throw new Error(_r(3));return o}function p(m){if(typeof m!="function")throw new Error(_r(4));if(u)throw new Error(_r(5));var x=!0;return i(),c.push(m),function(){if(x){if(u)throw new Error(_r(6));x=!1,i();var y=c.indexOf(m);c.splice(y,1),a=null}}}function f(m){if(!q6(m))throw new Error(_r(7));if(typeof m.type>"u")throw new Error(_r(8));if(u)throw new Error(_r(9));try{u=!0,o=s(o,m)}finally{u=!1}for(var x=a=c,b=0;b2&&arguments[2]!==void 0?arguments[2]:W6;if(e.length!==t.length)return!1;for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:GC,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Mw:case Oh:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Ih:return G6(e.clientOffset,n.clientOffset)?e:WC(WC({},e),{},{clientOffset:n.clientOffset});case Ah:case Dh:return GC;default:return e}}var _w="dnd-core/ADD_SOURCE",Pw="dnd-core/ADD_TARGET",Rw="dnd-core/REMOVE_SOURCE",Fh="dnd-core/REMOVE_TARGET";function Y6(e){return{type:_w,payload:{sourceId:e}}}function X6(e){return{type:Pw,payload:{targetId:e}}}function eH(e){return{type:Rw,payload:{sourceId:e}}}function tH(e){return{type:Fh,payload:{targetId:e}}}function JC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:rH,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Oh:return Pr(Pr({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Nw:return Pr(Pr({},e),{},{isSourcePublic:!0});case Ih:return Pr(Pr({},e),{},{targetIds:n.targetIds});case Fh:return e.targetIds.indexOf(n.targetId)===-1?e:Pr(Pr({},e),{},{targetIds:y6(e.targetIds,n.targetId)});case Dh:return Pr(Pr({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Ah:return Pr(Pr({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function oH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _w:case Pw:return e+1;case Rw:case Fh:return e-1;default:return e}}var kg=[],Ow=[];kg.__IS_NONE__=!0;Ow.__IS_ALL__=!0;function aH(e,t){if(e===kg)return!1;if(e===Ow||typeof t>"u")return!0;var n=x6(t,e);return n.length>0}function iH(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ih:break;case _w:case Pw:case Fh:case Rw:return kg;case Oh:case Nw:case Ah:case Dh:default:return Ow}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,s=t.prevTargetIds,o=s===void 0?[]:s,a=b6(r,o),c=a.length>0||!J6(r,o);if(!c)return kg;var u=o[o.length-1],i=r[r.length-1];return u!==i&&(u&&a.push(u),i&&a.push(i)),a}function lH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function QC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ZC(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:iH(e.dirtyHandlerIds,{type:t.type,payload:ZC(ZC({},t.payload),{},{prevTargetIds:v6(e,"dragOperation.targetIds",[])})}),dragOffset:Z6(e.dragOffset,t),refCount:oH(e.refCount,t),dragOperation:sH(e.dragOperation,t),stateId:lH(e.stateId)}}function dH(e,t){return{x:e.x+t.x,y:e.y+t.y}}function RP(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fH(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:RP(dH(t,r),n)}function pH(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:RP(t,n)}function gH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hH(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;Ke(typeof n=="function","listener must be a function."),Ke(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,c=function(){var i=r.store.getState(),d=i.stateId;try{var p=d===a||d===a+1&&!aH(i.dirtyHandlerIds,o);p||n()}finally{a=d}};return this.store.subscribe(c)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;Ke(typeof n=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var c=r.store.getState().dragOffset;c!==s&&(s=c,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return Ke(r,"Expected to find a valid source. sourceId=".concat(n)),this.isDragging()?!1:r.canDrag(this,n)}},{key:"canDropOnTarget",value:function(n){if(!n)return!1;var r=this.registry.getTarget(n);if(Ke(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(n),o=this.getItemType();return ib(s,o)&&r.canDrop(this,n)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n,!0);if(Ke(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(n),o=this.getItemType();return s!==o?!1:r.isDragging(this,n)}},{key:"isOverTarget",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!n)return!1;var s=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),a=this.getItemType();if(a&&!ib(o,a))return!1;var c=this.getTargetIds();if(!c.length)return!1;var u=c.indexOf(n);return s?u===c.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return fH(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return pH(this.store.getState().dragOffset)}}]),e}(),yH=0;function bH(){return yH++}function xp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xp=function(n){return typeof n}:xp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xp(e)}function xH(e){Ke(typeof e.canDrag=="function","Expected canDrag to be a function."),Ke(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ke(typeof e.endDrag=="function","Expected endDrag to be a function.")}function wH(e){Ke(typeof e.canDrop=="function","Expected canDrop to be a function."),Ke(typeof e.hover=="function","Expected hover to be a function."),Ke(typeof e.drop=="function","Expected beginDrag to be a function.")}function lb(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return lb(n,!1)});return}Ke(typeof e=="string"||xp(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const XC=typeof global<"u"?global:self,OP=XC.MutationObserver||XC.WebKitMutationObserver;function IP(e){return function(){const n=setTimeout(s,0),r=setInterval(s,50);function s(){clearTimeout(n),clearInterval(r),e()}}}function SH(e){let t=1;const n=new OP(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const CH=typeof OP=="function"?SH:IP;class EH{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let r=0,s=t.length-this.index;r{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=CH(this.flush),this.requestErrorThrow=IP(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class kH{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class jH{create(t){const n=this.freeTasks,r=n.length?n.pop():new kH(this.onError,s=>n[n.length]=s);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const DP=new EH,TH=new jH(DP.registerPendingError);function MH(e){DP.enqueueTask(TH.create(e))}function NH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _H(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:!1;Ke(this.isSourceId(n),"Expected a valid source ID.");var s=r&&n===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return Ke(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return Ke(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return Ke(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=t1(n);return r===Lr.SOURCE}},{key:"isTargetId",value:function(n){var r=t1(n);return r===Lr.TARGET}},{key:"removeSource",value:function(n){var r=this;Ke(this.getSource(n),"Expected an existing source."),this.store.dispatch(eH(n)),MH(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){Ke(this.getTarget(n),"Expected an existing target."),this.store.dispatch(tH(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);Ke(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){Ke(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,s){var o=FH(n);return this.types.set(o,r),n===Lr.SOURCE?this.dragSources.set(o,s):n===Lr.TARGET&&this.dropTargets.set(o,s),o}}]),e}();function $H(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=BH(r),o=new vH(s,new LH(s)),a=new K6(s,o),c=e(a,t,n);return a.receiveBackend(c),a}function BH(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return PP(uH,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var zH=["children"];function UH(e,t){return qH(e)||KH(e,t)||HH(e,t)||VH()}function VH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HH(e,t){if(e){if(typeof e=="string")return r1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r1(e,t)}}function r1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GH(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o=0)&&(n[s]=e[s]);return n}var s1=0,wp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),JH=v.memo(function(t){var n=t.children,r=WH(t,zH),s=QH(r),o=UH(s,2),a=o[0],c=o[1];return v.useEffect(function(){if(c){var u=AP();return++s1,function(){--s1===0&&(u[wp]=null)}}},[]),l.jsx(NP.Provider,Object.assign({value:a},{children:n}),void 0)});function QH(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=ZH(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function ZH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:AP(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t;return s[wp]||(s[wp]={dragDropManager:$H(e,t,n,r)}),s[wp]}function AP(){return typeof global<"u"?global:window}function YH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XH(e,t){for(var n=0;n, or turn it into a ")+"drag source or a drop target itself.")}}function iK(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!v.isValidElement(t)){var r=t;return e(r,n),r}var s=t;aK(s);var o=n?function(a){return e(a,n)}:e;return lK(s,o)}}function FP(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var s=iK(r);t[n]=function(){return s}}}),t}function i1(e,t){typeof e=="function"?e(t):e.current=t}function lK(e,t){var n=e.ref;return Ke(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?v.cloneElement(e,{ref:function(s){i1(n,s),i1(t,s)}}):v.cloneElement(e,{ref:t})}function Sp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Sp=function(n){return typeof n}:Sp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Sp(e)}function cb(e){return e!==null&&Sp(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ub(e,t,n,r){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=v7(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),C7=BP(function(){return/firefox/i.test(navigator.userAgent)}),zP=BP(function(){return!!window.safari});function E7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k7(e,t){for(var n=0;nn)d=p-1;else return s[p]}u=Math.max(0,d);var g=n-r[u],h=g*g;return s[u]+o[u]*g+a[u]*h+c[u]*g*h}}]),e}(),T7=1;function UP(e){var t=e.nodeType===T7?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,s=n.left;return{x:s,y:r}}function zf(e){return{x:e.clientX,y:e.clientY}}function M7(e){var t;return e.nodeName==="IMG"&&(C7()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function N7(e,t,n,r){var s=e?t.width:n,o=e?t.height:r;return zP()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function _7(e,t,n,r,s){var o=M7(t),a=o?e:t,c=UP(a),u={x:n.x-c.x,y:n.y-c.y},i=e.offsetWidth,d=e.offsetHeight,p=r.anchorX,f=r.anchorY,g=N7(o,t,i,d),h=g.dragPreviewWidth,m=g.dragPreviewHeight,x=function(){var T=new g1([0,.5,1],[u.y,u.y/d*m,u.y+m-d]),j=T.interpolate(f);return zP()&&o&&(j+=(window.devicePixelRatio-1)*m),j},b=function(){var T=new g1([0,.5,1],[u.x,u.x/i*h,u.x+h-i]);return T.interpolate(p)},y=s.offsetX,w=s.offsetY,S=y===0||y,E=w===0||w;return{x:S?y:b(),y:E?w:x()}}var VP="__NATIVE_FILE__",HP="__NATIVE_URL__",KP="__NATIVE_TEXT__",qP="__NATIVE_HTML__";const h1=Object.freeze(Object.defineProperty({__proto__:null,FILE:VP,HTML:qP,TEXT:KP,URL:HP},Symbol.toStringTag,{value:"Module"}));function uv(e,t,n){var r=t.reduce(function(s,o){return s||e.getData(o)},"");return r??n}var ll;function Uf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fb=(ll={},Uf(ll,VP,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Uf(ll,qP,{exposeProperties:{html:function(t,n){return uv(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Uf(ll,HP,{exposeProperties:{urls:function(t,n){return uv(t,n,"").split(` -`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Uf(ll,KP,{exposeProperties:{text:function(t,n){return uv(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),ll);function P7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R7(e,t){for(var n=0;n-1})})[0]||null}function A7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F7(e,t){for(var n=0;n0&&s.actions.hover(a,{clientOffset:zf(o)});var c=a.some(function(u){return s.monitor.canDropOnTarget(u)});c&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),at(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),at(this,"handleTopDragOver",function(o){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=zf(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var c=(a||[]).some(function(u){return s.monitor.canDropOnTarget(u)});c?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),at(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),at(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;o.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else dv(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),at(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:zf(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),at(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new $7(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new S7(this.isNodeInDocument)}return U7(e,[{key:"profile",value:function(){var n,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((n=this.dragStartSourceIds)===null||n===void 0?void 0:n.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var n=this.rootElement;if(n!==void 0){if(n.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");n.__isReactDndBackendSetUp=!0,this.addEventListeners(n)}}},{key:"teardown",value:function(){var n=this.rootElement;if(n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(n,r,s){var o=this;return this.sourcePreviewNodeOptions.set(n,s),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,s){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,s);var a=function(i){return o.handleDragStart(i,n)},c=function(i){return o.handleSelectStart(i)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",c),function(){o.sourceNodes.delete(n),o.sourceNodeOptions.delete(n),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",c),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(n,r){var s=this,o=function(i){return s.handleDragEnter(i,n)},a=function(i){return s.handleDragOver(i,n)},c=function(i){return s.handleDrop(i,n)};return r.addEventListener("dragenter",o),r.addEventListener("dragover",a),r.addEventListener("drop",c),function(){r.removeEventListener("dragenter",o),r.removeEventListener("dragover",a),r.removeEventListener("drop",c)}}},{key:"addEventListeners",value:function(n){n.addEventListener&&(n.addEventListener("dragstart",this.handleTopDragStart),n.addEventListener("dragstart",this.handleTopDragStartCapture,!0),n.addEventListener("dragend",this.handleTopDragEndCapture,!0),n.addEventListener("dragenter",this.handleTopDragEnter),n.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.addEventListener("dragover",this.handleTopDragOver),n.addEventListener("dragover",this.handleTopDragOverCapture,!0),n.addEventListener("drop",this.handleTopDrop),n.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(n){n.removeEventListener&&(n.removeEventListener("dragstart",this.handleTopDragStart),n.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),n.removeEventListener("dragend",this.handleTopDragEndCapture,!0),n.removeEventListener("dragenter",this.handleTopDragEnter),n.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.removeEventListener("dragover",this.handleTopDragOver),n.removeEventListener("dragover",this.handleTopDragOverCapture,!0),n.removeEventListener("drop",this.handleTopDrop),n.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(n);return y1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(n);return y1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(h1).some(function(r){return h1[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=D7(n,r),this.currentNativeHandle=this.registry.addSource(n,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(n){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=n;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var n;(n=this.window)===null||n===void 0||n.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(n,r){n.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(n,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(n,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(n,r){this.dropTargetIds.unshift(r)}}]),e}(),H7=function(t,n,r){return new V7(t,n,r)},K7=Object.create,WP=Object.defineProperty,q7=Object.getOwnPropertyDescriptor,GP=Object.getOwnPropertyNames,W7=Object.getPrototypeOf,G7=Object.prototype.hasOwnProperty,J7=(e,t)=>function(){return t||(0,e[GP(e)[0]])((t={exports:{}}).exports,t),t.exports},Q7=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of GP(t))!G7.call(e,s)&&s!==n&&WP(e,s,{get:()=>t[s],enumerable:!(r=q7(t,s))||r.enumerable});return e},JP=(e,t,n)=>(n=e!=null?K7(W7(e)):{},Q7(WP(n,"default",{value:e,enumerable:!0}),e)),QP=J7({"node_modules/classnames/index.js"(e,t){(function(){var n={}.hasOwnProperty;function r(){for(var s=[],o=0;o-1}var oW=sW,aW=9007199254740991,iW=/^(?:0|[1-9]\d*)$/;function lW(e,t){var n=typeof e;return t=t??aW,!!t&&(n=="number"||n!="symbol"&&iW.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=dW}var rR=fW;function pW(e){return e!=null&&rR(e.length)&&!tR(e)}var gW=pW,hW=Object.prototype;function mW(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||hW;return e===n}var vW=mW;function yW(e,t){for(var n=-1,r=Array(e);++n-1}var JG=GG;function QG(e,t){var n=this.__data__,r=Lh(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var ZG=QG;function Dc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tc))return!1;var i=o.get(e),d=o.get(t);if(i&&d)return i==t&&d==e;var p=-1,f=!0,g=n&sJ?new uR:void 0;for(o.set(e,t),o.set(t,e);++p":">",'"':""","'":"'"},FJ=m9(AJ),LJ=FJ,gR=/[&<>"']/g,$J=RegExp(gR.source);function BJ(e){return e=cR(e),e&&$J.test(e)?e.replace(gR,LJ):e}var zJ=BJ,hR=/[\\^$.*+?()[\]{}|]/g,UJ=RegExp(hR.source);function VJ(e){return e=cR(e),e&&UJ.test(e)?e.replace(hR,"\\$&"):e}var HJ=VJ;function KJ(e,t){return OJ(e,t)}var qJ=KJ,WJ=1/0,GJ=Ul&&1/Iw(new Ul([,-0]))[1]==WJ?function(e){return new Ul(e)}:Jq,JJ=GJ,QJ=200;function ZJ(e,t,n){var r=-1,s=oW,o=e.length,a=!0,c=[],u=c;if(n)a=!1,s=DJ;else if(o>=QJ){var i=t?null:JJ(e);if(i)return Iw(i);a=!1,s=dR,u=new uR}else u=t?[]:c;e:for(;++rl.jsx("button",{className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),nQ=tQ,rQ=(e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,s=e.offsetTop-t.scrollTop;s+r>=n?t.scrollTop+=s-n+r:s<0&&(t.scrollTop+=s)},vb=(e,t,n,r)=>typeof r=="function"?r(e):e.length>=t&&n,sQ=e=>{const t=v.createRef(),{labelField:n,minQueryLength:r,isFocused:s,classNames:o,selectedIndex:a,query:c}=e;v.useEffect(()=>{if(!t.current)return;const p=t.current.querySelector(`.${o.activeSuggestion}`);p&&rQ(p,t.current)},[a]);const u=(p,f)=>{const g=f.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:h}=p;return{__html:h.replace(RegExp(g,"gi"),m=>`${zJ(m)}`)}},i=(p,f)=>typeof e.renderSuggestion=="function"?e.renderSuggestion(p,f):l.jsx("span",{dangerouslySetInnerHTML:u(p,f)}),d=e.suggestions.map((p,f)=>l.jsx("li",{onMouseDown:e.handleClick.bind(null,f),onTouchStart:e.handleClick.bind(null,f),onMouseOver:e.handleHover.bind(null,f),className:f===e.selectedIndex?e.classNames.activeSuggestion:"",children:i(p,e.query)},f));return d.length===0||!vb(c,r||2,s,e.shouldRenderSuggestions)?null:l.jsx("div",{ref:t,className:o.suggestions,"data-testid":"suggestions",children:l.jsxs("ul",{children:[" ",d," "]})})},oQ=(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:s,suggestions:o}=t;return!!(e.isFocused===s&&qJ(e.suggestions,o)&&vb(n,r,s,t.shouldRenderSuggestions)===vb(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)&&e.selectedIndex===t.selectedIndex)},aQ=v.memo(sQ,oQ),iQ=aQ,lQ=JP(QP()),cQ=JP(QP());function uQ(e){const t=e.map(r=>{const s=r-48*Math.floor(r/48);return String.fromCharCode(96<=r?s:r)}).join(""),n=HJ(t);return new RegExp(`[${n}]+`)}function dQ(e){switch(e){case Os.ENTER:return[10,13];case Os.TAB:return 9;case Os.COMMA:return 188;case Os.SPACE:return 32;case Os.SEMICOLON:return 186;default:return 0}}function H1(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return t!==void 0&&!n&&r}function fQ(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}var pQ=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:s,tag:o,index:a}=e,c=i=>{if(zl.ENTER.includes(i.keyCode)||i.keyCode===zl.SPACE){i.preventDefault(),i.stopPropagation();return}i.keyCode===zl.BACKSPACE&&r(i)};if(t)return l.jsx("span",{});const u=`Tag at index ${a} with value ${o.id} focussed. Press backspace to remove`;if(n){const i=n;return l.jsx(i,{"data-testid":"remove",onRemove:r,onKeyDown:c,className:s,"aria-label":u,tag:o,index:a})}return l.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:c,className:s,type:"button","aria-label":u,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:l.jsx("path",{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"})})})},gQ=pQ,K1={TAG:"tag"},hQ=e=>{const t=v.useRef(null),{readOnly:n=!1,tag:r,classNames:s,index:o,moveTag:a,allowDragDrop:c=!0,labelField:u="text",tags:i}=e,[{isDragging:d},p]=e7(()=>({type:K1.TAG,collect:x=>({isDragging:!!x.isDragging()}),item:e,canDrag:()=>H1({moveTag:a,readOnly:n,allowDragDrop:c})}),[i]),[,f]=m7(()=>({accept:K1.TAG,drop:x=>{var w;const b=x.index,y=o;b!==y&&((w=e==null?void 0:e.moveTag)==null||w.call(e,b,y))},canDrop:x=>fQ(x)}),[i]);p(f(t));const g=e.tag[u],{className:h=""}=r,m=d?0:1;return l.jsxs("span",{ref:t,className:(0,cQ.default)("tag-wrapper",s.tag,h),style:{opacity:m,cursor:H1({moveTag:a,readOnly:n,allowDragDrop:c})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[g,l.jsx(gQ,{tag:e.tag,className:s.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:o})]})},mQ=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:s,allowDeleteFromEmptyInput:o,allowAdditionFromPaste:a,allowDragDrop:c,minQueryLength:u,shouldRenderSuggestions:i,removeComponent:d,autocomplete:p,inline:f,maxTags:g,allowUnique:h,editable:m,placeholder:x,delimiters:b,separators:y,tags:w,inputFieldPosition:S,inputProps:E,classNames:C,maxLength:T,inputValue:j,clearAll:_}=e,[O,K]=v.useState(e.suggestions),[I,Y]=v.useState(""),[q,Z]=v.useState(!1),[ee,J]=v.useState(-1),[L,A]=v.useState(!1),[X,fe]=v.useState(""),[H,se]=v.useState(-1),[ne,le]=v.useState(""),oe=v.createRef(),Q=v.useRef(null),Ee=v.useRef(null);v.useEffect(()=>{b.length&&console.warn("[Deprecation] The delimiters prop is deprecated and will be removed in v7.x.x, please use separators instead. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/960")},[]),v.useEffect(()=>{typeof f<"u"&&console.warn("[Deprecation] The inline attribute is deprecated and will be removed in v7.x.x, please use inputFieldPosition instead.")},[f]),v.useEffect(()=>{typeof t<"u"&&console.warn("[Deprecated] autofocus prop will be removed in 7.x so please migrate to autoFocus prop."),(t||n&&t!==!1)&&!r&&Re()},[n,n,r]),v.useEffect(()=>{Xt()},[I,e.suggestions]);const Pe=ue=>{let He=e.suggestions.slice();if(h){const _n=w.map(xs=>xs.id.trim().toLowerCase());He=He.filter(xs=>!_n.includes(xs.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(ue,He);const Tt=He.filter(_n=>Be(ue,_n)===0),vt=He.filter(_n=>Be(ue,_n)>0);return Tt.concat(vt)},Be=(ue,He)=>He[s].toLowerCase().indexOf(ue.toLowerCase()),Re=()=>{Y(""),Q.current&&(Q.current.value="",Q.current.focus())},ve=(ue,He)=>{var vt;He.preventDefault(),He.stopPropagation();const Tt=w.slice();Tt.length!==0&&(le(""),(vt=e==null?void 0:e.handleDelete)==null||vt.call(e,ue,He),ot(ue,Tt))},ot=(ue,He)=>{var _n;if(!(oe!=null&&oe.current))return;const Tt=oe.current.querySelectorAll(".ReactTags__remove");let vt="";ue===0&&He.length>1?(vt=`Tag at index ${ue} with value ${He[ue].id} deleted. Tag at index 0 with value ${He[1].id} focussed. Press backspace to remove`,Tt[0].focus()):ue>0?(vt=`Tag at index ${ue} with value ${He[ue].id} deleted. Tag at index ${ue-1} with value ${He[ue-1].id} focussed. Press backspace to remove`,Tt[ue-1].focus()):(vt=`Tag at index ${ue} with value ${He[ue].id} deleted. Input focussed. Press enter to add a new tag`,(_n=Q.current)==null||_n.focus()),fe(vt)},Vt=(ue,He,Tt)=>{var vt,_n;r||(m&&(se(ue),Y(He[s]),(vt=Ee.current)==null||vt.focus()),(_n=e.handleTagClick)==null||_n.call(e,ue,Tt))},tn=ue=>{e.handleInputChange&&e.handleInputChange(ue.target.value,ue);const He=ue.target.value.trim();Y(He)},Xt=()=>{const ue=Pe(I);K(ue),J(ee>=ue.length?ue.length-1:ee)},ln=ue=>{const He=ue.target.value;e.handleInputFocus&&e.handleInputFocus(He,ue),Z(!0)},M=ue=>{const He=ue.target.value;e.handleInputBlur&&(e.handleInputBlur(He,ue),Q.current&&(Q.current.value="")),Z(!1),se(-1)},D=ue=>{if(ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),J(-1),A(!1),K([]),se(-1)),(y.indexOf(ue.key)!==-1||b.indexOf(ue.keyCode)!==-1)&&!ue.shiftKey){(ue.keyCode!==zl.TAB||I!=="")&&ue.preventDefault();const He=L&&ee!==-1?O[ee]:{id:I.trim(),[s]:I.trim(),className:""};Object.keys(He)&&ce(He)}ue.key==="Backspace"&&I===""&&(o||S===au.INLINE)&&ve(w.length-1,ue),ue.keyCode===zl.UP_ARROW&&(ue.preventDefault(),J(ee<=0?O.length-1:ee-1),A(!0)),ue.keyCode===zl.DOWN_ARROW&&(ue.preventDefault(),A(!0),O.length===0?J(-1):J((ee+1)%O.length))},V=()=>g&&w.length>=g,he=ue=>{if(!a)return;if(V()){le(x1.TAG_LIMIT),Re();return}le(""),ue.preventDefault();const He=ue.clipboardData||window.clipboardData,Tt=He.getData("text"),{maxLength:vt=Tt.length}=e,_n=Math.min(vt,Tt.length),xs=He.getData("text").substr(0,_n);let Io=b;y.length&&(Io=[],y.forEach(ws=>{const zc=dQ(ws);Array.isArray(zc)?Io=[...Io,...zc]:Io.push(zc)}));const Bc=uQ(Io),Zi=xs.split(Bc).map(ws=>ws.trim());eQ(Zi).forEach(ws=>ce({id:ws.trim(),[s]:ws.trim(),className:""}))},ce=ue=>{var Tt;if(!ue.id||!ue[s])return;if(H===-1){if(V()){le(x1.TAG_LIMIT),Re();return}le("")}const He=w.map(vt=>vt.id.toLowerCase());if(!(h&&He.indexOf(ue.id.trim().toLowerCase())>=0)){if(p){const vt=Pe(ue[s]);console.warn("[Deprecation] The autocomplete prop will be removed in 7.x to simplify the integration and make it more intutive. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/949"),(p===1&&vt.length===1||p===!0&&vt.length)&&(ue=vt[0])}H!==-1&&e.onTagUpdate?e.onTagUpdate(H,ue):(Tt=e==null?void 0:e.handleAddition)==null||Tt.call(e,ue),Y(""),A(!1),J(-1),se(-1),Re()}},ae=ue=>{ce(O[ue])},ke=()=>{e.onClearAll&&e.onClearAll(),le(""),Re()},rt=ue=>{J(ue),A(!0)},Pt=(ue,He)=>{var vt;const Tt=w[ue];(vt=e==null?void 0:e.handleDrag)==null||vt.call(e,Tt,ue,He)},bn=(()=>{const ue={...b1,...e.classNames};return w.map((He,Tt)=>l.jsx(v.Fragment,{children:H===Tt?l.jsx("div",{className:ue.editTagInput,children:l.jsx("input",{ref:vt=>{Ee.current=vt},onFocus:ln,value:I,onChange:tn,onKeyDown:D,onBlur:M,className:ue.editTagInputField,onPaste:he,"data-testid":"tag-edit"})}):l.jsx(hQ,{index:Tt,tag:He,tags:w,labelField:s,onDelete:vt=>ve(Tt,vt),moveTag:c?Pt:void 0,removeComponent:d,onTagClicked:vt=>Vt(Tt,He,vt),readOnly:r,classNames:ue,allowDragDrop:c})},Tt))})(),mn={...b1,...C},{name:Oo,id:bs}=e,qa=f===!1?au.BOTTOM:S,zn=r?null:l.jsxs("div",{className:mn.tagInput,children:[l.jsx("input",{...E,ref:ue=>{Q.current=ue},className:mn.tagInputField,type:"text",placeholder:x,"aria-label":x,onFocus:ln,onBlur:M,onChange:tn,onKeyDown:D,onPaste:he,name:Oo,id:bs,maxLength:T,value:j,"data-automation":"input","data-testid":"input"}),l.jsx(iQ,{query:I.trim(),suggestions:O,labelField:s,selectedIndex:ee,handleClick:ae,handleHover:rt,minQueryLength:u,shouldRenderSuggestions:i,isFocused:q,classNames:mn,renderSuggestion:e.renderSuggestion}),_&&w.length>0&&l.jsx(nQ,{classNames:mn,onClick:ke}),ne&&l.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:l.jsx("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),ne]})]});return l.jsxs("div",{className:(0,lQ.default)(mn.tags,"react-tags-wrapper"),ref:oe,children:[l.jsx("p",{role:"alert",className:"sr-only",style:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",margin:"-1px",padding:0,width:"1px",height:"1px",border:0},children:X}),qa===au.TOP&&zn,l.jsxs("div",{className:mn.selected,children:[bn,qa===au.INLINE&&zn]}),qa===au.BOTTOM&&zn]})},vQ=mQ,yQ=e=>{var ne;const{placeholder:t=Z7,labelField:n=Y7,suggestions:r=[],delimiters:s=[],separators:o=(ne=e.delimiters)!=null&&ne.length?[]:[Os.ENTER,Os.TAB],autofocus:a,autoFocus:c=!0,inline:u,inputFieldPosition:i="inline",allowDeleteFromEmptyInput:d=!1,allowAdditionFromPaste:p=!0,autocomplete:f=!1,readOnly:g=!1,allowUnique:h=!0,allowDragDrop:m=!0,tags:x=[],inputProps:b={},editable:y=!1,clearAll:w=!1,handleDelete:S,handleAddition:E,onTagUpdate:C,handleDrag:T,handleFilterSuggestions:j,handleTagClick:_,handleInputChange:O,handleInputFocus:K,handleInputBlur:I,minQueryLength:Y,shouldRenderSuggestions:q,removeComponent:Z,onClearAll:ee,classNames:J,name:L,id:A,maxLength:X,inputValue:fe,maxTags:H,renderSuggestion:se}=e;return l.jsx(vQ,{placeholder:t,labelField:n,suggestions:r,delimiters:s,separators:o,autofocus:a,autoFocus:c,inline:u,inputFieldPosition:i,allowDeleteFromEmptyInput:d,allowAdditionFromPaste:p,autocomplete:f,readOnly:g,allowUnique:h,allowDragDrop:m,tags:x,inputProps:b,editable:y,clearAll:w,handleDelete:S,handleAddition:E,onTagUpdate:C,handleDrag:T,handleFilterSuggestions:j,handleTagClick:_,handleInputChange:O,handleInputFocus:K,handleInputBlur:I,minQueryLength:Y,shouldRenderSuggestions:q,removeComponent:Z,onClearAll:ee,classNames:J,name:L,id:A,maxLength:X,inputValue:fe,maxTags:H,renderSuggestion:se})},bQ=({...e})=>l.jsx(JH,{backend:H7,children:l.jsx(yQ,{...e})});/*! Bundled license information: - -classnames/index.js: - (*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames - *) - -lodash-es/lodash.js: - (** - * @license - * Lodash (Custom Build) - * Build: `lodash modularize exports="es" -o ./` - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - *) -*/var xQ="Label",mR=v.forwardRef((e,t)=>l.jsx(Ie.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));mR.displayName=xQ;var vR=mR;const wQ=ch("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yR=v.forwardRef(({className:e,...t},n)=>l.jsx(vR,{ref:n,className:me(wQ(),e),...t}));yR.displayName=vR.displayName;function bR(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var SQ="VisuallyHidden",xR=v.forwardRef((e,t)=>l.jsx(Ie.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));xR.displayName=SQ;var CQ=[" ","Enter","ArrowUp","ArrowDown"],EQ=[" ","Enter"],tf="Select",[zh,Uh,kQ]=Ux(tf),[Lc,aae]=qr(tf,[kQ,mh]),Vh=mh(),[jQ,Aa]=Lc(tf),[TQ,MQ]=Lc(tf),wR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:a,defaultValue:c,onValueChange:u,dir:i,name:d,autoComplete:p,disabled:f,required:g}=e,h=Vh(t),[m,x]=v.useState(null),[b,y]=v.useState(null),[w,S]=v.useState(!1),E=Jd(i),[C=!1,T]=ya({prop:r,defaultProp:s,onChange:o}),[j,_]=ya({prop:a,defaultProp:c,onChange:u}),O=v.useRef(null),K=m?!!m.closest("form"):!0,[I,Y]=v.useState(new Set),q=Array.from(I).map(Z=>Z.props.value).join(";");return l.jsx(HM,{...h,children:l.jsxs(jQ,{required:g,scope:t,trigger:m,onTriggerChange:x,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:is(),value:j,onValueChange:_,open:C,onOpenChange:T,dir:E,triggerPointerDownPosRef:O,disabled:f,children:[l.jsx(zh.Provider,{scope:t,children:l.jsx(TQ,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(Z=>{Y(ee=>new Set(ee).add(Z))},[]),onNativeOptionRemove:v.useCallback(Z=>{Y(ee=>{const J=new Set(ee);return J.delete(Z),J})},[]),children:n})}),K?l.jsxs(qR,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:p,value:j,onChange:Z=>_(Z.target.value),disabled:f,children:[j===void 0?l.jsx("option",{value:""}):null,Array.from(I)]},q):null]})})};wR.displayName=tf;var SR="SelectTrigger",CR=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Vh(n),a=Aa(SR,n),c=a.disabled||r,u=ct(t,a.onTriggerChange),i=Uh(n),[d,p,f]=WR(h=>{const m=i().filter(y=>!y.disabled),x=m.find(y=>y.value===a.value),b=GR(m,h,x);b!==void 0&&a.onValueChange(b.value)}),g=()=>{c||(a.onOpenChange(!0),f())};return l.jsx(KM,{asChild:!0,...o,children:l.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":KR(a.value)?"":void 0,...s,ref:u,onClick:Ce(s.onClick,h=>{h.currentTarget.focus()}),onPointerDown:Ce(s.onPointerDown,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&m.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(g(),a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:Ce(s.onKeyDown,h=>{const m=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(m&&h.key===" ")&&CQ.includes(h.key)&&(g(),h.preventDefault())})})})});CR.displayName=SR;var ER="SelectValue",kR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:a="",...c}=e,u=Aa(ER,n),{onValueNodeHasChildrenChange:i}=u,d=o!==void 0,p=ct(t,u.onValueNodeChange);return pn(()=>{i(d)},[i,d]),l.jsx(Ie.span,{...c,ref:p,style:{pointerEvents:"none"},children:KR(u.value)?l.jsx(l.Fragment,{children:a}):o})});kR.displayName=ER;var NQ="SelectIcon",jR=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return l.jsx(Ie.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});jR.displayName=NQ;var _Q="SelectPortal",TR=e=>l.jsx(vh,{asChild:!0,...e});TR.displayName=_Q;var Li="SelectContent",MR=v.forwardRef((e,t)=>{const n=Aa(Li,e.__scopeSelect),[r,s]=v.useState();if(pn(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Pa.createPortal(l.jsx(NR,{scope:e.__scopeSelect,children:l.jsx(zh.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(_R,{...e,ref:t})});MR.displayName=Li;var ro=10,[NR,Fa]=Lc(Li),PQ="SelectContentImpl",_R=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:c,sideOffset:u,align:i,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:h,hideWhenDetached:m,avoidCollisions:x,...b}=e,y=Aa(Li,n),[w,S]=v.useState(null),[E,C]=v.useState(null),T=ct(t,Q=>S(Q)),[j,_]=v.useState(null),[O,K]=v.useState(null),I=Uh(n),[Y,q]=v.useState(!1),Z=v.useRef(!1);v.useEffect(()=>{if(w)return Yx(w)},[w]),Vx();const ee=v.useCallback(Q=>{const[Ee,...Pe]=I().map(ve=>ve.ref.current),[Be]=Pe.slice(-1),Re=document.activeElement;for(const ve of Q)if(ve===Re||(ve==null||ve.scrollIntoView({block:"nearest"}),ve===Ee&&E&&(E.scrollTop=0),ve===Be&&E&&(E.scrollTop=E.scrollHeight),ve==null||ve.focus(),document.activeElement!==Re))return},[I,E]),J=v.useCallback(()=>ee([j,w]),[ee,j,w]);v.useEffect(()=>{Y&&J()},[Y,J]);const{onOpenChange:L,triggerPointerDownPosRef:A}=y;v.useEffect(()=>{if(w){let Q={x:0,y:0};const Ee=Be=>{var Re,ve;Q={x:Math.abs(Math.round(Be.pageX)-(((Re=A.current)==null?void 0:Re.x)??0)),y:Math.abs(Math.round(Be.pageY)-(((ve=A.current)==null?void 0:ve.y)??0))}},Pe=Be=>{Q.x<=10&&Q.y<=10?Be.preventDefault():w.contains(Be.target)||L(!1),document.removeEventListener("pointermove",Ee),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",Ee),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ee),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[w,L,A]),v.useEffect(()=>{const Q=()=>L(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[L]);const[X,fe]=WR(Q=>{const Ee=I().filter(Re=>!Re.disabled),Pe=Ee.find(Re=>Re.ref.current===document.activeElement),Be=GR(Ee,Q,Pe);Be&&setTimeout(()=>Be.ref.current.focus())}),H=v.useCallback((Q,Ee,Pe)=>{const Be=!Z.current&&!Pe;(y.value!==void 0&&y.value===Ee||Be)&&(_(Q),Be&&(Z.current=!0))},[y.value]),se=v.useCallback(()=>w==null?void 0:w.focus(),[w]),ne=v.useCallback((Q,Ee,Pe)=>{const Be=!Z.current&&!Pe;(y.value!==void 0&&y.value===Ee||Be)&&K(Q)},[y.value]),le=r==="popper"?yb:PR,oe=le===yb?{side:c,sideOffset:u,align:i,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:h,hideWhenDetached:m,avoidCollisions:x}:{};return l.jsx(NR,{scope:n,content:w,viewport:E,onViewportChange:C,itemRefCallback:H,selectedItem:j,onItemLeave:se,itemTextRefCallback:ne,focusSelectedItem:J,selectedItemText:O,position:r,isPositioned:Y,searchRef:X,children:l.jsx(wh,{as:wo,allowPinchZoom:!0,children:l.jsx(ph,{asChild:!0,trapped:y.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ce(s,Q=>{var Ee;(Ee=y.trigger)==null||Ee.focus({preventScroll:!0}),Q.preventDefault()}),children:l.jsx(fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Q=>Q.preventDefault(),...b,...oe,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ce(b.onKeyDown,Q=>{const Ee=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!Ee&&Q.key.length===1&&fe(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Be=I().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Be=Be.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Re=Q.target,ve=Be.indexOf(Re);Be=Be.slice(ve+1)}setTimeout(()=>ee(Be)),Q.preventDefault()}})})})})})})});_R.displayName=PQ;var RQ="SelectItemAlignedPosition",PR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Aa(Li,n),a=Fa(Li,n),[c,u]=v.useState(null),[i,d]=v.useState(null),p=ct(t,T=>d(T)),f=Uh(n),g=v.useRef(!1),h=v.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:b,focusSelectedItem:y}=a,w=v.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&i&&m&&x&&b){const T=o.trigger.getBoundingClientRect(),j=i.getBoundingClientRect(),_=o.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(o.dir!=="rtl"){const Re=O.left-j.left,ve=_.left-Re,ot=T.left-ve,Vt=T.width+ot,tn=Math.max(Vt,j.width),Xt=window.innerWidth-ro,ln=tb(ve,[ro,Xt-tn]);c.style.minWidth=Vt+"px",c.style.left=ln+"px"}else{const Re=j.right-O.right,ve=window.innerWidth-_.right-Re,ot=window.innerWidth-T.right-ve,Vt=T.width+ot,tn=Math.max(Vt,j.width),Xt=window.innerWidth-ro,ln=tb(ve,[ro,Xt-tn]);c.style.minWidth=Vt+"px",c.style.right=ln+"px"}const K=f(),I=window.innerHeight-ro*2,Y=m.scrollHeight,q=window.getComputedStyle(i),Z=parseInt(q.borderTopWidth,10),ee=parseInt(q.paddingTop,10),J=parseInt(q.borderBottomWidth,10),L=parseInt(q.paddingBottom,10),A=Z+ee+Y+L+J,X=Math.min(x.offsetHeight*5,A),fe=window.getComputedStyle(m),H=parseInt(fe.paddingTop,10),se=parseInt(fe.paddingBottom,10),ne=T.top+T.height/2-ro,le=I-ne,oe=x.offsetHeight/2,Q=x.offsetTop+oe,Ee=Z+ee+Q,Pe=A-Ee;if(Ee<=ne){const Re=x===K[K.length-1].ref.current;c.style.bottom="0px";const ve=i.clientHeight-m.offsetTop-m.offsetHeight,ot=Math.max(le,oe+(Re?se:0)+ve+J),Vt=Ee+ot;c.style.height=Vt+"px"}else{const Re=x===K[0].ref.current;c.style.top="0px";const ot=Math.max(ne,Z+m.offsetTop+(Re?H:0)+oe)+Pe;c.style.height=ot+"px",m.scrollTop=Ee-ne+m.offsetTop}c.style.margin=`${ro}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,o.trigger,o.valueNode,c,i,m,x,b,o.dir,r]);pn(()=>w(),[w]);const[S,E]=v.useState();pn(()=>{i&&E(window.getComputedStyle(i).zIndex)},[i]);const C=v.useCallback(T=>{T&&h.current===!0&&(w(),y==null||y(),h.current=!1)},[w,y]);return l.jsx(IQ,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Ie.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});PR.displayName=RQ;var OQ="SelectPopperPosition",yb=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ro,...o}=e,a=Vh(n);return l.jsx(qM,{...a,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});yb.displayName=OQ;var[IQ,Dw]=Lc(Li,{}),bb="SelectViewport",RR=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Fa(bb,n),a=Dw(bb,n),c=ct(t,o.onViewportChange),u=v.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(zh.Slot,{scope:n,children:l.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:Ce(s.onScroll,i=>{const d=i.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&p){const g=Math.abs(u.current-d.scrollTop);if(g>0){const h=window.innerHeight-ro*2,m=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),b=Math.max(m,x);if(b0?S:0,p.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});RR.displayName=bb;var OR="SelectGroup",[DQ,AQ]=Lc(OR),FQ=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=is();return l.jsx(DQ,{scope:n,id:s,children:l.jsx(Ie.div,{role:"group","aria-labelledby":s,...r,ref:t})})});FQ.displayName=OR;var IR="SelectLabel",DR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=AQ(IR,n);return l.jsx(Ie.div,{id:s.id,...r,ref:t})});DR.displayName=IR;var Tg="SelectItem",[LQ,AR]=Lc(Tg),FR=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...a}=e,c=Aa(Tg,n),u=Fa(Tg,n),i=c.value===r,[d,p]=v.useState(o??""),[f,g]=v.useState(!1),h=ct(t,b=>{var y;return(y=u.itemRefCallback)==null?void 0:y.call(u,b,r,s)}),m=is(),x=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(LQ,{scope:n,value:r,disabled:s,textId:m,isSelected:i,onItemTextChange:v.useCallback(b=>{p(y=>y||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(zh.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:l.jsx(Ie.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":i&&f,"data-state":i?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:h,onFocus:Ce(a.onFocus,()=>g(!0)),onBlur:Ce(a.onBlur,()=>g(!1)),onPointerUp:Ce(a.onPointerUp,x),onPointerMove:Ce(a.onPointerMove,b=>{var y;s?(y=u.onItemLeave)==null||y.call(u):b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(a.onPointerLeave,b=>{var y;b.currentTarget===document.activeElement&&((y=u.onItemLeave)==null||y.call(u))}),onKeyDown:Ce(a.onKeyDown,b=>{var w;((w=u.searchRef)==null?void 0:w.current)!==""&&b.key===" "||(EQ.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});FR.displayName=Tg;var xu="SelectItemText",LR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,a=Aa(xu,n),c=Fa(xu,n),u=AR(xu,n),i=MQ(xu,n),[d,p]=v.useState(null),f=ct(t,b=>p(b),u.onItemTextChange,b=>{var y;return(y=c.itemTextRefCallback)==null?void 0:y.call(c,b,u.value,u.disabled)}),g=d==null?void 0:d.textContent,h=v.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=i;return pn(()=>(m(h),()=>x(h)),[m,x,h]),l.jsxs(l.Fragment,{children:[l.jsx(Ie.span,{id:u.textId,...o,ref:f}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Pa.createPortal(o.children,a.valueNode):null]})});LR.displayName=xu;var $R="SelectItemIndicator",BR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return AR($R,n).isSelected?l.jsx(Ie.span,{"aria-hidden":!0,...r,ref:t}):null});BR.displayName=$R;var xb="SelectScrollUpButton",zR=v.forwardRef((e,t)=>{const n=Fa(xb,e.__scopeSelect),r=Dw(xb,e.__scopeSelect),[s,o]=v.useState(!1),a=ct(t,r.onScrollButtonChange);return pn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const i=u.scrollTop>0;o(i)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?l.jsx(VR,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});zR.displayName=xb;var wb="SelectScrollDownButton",UR=v.forwardRef((e,t)=>{const n=Fa(wb,e.__scopeSelect),r=Dw(wb,e.__scopeSelect),[s,o]=v.useState(!1),a=ct(t,r.onScrollButtonChange);return pn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const i=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?l.jsx(VR,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});UR.displayName=wb;var VR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Fa("SelectScrollButton",n),a=v.useRef(null),c=Uh(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),pn(()=>{var d;const i=c().find(p=>p.ref.current===document.activeElement);(d=i==null?void 0:i.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),l.jsx(Ie.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ce(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ce(s.onPointerMove,()=>{var i;(i=o.onItemLeave)==null||i.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ce(s.onPointerLeave,()=>{u()})})}),$Q="SelectSeparator",HR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Ie.div,{"aria-hidden":!0,...r,ref:t})});HR.displayName=$Q;var Sb="SelectArrow",BQ=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Vh(n),o=Aa(Sb,n),a=Fa(Sb,n);return o.open&&a.position==="popper"?l.jsx(WM,{...s,...r,ref:t}):null});BQ.displayName=Sb;function KR(e){return e===""||e===void 0}var qR=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=v.useRef(null),o=ct(t,s),a=bR(n);return v.useEffect(()=>{const c=s.current,u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&d){const p=new Event("change",{bubbles:!0});d.call(c,n),c.dispatchEvent(p)}},[a,n]),l.jsx(xR,{asChild:!0,children:l.jsx("select",{...r,ref:o,defaultValue:n})})});qR.displayName="BubbleSelect";function WR(e){const t=on(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(a=>{const c=n.current+a;t(c),function u(i){n.current=i,window.clearTimeout(r.current),i!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(c)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function GR(e,t,n){const s=t.length>1&&Array.from(t).every(i=>i===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=zQ(e,Math.max(o,0));s.length===1&&(a=a.filter(i=>i!==n));const u=a.find(i=>i.textValue.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function zQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var UQ=wR,JR=CR,VQ=kR,HQ=jR,KQ=TR,QR=MR,qQ=RR,ZR=DR,YR=FR,WQ=LR,GQ=BR,XR=zR,eO=UR,tO=HR;const JQ=UQ,QQ=VQ,nO=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(JR,{ref:r,className:me("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-default disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,l.jsx(HQ,{asChild:!0,children:l.jsx(uh,{className:"h-4 w-4 opacity-50"})})]}));nO.displayName=JR.displayName;const rO=v.forwardRef(({className:e,...t},n)=>l.jsx(XR,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(UB,{className:"h-4 w-4"})}));rO.displayName=XR.displayName;const sO=v.forwardRef(({className:e,...t},n)=>l.jsx(eO,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(uh,{className:"h-4 w-4"})}));sO.displayName=eO.displayName;const oO=v.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(KQ,{children:l.jsxs(QR,{ref:s,className:me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[l.jsx(rO,{}),l.jsx(qQ,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(sO,{})]})}));oO.displayName=QR.displayName;const ZQ=v.forwardRef(({className:e,...t},n)=>l.jsx(ZR,{ref:n,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ZQ.displayName=ZR.displayName;const aO=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(YR,{ref:r,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(GQ,{children:l.jsx(mM,{className:"h-4 w-4"})})}),l.jsx(WQ,{children:t})]}));aO.displayName=YR.displayName;const YQ=v.forwardRef(({className:e,...t},n)=>l.jsx(tO,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));YQ.displayName=tO.displayName;var Aw="Switch",[XQ,iae]=qr(Aw),[eZ,tZ]=XQ(Aw),iO=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:c,value:u="on",onCheckedChange:i,...d}=e,[p,f]=v.useState(null),g=ct(t,y=>f(y)),h=v.useRef(!1),m=p?!!p.closest("form"):!0,[x=!1,b]=ya({prop:s,defaultProp:o,onChange:i});return l.jsxs(eZ,{scope:n,checked:x,disabled:c,children:[l.jsx(Ie.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":uO(x),"data-disabled":c?"":void 0,disabled:c,value:u,...d,ref:g,onClick:Ce(e.onClick,y=>{b(w=>!w),m&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})}),m&&l.jsx(nZ,{control:p,bubbles:!h.current,name:r,value:u,checked:x,required:a,disabled:c,style:{transform:"translateX(-100%)"}})]})});iO.displayName=Aw;var lO="SwitchThumb",cO=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=tZ(lO,n);return l.jsx(Ie.span,{"data-state":uO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});cO.displayName=lO;var nZ=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=v.useRef(null),a=bR(n),c=IM(t);return v.useEffect(()=>{const u=o.current,i=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(i,"checked").set;if(a!==n&&p){const f=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(f)}},[a,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function uO(e){return e?"checked":"unchecked"}var dO=iO,rZ=cO;const $c=v.forwardRef(({className:e,...t},n)=>l.jsx(dO,{className:me("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-slate-400",e),...t,ref:n,children:l.jsx(rZ,{className:me("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$c.displayName=dO.displayName;const La=Mn,fO=v.createContext({}),$a=({...e})=>l.jsx(fO.Provider,{value:{name:e.name},children:l.jsx(ZV,{...e})}),Hh=()=>{const e=v.useContext(fO),t=v.useContext(pO),{getFieldState:n,formState:r}=Ph(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},pO=v.createContext({}),Ro=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return l.jsx(pO.Provider,{value:{id:r},children:l.jsx("div",{ref:n,className:me("space-y-2",e),...t})})});Ro.displayName="FormItem";const Er=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Hh();return l.jsx(yR,{ref:n,className:me(r&&"text-rose-600",e),htmlFor:s,...t})});Er.displayName="FormLabel";const qs=v.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=Hh();return l.jsx(wo,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});qs.displayName="FormControl";const Kh=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Hh();return l.jsx("p",{ref:n,id:r,className:me("text-sm text-muted-foreground",e),...t})});Kh.displayName="FormDescription";const nf=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=Hh(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:r,id:o,className:me("text-sm font-medium text-rose-600",e),...n,children:a}):null});nf.displayName="FormMessage";const $=({name:e,label:t,children:n,required:r,readOnly:s,className:o,...a})=>l.jsx($a,{...a,name:e,render:({field:c})=>l.jsxs(Ro,{className:o,children:[t&&l.jsxs(Er,{children:[t,r&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),l.jsx(qs,{children:v.isValidElement(n)&&v.cloneElement(n,{...c,value:c.value??"",required:r,readOnly:s,checked:c.value,onCheckedChange:c.onChange})}),l.jsx(nf,{})]})}),ge=({name:e,label:t,required:n,className:r,helper:s,reverse:o,...a})=>l.jsx($a,{...a,name:e,render:({field:c})=>l.jsxs(Ro,{className:me("flex items-center gap-3",o&&"flex-row-reverse justify-end",r),children:[l.jsx("div",{className:"flex flex-col gap-2",children:t&&l.jsxs(Er,{children:[l.jsxs("p",{className:"break-all",children:[t,n&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s&&l.jsx(Kh,{className:"mt-2",children:s})]})}),l.jsx(qs,{children:l.jsx($c,{checked:c.value,onCheckedChange:c.onChange,required:n})}),l.jsx(nf,{})]})}),jt=({name:e,label:t,helper:n,required:r,options:s,placeholder:o,disabled:a,...c})=>l.jsx($a,{...c,name:e,render:({field:u})=>l.jsxs(Ro,{children:[t&&l.jsxs(Er,{children:[t,r&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),l.jsx(qs,{children:l.jsxs(JQ,{onValueChange:u.onChange,defaultValue:u.value,disabled:a,children:[l.jsx(qs,{children:l.jsx(nO,{children:l.jsx(QQ,{placeholder:o})})}),l.jsx(oO,{children:s.map(i=>l.jsx(aO,{value:i.value,children:i.label},i.value))})]})}),n&&l.jsx(Kh,{children:n}),l.jsx(nf,{})]})}),Ba=({name:e,label:t,helper:n,required:r,placeholder:s,...o})=>l.jsx($a,{...o,name:e,render:({field:a})=>{let c=[];return Array.isArray(a.value)&&(c=a.value),l.jsxs(Ro,{children:[t&&l.jsxs(Er,{children:[t,r&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),l.jsx(qs,{children:l.jsx(bQ,{tags:c.map(u=>({id:u,text:u,className:""})),handleDelete:u=>a.onChange(c.filter((i,d)=>d!==u)),handleAddition:u=>a.onChange([...c,u.id]),inputFieldPosition:"bottom",placeholder:s,autoFocus:!1,allowDragDrop:!1,separators:[Os.ENTER,Os.TAB,Os.COMMA],classNames:{tags:"tagsClass",tagInput:"tagInputClass",tagInputField:tP,selected:"my-2 flex flex-wrap gap-2",tag:"flex items-center gap-2 px-2 py-1 bg-primary/30 rounded-md text-xs",remove:"[&>svg]:fill-rose-600 hover:[&>svg]:fill-rose-700",suggestions:"suggestionsClass",activeSuggestion:"activeSuggestionClass",editTagInput:"editTagInputClass",editTagInputField:"editTagInputFieldClass",clearAll:"clearAllClass"}})}),n&&l.jsx(Kh,{children:n}),l.jsx(nf,{})]})}}),vv=k.string().optional().transform(e=>e===""?void 0:e),sZ=k.object({name:k.string(),token:vv,number:vv,businessId:vv,integration:k.enum(["WHATSAPP-BUSINESS","WHATSAPP-BAILEYS","EVOLUTION"])});function oZ({resetTable:e}){const{t}=Te(),{createInstance:n}=Nh(),[r,s]=v.useState(!1),o=[{value:"WHATSAPP-BAILEYS",label:t("instance.form.integration.baileys")},{value:"WHATSAPP-BUSINESS",label:t("instance.form.integration.whatsapp")},{value:"EVOLUTION",label:t("instance.form.integration.evolution")}],a=zt({resolver:Ut(sZ),defaultValues:{name:"",integration:"WHATSAPP-BAILEYS",token:LC().replace("-","").toUpperCase(),number:"",businessId:""}}),c=a.watch("integration"),u=async d=>{var p,f,g;try{const h={instanceName:d.name,integration:d.integration,token:d.token===""?null:d.token,number:d.number===""?null:d.number,businessId:d.businessId===""?null:d.businessId};await n(h),G.success(t("toast.instance.created")),s(!1),i(),e()}catch(h){console.error("Error:",h),G.error(`Error : ${(g=(f=(p=h==null?void 0:h.response)==null?void 0:p.data)==null?void 0:f.response)==null?void 0:g.message}`)}},i=()=>{a.reset({name:"",integration:"WHATSAPP-BAILEYS",token:LC().replace("-","").toLocaleUpperCase(),number:"",businessId:""})};return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"default",size:"sm",children:[t("instance.button.create")," ",l.jsx(Ws,{size:"18"})]})}),l.jsxs(ut,{className:"sm:max-w-[650px]",onCloseAutoFocus:i,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("instance.modal.title")})}),l.jsx(Mn,{...a,children:l.jsxs("form",{onSubmit:a.handleSubmit(u),className:"grid gap-4 py-4",children:[l.jsx($,{required:!0,name:"name",label:t("instance.form.name"),children:l.jsx(F,{})}),l.jsx(jt,{name:"integration",label:t("instance.form.integration.label"),options:o}),l.jsx($,{required:!0,name:"token",label:t("instance.form.token"),children:l.jsx(F,{})}),l.jsx($,{name:"number",label:t("instance.form.number"),children:l.jsx(F,{type:"tel"})}),c==="WHATSAPP-BUSINESS"&&l.jsx($,{required:!0,name:"businessId",label:t("instance.form.businessId"),children:l.jsx(F,{})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:t("instance.button.save")})})]})})]})]})}function aZ(){const{t:e}=Te(),[t,n]=v.useState(null),{deleteInstance:r,logout:s}=Nh(),{data:o,refetch:a}=$V(),[c,u]=v.useState([]),[i,d]=v.useState("all"),[p,f]=v.useState(""),g=async()=>{await a()},h=async b=>{var y,w,S;n(null),u([...c,b]);try{try{await s(b)}catch(E){console.error("Error logout:",E)}await r(b),await new Promise(E=>setTimeout(E,1e3)),g()}catch(E){console.error("Error instance delete:",E),G.error(`Error : ${(S=(w=(y=E==null?void 0:E.response)==null?void 0:y.data)==null?void 0:w.response)==null?void 0:S.message}`)}finally{u(c.filter(E=>E!==b))}},m=v.useMemo(()=>{let b=o?[...o]:[];return i!=="all"&&(b=b.filter(y=>y.connectionStatus===i)),p!==""&&(b=b.filter(y=>y.name.toLowerCase().includes(p.toLowerCase()))),b},[o,p,i]),x=[{value:"all",label:e("status.all")},{value:"close",label:e("status.closed")},{value:"connecting",label:e("status.connecting")},{value:"open",label:e("status.open")}];return l.jsxs("div",{className:"my-4 px-4",children:[l.jsxs("div",{className:"flex w-full items-center justify-between",children:[l.jsx("h2",{className:"text-lg",children:e("dashboard.title")}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(z,{variant:"outline",size:"icon",children:l.jsx(rg,{onClick:g,size:"20"})}),l.jsx(oZ,{resetTable:g})]})]}),l.jsxs("div",{className:"my-4 flex items-center justify-between gap-3 px-4",children:[l.jsx("div",{className:"flex-1",children:l.jsx(F,{placeholder:e("dashboard.search"),value:p,onChange:b=>f(b.target.value)})}),l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"secondary",children:[e("dashboard.status")," ",l.jsx(VB,{size:"15"})]})}),l.jsx(Mr,{children:x.map(b=>l.jsx(XN,{checked:i===b.value,onCheckedChange:y=>{y&&d(b.value)},children:b.label},b.value))})]})]}),l.jsx("main",{className:"grid gap-6 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.length>0&&Array.isArray(o)&&o.map(b=>{var y,w;return l.jsxs(oi,{children:[l.jsx(ai,{children:l.jsxs(ld,{to:`/manager/instance/${b.id}/dashboard`,className:"flex w-full flex-row items-center justify-between gap-4",children:[l.jsx("h3",{className:"text-wrap font-semibold",children:b.name}),l.jsx(z,{variant:"ghost",size:"icon",children:l.jsx(To,{className:"card-icon",size:"20"})})]})}),l.jsxs(ii,{className:"flex-1 space-y-6",children:[l.jsx(X_,{token:b.token}),l.jsxs("div",{className:"flex w-full flex-wrap",children:[l.jsx("div",{className:"flex flex-1 gap-2",children:b.profileName&&l.jsxs(l.Fragment,{children:[l.jsx(Eh,{children:l.jsx(kh,{src:b.profilePicUrl,alt:""})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("strong",{children:b.profileName}),l.jsx("p",{className:"text-sm text-muted-foreground",children:b.ownerJid&&b.ownerJid.split("@")[0]})]})]})}),l.jsxs("div",{className:"flex items-center justify-end gap-4 text-sm",children:[l.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[l.jsx(vM,{className:"text-muted-foreground",size:"20"}),l.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(((y=b==null?void 0:b._count)==null?void 0:y.Contact)||0)})]}),l.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[l.jsx(dh,{className:"text-muted-foreground",size:"20"}),l.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(((w=b==null?void 0:b._count)==null?void 0:w.Message)||0)})]})]})]})]}),l.jsxs(Mh,{className:"justify-between",children:[l.jsx(Y_,{status:b.connectionStatus}),l.jsx(z,{variant:"destructive",size:"sm",onClick:()=>n(b.name),disabled:c.includes(b.name),children:c.includes(b.name)?l.jsx("span",{children:e("button.deleting")}):l.jsx("span",{children:e("button.delete")})})]})]},b.id)})}),!!t&&l.jsx(pt,{onOpenChange:()=>n(null),open:!0,children:l.jsxs(ut,{children:[l.jsx(__,{}),l.jsx(dt,{children:e("modal.delete.title")}),l.jsx("p",{children:e("modal.delete.message",{instanceName:t})}),l.jsx(_t,{children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(z,{onClick:()=>n(null),size:"sm",variant:"outline",children:e("button.cancel")}),l.jsx(z,{onClick:()=>h(t),variant:"destructive",children:e("button.delete")})]})})]})})]})}const{createElement:yc,createContext:iZ,createRef:lae,forwardRef:gO,useCallback:dr,useContext:hO,useEffect:Ci,useImperativeHandle:mO,useLayoutEffect:lZ,useMemo:cZ,useRef:nr,useState:Lu}=Dg,q1=Dg.useId,uZ=lZ,qh=iZ(null);qh.displayName="PanelGroupContext";const Ei=uZ,dZ=typeof q1=="function"?q1:()=>null;let fZ=0;function Fw(e=null){const t=dZ(),n=nr(e||t||null);return n.current===null&&(n.current=""+fZ++),e??n.current}function vO({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:o,id:a,maxSize:c,minSize:u,onCollapse:i,onExpand:d,onResize:p,order:f,style:g,tagName:h="div",...m}){const x=hO(qh);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:y,getPanelSize:w,getPanelStyle:S,groupId:E,isPanelCollapsed:C,reevaluatePanelConstraints:T,registerPanel:j,resizePanel:_,unregisterPanel:O}=x,K=Fw(a),I=nr({callbacks:{onCollapse:i,onExpand:d,onResize:p},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:c,minSize:u},id:K,idIsFromProps:a!==void 0,order:f});nr({didLogMissingDefaultSizeWarning:!1}),Ei(()=>{const{callbacks:q,constraints:Z}=I.current,ee={...Z};I.current.id=K,I.current.idIsFromProps=a!==void 0,I.current.order=f,q.onCollapse=i,q.onExpand=d,q.onResize=p,Z.collapsedSize=n,Z.collapsible=r,Z.defaultSize=s,Z.maxSize=c,Z.minSize=u,(ee.collapsedSize!==Z.collapsedSize||ee.collapsible!==Z.collapsible||ee.maxSize!==Z.maxSize||ee.minSize!==Z.minSize)&&T(I.current,ee)}),Ei(()=>{const q=I.current;return j(q),()=>{O(q)}},[f,K,j,O]),mO(o,()=>({collapse:()=>{b(I.current)},expand:q=>{y(I.current,q)},getId(){return K},getSize(){return w(I.current)},isCollapsed(){return C(I.current)},isExpanded(){return!C(I.current)},resize:q=>{_(I.current,q)}}),[b,y,w,C,K,_]);const Y=S(I.current,s);return yc(h,{...m,children:e,className:t,id:a,style:{...Y,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":E,"data-panel-id":K,"data-panel-size":parseFloat(""+Y.flexGrow).toFixed(1)})}const yO=gO((e,t)=>yc(vO,{...e,forwardedRef:t}));vO.displayName="Panel";yO.displayName="forwardRef(Panel)";let Cb=null,ci=null;function pZ(e,t){if(t){const n=(t&CO)!==0,r=(t&EO)!==0,s=(t&kO)!==0,o=(t&jO)!==0;if(n)return s?"se-resize":o?"ne-resize":"e-resize";if(r)return s?"sw-resize":o?"nw-resize":"w-resize";if(s)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function gZ(){ci!==null&&(document.head.removeChild(ci),Cb=null,ci=null)}function yv(e,t){const n=pZ(e,t);Cb!==n&&(Cb=n,ci===null&&(ci=document.createElement("style"),document.head.appendChild(ci)),ci.innerHTML=`*{cursor: ${n}!important;}`)}function bO(e){return e.type==="keydown"}function xO(e){return e.type.startsWith("pointer")}function wO(e){return e.type.startsWith("mouse")}function Wh(e){if(xO(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(wO(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function hZ(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function mZ(e,t,n){return e.xt.x&&e.yt.y}function vZ(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:J1(e),b:J1(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;st(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:G1(W1(n.a)),b:G1(W1(n.b))};if(s.a===s.b){const o=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let c=o.length;for(;c--;){const u=o[c];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(s.a-s.b)}const yZ=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function bZ(e){var t;const n=getComputedStyle((t=SO(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function xZ(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||bZ(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||yZ.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function W1(e){let t=e.length;for(;t--;){const n=e[t];if(st(n,"Missing node"),xZ(n))return n}return null}function G1(e){return e&&Number(getComputedStyle(e).zIndex)||0}function J1(e){const t=[];for(;e;)t.push(e),e=SO(e);return t}function SO(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const CO=1,EO=2,kO=4,jO=8,wZ=hZ()==="coarse";let cs=[],Od=!1,Jo=new Map,Gh=new Map;const Id=new Set;function SZ(e,t,n,r,s){var o;const{ownerDocument:a}=t,c={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},u=(o=Jo.get(a))!==null&&o!==void 0?o:0;return Jo.set(a,u+1),Id.add(c),Mg(),function(){var d;Gh.delete(e),Id.delete(c);const p=(d=Jo.get(a))!==null&&d!==void 0?d:1;if(Jo.set(a,p-1),Mg(),p===1&&Jo.delete(a),cs.includes(c)){const f=cs.indexOf(c);f>=0&&cs.splice(f,1),$w()}}}function Q1(e){const{target:t}=e,{x:n,y:r}=Wh(e);Od=!0,Lw({target:t,x:n,y:r}),Mg(),cs.length>0&&(Ng("down",e),e.preventDefault(),e.stopPropagation())}function lu(e){const{x:t,y:n}=Wh(e);if(e.buttons===0&&(Od=!1,Ng("up",e)),!Od){const{target:r}=e;Lw({target:r,x:t,y:n})}Ng("move",e),$w(),cs.length>0&&e.preventDefault()}function cl(e){const{target:t}=e,{x:n,y:r}=Wh(e);Gh.clear(),Od=!1,cs.length>0&&e.preventDefault(),Ng("up",e),Lw({target:t,x:n,y:r}),$w(),Mg()}function Lw({target:e,x:t,y:n}){cs.splice(0);let r=null;e instanceof HTMLElement&&(r=e),Id.forEach(s=>{const{element:o,hitAreaMargins:a}=s,c=o.getBoundingClientRect(),{bottom:u,left:i,right:d,top:p}=c,f=wZ?a.coarse:a.fine;if(t>=i-f&&t<=d+f&&n>=p-f&&n<=u+f){if(r!==null&&o!==r&&!o.contains(r)&&!r.contains(o)&&vZ(r,o)>0){let h=r,m=!1;for(;h&&!h.contains(o);){if(mZ(h.getBoundingClientRect(),c)){m=!0;break}h=h.parentElement}if(m)return}cs.push(s)}})}function bv(e,t){Gh.set(e,t)}function $w(){let e=!1,t=!1;cs.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;Gh.forEach(r=>{n|=r}),e&&t?yv("intersection",n):e?yv("horizontal",n):t?yv("vertical",n):gZ()}function Mg(){Jo.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",cl),n.removeEventListener("pointerdown",Q1),n.removeEventListener("pointerleave",lu),n.removeEventListener("pointermove",lu)}),window.removeEventListener("pointerup",cl),window.removeEventListener("pointercancel",cl),Id.size>0&&(Od?(cs.length>0&&Jo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",cl),n.addEventListener("pointerleave",lu),n.addEventListener("pointermove",lu))}),window.addEventListener("pointerup",cl),window.addEventListener("pointercancel",cl)):Jo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",Q1,{capture:!0}),n.addEventListener("pointermove",lu))}))}function Ng(e,t){Id.forEach(n=>{const{setResizeHandlerState:r}=n,s=cs.includes(n);r(e,s,t)})}function st(e,t){if(!e)throw console.error(t),Error(t)}const Bw=10;function $i(e,t,n=Bw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function io(e,t,n=Bw){return $i(e,t,n)===0}function hr(e,t,n){return $i(e,t,n)===0}function CZ(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-b:b)}}}{const p=e<0?c:u,f=n[p];st(f,`No panel constraints found for index ${p}`);const{collapsedSize:g=0,collapsible:h,minSize:m=0}=f;if(h){const x=t[p];if(st(x!=null,`Previous layout not found for panel index ${p}`),hr(x,m)){const b=x-g;$i(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const p=e<0?1:-1;let f=e<0?u:c,g=0;for(;;){const m=t[f];st(m!=null,`Previous layout not found for panel index ${f}`);const b=_l({panelConstraints:n,panelIndex:f,size:100})-m;if(g+=b,f+=p,f<0||f>=n.length)break}const h=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-h:h}{let f=e<0?c:u;for(;f>=0&&f=0))break;e<0?f--:f++}}if(CZ(s,a))return s;{const p=e<0?u:c,f=t[p];st(f!=null,`Previous layout not found for panel index ${p}`);const g=f+i,h=_l({panelConstraints:n,panelIndex:p,size:g});if(a[p]=h,!hr(h,g)){let m=g-h,b=e<0?u:c;for(;b>=0&&b0?b--:b++}}}const d=a.reduce((p,f)=>f+p,0);return hr(d,100)?a:s}function EZ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,o=0,a=0;const c=n[0];st(c!=null,"No pivot index found"),t.forEach((p,f)=>{const{constraints:g}=p,{maxSize:h=100,minSize:m=0}=g;f===c?(r=m,s=h):(o+=m,a+=h)});const u=Math.min(s,100-o),i=Math.max(r,100-a),d=e[c];return{valueMax:u,valueMin:i,valueNow:d}}function Dd(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function TO(e,t,n=document){const s=Dd(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return s??null}function MO(e,t,n){const r=TO(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function NO(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Jh(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function kZ(e,t,n,r=document){var s,o,a,c;const u=Jh(t,r),i=Dd(e,r),d=u?i.indexOf(u):-1,p=(s=(o=n[d])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null,f=(a=(c=n[d+1])===null||c===void 0?void 0:c.id)!==null&&a!==void 0?a:null;return[p,f]}function jZ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:o,setLayout:a}){nr({didWarnAboutMissingResizeHandle:!1}),Ei(()=>{if(!o)return;const c=Dd(n,o);for(let u=0;u{c.forEach((u,i)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,s,o]),Ci(()=>{if(!o)return;const c=t.current;st(c,"Eager values not found");const{panelDataArray:u}=c,i=NO(n,o);st(i!=null,`No group found for id "${n}"`);const d=Dd(n,o);st(d,`No resize handles found for group id "${n}"`);const p=d.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");st(g,"Resize handle element has no handle id attribute");const[h,m]=kZ(n,g,u,o);if(h==null||m==null)return()=>{};const x=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const y=u.findIndex(w=>w.id===h);if(y>=0){const w=u[y];st(w,`No panel data found for index ${y}`);const S=r[y],{collapsedSize:E=0,collapsible:C,minSize:T=0}=w.constraints;if(S!=null&&C){const j=wu({delta:hr(S,E)?T-E:E-S,initialLayout:r,panelConstraints:u.map(_=>_.constraints),pivotIndices:MO(n,g,o),prevLayout:r,trigger:"keyboard"});r!==j&&a(j)}}break}}};return f.addEventListener("keydown",x),()=>{f.removeEventListener("keydown",x)}});return()=>{p.forEach(f=>f())}},[o,e,t,n,r,s,a])}function Z1(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,s=100;for(let o=0;o{const o=e[s];st(o,`Panel data not found for index ${s}`);const{callbacks:a,constraints:c,id:u}=o,{collapsedSize:i=0,collapsible:d}=c,p=n[u];if(p==null||r!==p){n[u]=r;const{onCollapse:f,onExpand:g,onResize:h}=a;h&&h(r,p),d&&(f||g)&&(g&&(p==null||io(p,i))&&!io(r,i)&&g(),f&&(p==null||!io(p,i))&&io(r,i)&&f())}})}function Hf(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function Y1(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function PO(e){return`react-resizable-panels:${e}`}function RO(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:o}=t;return s?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function OO(e,t){try{const n=PO(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function RZ(e,t,n){var r,s;const o=(r=OO(e,n))!==null&&r!==void 0?r:{},a=RO(t);return(s=o[a])!==null&&s!==void 0?s:null}function OZ(e,t,n,r,s){var o;const a=PO(e),c=RO(t),u=(o=OO(e,s))!==null&&o!==void 0?o:{};u[c]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(u))}catch(i){console.error(i)}}function X1({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,a)=>o+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!hr(r,100))for(let o=0;o(Y1(Su),Su.getItem(e)),setItem:(e,t)=>{Y1(Su),Su.setItem(e,t)}},eE={};function IO({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:o=null,onLayout:a=null,keyboardResizeBy:c=null,storage:u=Su,style:i,tagName:d="div",...p}){const f=Fw(o),g=nr(null),[h,m]=Lu(null),[x,b]=Lu([]),y=nr({}),w=nr(new Map),S=nr(0),E=nr({autoSaveId:e,direction:r,dragState:h,id:f,keyboardResizeBy:c,onLayout:a,storage:u}),C=nr({layout:x,panelDataArray:[],panelDataArrayChanged:!1});nr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),mO(s,()=>({getId:()=>E.current.id,getLayout:()=>{const{layout:H}=C.current;return H},setLayout:H=>{const{onLayout:se}=E.current,{layout:ne,panelDataArray:le}=C.current,oe=X1({layout:H,panelConstraints:le.map(Q=>Q.constraints)});Z1(ne,oe)||(b(oe),C.current.layout=oe,se&&se(oe),ul(le,oe,y.current))}}),[]),Ei(()=>{E.current.autoSaveId=e,E.current.direction=r,E.current.dragState=h,E.current.id=f,E.current.onLayout=a,E.current.storage=u}),jZ({committedValuesRef:E,eagerValuesRef:C,groupId:f,layout:x,panelDataArray:C.current.panelDataArray,setLayout:b,panelGroupElement:g.current}),Ci(()=>{const{panelDataArray:H}=C.current;if(e){if(x.length===0||x.length!==H.length)return;let se=eE[e];se==null&&(se=PZ(OZ,IZ),eE[e]=se);const ne=[...H],le=new Map(w.current);se(e,ne,le,x,u)}},[e,x,u]),Ci(()=>{});const T=dr(H=>{const{onLayout:se}=E.current,{layout:ne,panelDataArray:le}=C.current;if(H.constraints.collapsible){const oe=le.map(Be=>Be.constraints),{collapsedSize:Q=0,panelSize:Ee,pivotIndices:Pe}=Wa(le,H,ne);if(st(Ee!=null,`Panel size not found for panel "${H.id}"`),!io(Ee,Q)){w.current.set(H.id,Ee);const Re=gl(le,H)===le.length-1?Ee-Q:Q-Ee,ve=wu({delta:Re,initialLayout:ne,panelConstraints:oe,pivotIndices:Pe,prevLayout:ne,trigger:"imperative-api"});Hf(ne,ve)||(b(ve),C.current.layout=ve,se&&se(ve),ul(le,ve,y.current))}}},[]),j=dr((H,se)=>{const{onLayout:ne}=E.current,{layout:le,panelDataArray:oe}=C.current;if(H.constraints.collapsible){const Q=oe.map(ot=>ot.constraints),{collapsedSize:Ee=0,panelSize:Pe=0,minSize:Be=0,pivotIndices:Re}=Wa(oe,H,le),ve=se??Be;if(io(Pe,Ee)){const ot=w.current.get(H.id),Vt=ot!=null&&ot>=ve?ot:ve,Xt=gl(oe,H)===oe.length-1?Pe-Vt:Vt-Pe,ln=wu({delta:Xt,initialLayout:le,panelConstraints:Q,pivotIndices:Re,prevLayout:le,trigger:"imperative-api"});Hf(le,ln)||(b(ln),C.current.layout=ln,ne&&ne(ln),ul(oe,ln,y.current))}}},[]),_=dr(H=>{const{layout:se,panelDataArray:ne}=C.current,{panelSize:le}=Wa(ne,H,se);return st(le!=null,`Panel size not found for panel "${H.id}"`),le},[]),O=dr((H,se)=>{const{panelDataArray:ne}=C.current,le=gl(ne,H);return _Z({defaultSize:se,dragState:h,layout:x,panelData:ne,panelIndex:le})},[h,x]),K=dr(H=>{const{layout:se,panelDataArray:ne}=C.current,{collapsedSize:le=0,collapsible:oe,panelSize:Q}=Wa(ne,H,se);return st(Q!=null,`Panel size not found for panel "${H.id}"`),oe===!0&&io(Q,le)},[]),I=dr(H=>{const{layout:se,panelDataArray:ne}=C.current,{collapsedSize:le=0,collapsible:oe,panelSize:Q}=Wa(ne,H,se);return st(Q!=null,`Panel size not found for panel "${H.id}"`),!oe||$i(Q,le)>0},[]),Y=dr(H=>{const{panelDataArray:se}=C.current;se.push(H),se.sort((ne,le)=>{const oe=ne.order,Q=le.order;return oe==null&&Q==null?0:oe==null?-1:Q==null?1:oe-Q}),C.current.panelDataArrayChanged=!0},[]);Ei(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:se,storage:ne}=E.current,{layout:le,panelDataArray:oe}=C.current;let Q=null;if(H){const Pe=RZ(H,oe,ne);Pe&&(w.current=new Map(Object.entries(Pe.expandToSizes)),Q=Pe.layout)}Q==null&&(Q=NZ({panelDataArray:oe}));const Ee=X1({layout:Q,panelConstraints:oe.map(Pe=>Pe.constraints)});Z1(le,Ee)||(b(Ee),C.current.layout=Ee,se&&se(Ee),ul(oe,Ee,y.current))}}),Ei(()=>{const H=C.current;return()=>{H.layout=[]}},[]);const q=dr(H=>function(ne){ne.preventDefault();const le=g.current;if(!le)return()=>null;const{direction:oe,dragState:Q,id:Ee,keyboardResizeBy:Pe,onLayout:Be}=E.current,{layout:Re,panelDataArray:ve}=C.current,{initialLayout:ot}=Q??{},Vt=MO(Ee,H,le);let tn=MZ(ne,H,oe,Q,Pe,le);const Xt=oe==="horizontal";document.dir==="rtl"&&Xt&&(tn=-tn);const ln=ve.map(V=>V.constraints),M=wu({delta:tn,initialLayout:ot??Re,panelConstraints:ln,pivotIndices:Vt,prevLayout:Re,trigger:bO(ne)?"keyboard":"mouse-or-touch"}),D=!Hf(Re,M);(xO(ne)||wO(ne))&&S.current!=tn&&(S.current=tn,D?bv(H,0):Xt?bv(H,tn<0?CO:EO):bv(H,tn<0?kO:jO)),D&&(b(M),C.current.layout=M,Be&&Be(M),ul(ve,M,y.current))},[]),Z=dr((H,se)=>{const{onLayout:ne}=E.current,{layout:le,panelDataArray:oe}=C.current,Q=oe.map(ot=>ot.constraints),{panelSize:Ee,pivotIndices:Pe}=Wa(oe,H,le);st(Ee!=null,`Panel size not found for panel "${H.id}"`);const Re=gl(oe,H)===oe.length-1?Ee-se:se-Ee,ve=wu({delta:Re,initialLayout:le,panelConstraints:Q,pivotIndices:Pe,prevLayout:le,trigger:"imperative-api"});Hf(le,ve)||(b(ve),C.current.layout=ve,ne&&ne(ve),ul(oe,ve,y.current))},[]),ee=dr((H,se)=>{const{layout:ne,panelDataArray:le}=C.current,{collapsedSize:oe=0,collapsible:Q}=se,{collapsedSize:Ee=0,collapsible:Pe,maxSize:Be=100,minSize:Re=0}=H.constraints,{panelSize:ve}=Wa(le,H,ne);ve!=null&&(Q&&Pe&&io(ve,oe)?io(oe,Ee)||Z(H,Ee):veBe&&Z(H,Be))},[Z]),J=dr((H,se)=>{const{direction:ne}=E.current,{layout:le}=C.current;if(!g.current)return;const oe=Jh(H,g.current);st(oe,`Drag handle element not found for id "${H}"`);const Q=_O(ne,se);m({dragHandleId:H,dragHandleRect:oe.getBoundingClientRect(),initialCursorPosition:Q,initialLayout:le})},[]),L=dr(()=>{m(null)},[]),A=dr(H=>{const{panelDataArray:se}=C.current,ne=gl(se,H);ne>=0&&(se.splice(ne,1),delete y.current[H.id],C.current.panelDataArrayChanged=!0)},[]),X=cZ(()=>({collapsePanel:T,direction:r,dragState:h,expandPanel:j,getPanelSize:_,getPanelStyle:O,groupId:f,isPanelCollapsed:K,isPanelExpanded:I,reevaluatePanelConstraints:ee,registerPanel:Y,registerResizeHandle:q,resizePanel:Z,startDragging:J,stopDragging:L,unregisterPanel:A,panelGroupElement:g.current}),[T,h,r,j,_,O,f,K,I,ee,Y,q,Z,J,L,A]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return yc(qh.Provider,{value:X},yc(d,{...p,children:t,className:n,id:o,ref:g,style:{...fe,...i},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const DO=gO((e,t)=>yc(IO,{...e,forwardedRef:t}));IO.displayName="PanelGroup";DO.displayName="forwardRef(PanelGroup)";function gl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Wa(e,t,n){const r=gl(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:o}}function DZ({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Ci(()=>{if(e||n==null||r==null)return;const s=Jh(t,r);if(s==null)return;const o=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const c=s.getAttribute("data-panel-group-id");st(c,`No group element found for id "${c}"`);const u=Dd(c,r),i=TO(c,t,r);st(i!==null,`No resize element found for id "${t}"`);const d=a.shiftKey?i>0?i-1:u.length-1:i+1{s.removeEventListener("keydown",o)}},[r,e,t,n])}function AO({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:o,onDragging:a,onFocus:c,style:u={},tabIndex:i=0,tagName:d="div",...p}){var f,g;const h=nr(null),m=nr({onDragging:a});Ci(()=>{m.current.onDragging=a});const x=hO(qh);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:y,registerResizeHandle:w,startDragging:S,stopDragging:E,panelGroupElement:C}=x,T=Fw(s),[j,_]=Lu("inactive"),[O,K]=Lu(!1),[I,Y]=Lu(null),q=nr({state:j});Ei(()=>{q.current.state=j}),Ci(()=>{if(n)Y(null);else{const L=w(T);Y(()=>L)}},[n,T,w]);const Z=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,ee=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return Ci(()=>{if(n||I==null)return;const L=h.current;return st(L,"Element ref not attached"),SZ(T,L,b,{coarse:Z,fine:ee},(X,fe,H)=>{if(fe)switch(X){case"down":{_("drag"),S(T,H);const{onDragging:se}=m.current;se&&se(!0);break}case"move":{const{state:se}=q.current;se!=="drag"&&_("hover"),I(H);break}case"up":{_("hover"),E();const{onDragging:se}=m.current;se&&se(!1);break}}else _("inactive")})},[Z,b,n,ee,w,T,I,S,E]),DZ({disabled:n,handleId:T,resizeHandler:I,panelGroupElement:C}),yc(d,{...p,children:e,className:t,id:s,onBlur:()=>{K(!1),o==null||o()},onFocus:()=>{K(!0),c==null||c()},ref:h,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...u},tabIndex:i,"data-panel-group-direction":b,"data-panel-group-id":y,"data-resize-handle":"","data-resize-handle-active":j==="drag"?"pointer":O?"keyboard":void 0,"data-resize-handle-state":j,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":T})}AO.displayName="PanelResizeHandle";const za=({className:e,...t})=>l.jsx(DO,{className:me("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Bn=yO,Ua=({withHandle:e,className:t,...n})=>l.jsx(AO,{className:me("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 after:bg-border focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&l.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:l.jsx(ZB,{className:"h-2.5 w-2.5"})})});var zw="Tabs",[AZ,cae]=qr(zw,[bh]),FO=bh(),[FZ,Uw]=AZ(zw),LO=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...i}=e,d=Jd(c),[p,f]=ya({prop:r,onChange:s,defaultProp:o});return l.jsx(FZ,{scope:n,baseId:is(),value:p,onValueChange:f,orientation:a,dir:d,activationMode:u,children:l.jsx(Ie.div,{dir:d,"data-orientation":a,...i,ref:t})})});LO.displayName=zw;var $O="TabsList",BO=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Uw($O,n),a=FO(n);return l.jsx(XM,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Ie.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});BO.displayName=$O;var zO="TabsTrigger",UO=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=Uw(zO,n),c=FO(n),u=KO(a.baseId,r),i=qO(a.baseId,r),d=r===a.value;return l.jsx(eN,{asChild:!0,...c,focusable:!s,active:d,children:l.jsx(Ie.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":i,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Ce(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:Ce(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const p=a.activationMode!=="manual";!d&&!s&&p&&a.onValueChange(r)})})})});UO.displayName=zO;var VO="TabsContent",HO=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=Uw(VO,n),u=KO(c.baseId,r),i=qO(c.baseId,r),d=r===c.value,p=v.useRef(d);return v.useEffect(()=>{const f=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(f)},[]),l.jsx(cr,{present:s||d,children:({present:f})=>l.jsx(Ie.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!f,id:i,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:f&&o})})});HO.displayName=VO;function KO(e,t){return`${e}-trigger-${t}`}function qO(e,t){return`${e}-content-${t}`}var LZ=LO,WO=BO,GO=UO,JO=HO;const $Z=LZ,QO=v.forwardRef(({className:e,...t},n)=>l.jsx(WO,{ref:n,className:me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));QO.displayName=WO.displayName;const Eb=v.forwardRef(({className:e,...t},n)=>l.jsx(GO,{ref:n,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Eb.displayName=GO.displayName;const kb=v.forwardRef(({className:e,...t},n)=>l.jsx(JO,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kb.displayName=JO.displayName;const BZ=e=>["chats","findChats",JSON.stringify(e)],zZ=async({instanceName:e})=>(await ie.post(`/chat/findChats/${e}`,{where:{}})).data,UZ=e=>{const{instanceName:t,...n}=e;return qe({...n,queryKey:BZ({instanceName:t}),queryFn:()=>zZ({instanceName:t}),enabled:!!t})};function Va(e){const t=o=>typeof window<"u"?window.matchMedia(o).matches:!1,[n,r]=v.useState(t(e));function s(){r(t(e))}return v.useEffect(()=>{const o=window.matchMedia(e);return s(),o.addListener?o.addListener(s):o.addEventListener("change",s),()=>{o.removeListener?o.removeListener(s):o.removeEventListener("change",s)}},[e]),n}const Vl=v.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:me("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Vl.displayName="Textarea";const VZ=e=>["chats","findChats",JSON.stringify(e)],HZ=async({instanceName:e,remoteJid:t})=>{const n=await ie.post(`/chat/findChats/${e}`,{where:{remoteJid:t}});return Array.isArray(n.data)?n.data[0]:n.data},KZ=e=>{const{instanceName:t,remoteJid:n,...r}=e;return qe({...r,queryKey:VZ({instanceName:t,remoteJid:n}),queryFn:()=>HZ({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},qZ=e=>["chats","findMessages",JSON.stringify(e)],WZ=async({instanceName:e,remoteJid:t})=>{var r,s;const n=await ie.post(`/chat/findMessages/${e}`,{where:{key:{remoteJid:t}}});return(s=(r=n.data)==null?void 0:r.messages)!=null&&s.records?n.data.messages.records:n.data},GZ=e=>{const{instanceName:t,remoteJid:n,...r}=e;return qe({...r,queryKey:qZ({instanceName:t,remoteJid:n}),queryFn:()=>WZ({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})};function JZ({textareaRef:e,handleTextareaChange:t,textareaHeight:n,lastMessageRef:r,scrollToBottom:s}){const{instance:o}=Ve(),{remoteJid:a}=gs(),{data:c}=KZ({remoteJid:a,instanceName:o==null?void 0:o.name}),{data:u,isSuccess:i}=GZ({remoteJid:a,instanceName:o==null?void 0:o.name});v.useEffect(()=>{i&&u&&s()},[i,u,s]);const d=f=>l.jsx("div",{className:"bubble-right",children:l.jsx("div",{className:"flex items-start gap-4 self-end",children:l.jsx("div",{className:"grid gap-1",children:l.jsx("div",{className:"prose text-muted-foreground",children:l.jsx("div",{className:"bubble",children:JSON.stringify(f.message)})})})})}),p=f=>l.jsx("div",{className:"bubble-left",children:l.jsx("div",{className:"flex items-start gap-4",children:l.jsx("div",{className:"grid gap-1",children:l.jsx("div",{className:"prose text-muted-foreground",children:l.jsx("div",{className:"bubble",children:JSON.stringify(f.message)})})})})});return l.jsxs("div",{className:"flex min-h-screen flex-col",children:[l.jsx("div",{className:"sticky top-0 p-2",children:l.jsxs(iw,{children:[l.jsx(lw,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-10 gap-1 rounded-xl px-3 text-lg data-[state=open]:bg-muted",children:[(c==null?void 0:c.pushName)||(c==null?void 0:c.remoteJid.split("@")[0]),l.jsx(uh,{className:"h-4 w-4 text-muted-foreground"})]})}),l.jsxs(Mr,{align:"start",className:"max-w-[300px]",children:[l.jsxs(tt,{className:"items-start gap-2",children:[l.jsx(o3,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:"GPT-4"}),l.jsx("div",{className:"text-muted-foreground/80",children:"With DALL-E, browsing and analysis. Limit 40 messages / 3 hours"})]})]}),l.jsx(Gs,{}),l.jsxs(tt,{className:"items-start gap-2",children:[l.jsx(yM,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:"GPT-3"}),l.jsx("div",{className:"text-muted-foreground/80",children:"Great for everyday tasks"})]})]})]})]})}),l.jsxs("div",{className:"message-container mx-auto flex max-w-4xl flex-1 flex-col gap-8 overflow-y-auto px-4",children:[u==null?void 0:u.map(f=>f.key.fromMe?d(f):p(f)),l.jsx("div",{ref:r})]}),l.jsx("div",{className:"sticky bottom-0 mx-auto flex w-full max-w-2xl flex-col gap-1.5 bg-background px-4 py-2",children:l.jsxs("div",{className:"input-message relative",children:[l.jsxs(z,{type:"button",size:"icon",className:"absolute bottom-3 left-3 h-8 w-8 rounded-full bg-transparent text-white hover:bg-transparent",children:[l.jsx(s3,{className:"h-4 w-4 text-white"}),l.jsx("span",{className:"sr-only",children:"Anexar"})]}),l.jsx(Vl,{placeholder:"Enviar mensagem...",name:"message",id:"message",rows:1,ref:e,onChange:t,style:{height:n},className:"max-h-[240px] min-h-[48px] resize-none rounded-3xl border border-none p-4 pl-12 pr-16 shadow-sm"}),l.jsxs(z,{type:"submit",size:"icon",className:"absolute bottom-3 right-3 h-8 w-8 rounded-full",children:[l.jsx(BB,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Enviar"})]})]})})]})}function tE(){const e=Va("(min-width: 768px)"),t=v.useRef(null),[n]=v.useState("auto"),r=v.useRef(null),{instance:s}=Ve(),{data:o,isSuccess:a}=UZ({instanceName:s==null?void 0:s.name}),{instanceId:c,remoteJid:u}=gs(),i=an(),d=v.useCallback(()=>{t.current&&t.current.scrollIntoView({})},[]),p=()=>{if(r.current){r.current.style.height="auto";const g=r.current.scrollHeight,m=parseInt(getComputedStyle(r.current).lineHeight)*10;r.current.style.height=`${Math.min(g,m)}px`}};v.useEffect(()=>{a&&d()},[a,d]);const f=g=>{i(`/manager/instance/${c}/chat/${g}`)};return l.jsxs(za,{direction:e?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:20,children:l.jsxs("div",{className:"hidden flex-col gap-2 bg-background text-foreground md:flex",children:[l.jsx("div",{className:"sticky top-0 p-2",children:l.jsxs(z,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",children:[l.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:l.jsx(dh,{className:"h-4 w-4"})}),l.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:"Chat"}),l.jsx(Ws,{className:"h-4 w-4"})]})}),l.jsxs($Z,{defaultValue:"contacts",children:[l.jsxs(QO,{className:"tabs-chat",children:[l.jsx(Eb,{value:"contacts",children:"Contatos"}),l.jsx(Eb,{value:"groups",children:"Grupos"})]}),l.jsx(kb,{value:"contacts",children:l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[l.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:"Contatos"}),o==null?void 0:o.map(g=>g.remoteJid.includes("@s.whatsapp.net")&&l.jsxs(ld,{to:"#",onClick:()=>f(g.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${u===g.remoteJid?"active":""}`,children:[l.jsx("span",{className:"chat-avatar mr-2",children:l.jsx("img",{src:g.profilePicUrl||"https://via.placeholder.com/150",alt:"Avatar",className:"h-8 w-8 rounded-full"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"chat-title block font-medium",children:g.pushName}),l.jsx("span",{className:"chat-description block text-xs text-gray-500",children:g.remoteJid.split("@")[0]})]})]},g.id))]})})}),l.jsx(kb,{value:"groups",children:l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsx("div",{className:"grid gap-1 p-2 text-foreground",children:o==null?void 0:o.map(g=>g.remoteJid.includes("@g.us")&&l.jsxs(ld,{to:"#",onClick:()=>f(g.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${u===g.remoteJid?"active":""}`,children:[l.jsx("span",{className:"chat-avatar mr-2",children:l.jsx("img",{src:g.profilePicUrl||"https://via.placeholder.com/150",alt:"Avatar",className:"h-8 w-8 rounded-full"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"chat-title block font-medium",children:g.pushName}),l.jsx("span",{className:"chat-description block text-xs text-gray-500",children:g.remoteJid})]})]},g.id))})})})]})]})}),l.jsx(Ua,{withHandle:!0,className:"border border-black"}),l.jsx(Bn,{children:u&&l.jsx(JZ,{textareaRef:r,handleTextareaChange:p,textareaHeight:n,lastMessageRef:t,scrollToBottom:d})})]})}const QZ=e=>["chatwoot","fetchChatwoot",JSON.stringify(e)],ZZ=async({instanceName:e,token:t})=>(await ie.get(`/chatwoot/find/${e}`,{headers:{apiKey:t}})).data,YZ=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:QZ({instanceName:t,token:n}),queryFn:()=>ZZ({instanceName:t,token:n}),enabled:!!t})},XZ=async({instanceName:e,token:t,data:n})=>(await ie.post(`/chatwoot/set/${e}`,n,{headers:{apikey:t}})).data;function eY(){return{createChatwoot:Le(XZ,{invalidateKeys:[["chatwoot","fetchChatwoot"]]})}}const Kf=k.string().optional().transform(e=>e===""?void 0:e),tY=k.object({enabled:k.boolean(),accountId:k.string(),token:k.string(),url:k.string(),signMsg:k.boolean().optional(),signDelimiter:Kf,nameInbox:Kf,organization:Kf,logo:Kf,reopenConversation:k.boolean().optional(),conversationPending:k.boolean().optional(),mergeBrazilContacts:k.boolean().optional(),importContacts:k.boolean().optional(),importMessages:k.boolean().optional(),daysLimitImportMessages:k.coerce.number().optional(),autoCreate:k.boolean(),ignoreJids:k.array(k.string()).default([])});function nY(){const{t:e}=Te(),{instance:t}=Ve(),[,n]=v.useState(!1),{createChatwoot:r}=eY(),{data:s}=YZ({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),o=zt({resolver:Ut(tY),defaultValues:{enabled:!0,accountId:"",token:"",url:"",signMsg:!0,signDelimiter:"\\n",nameInbox:"",organization:"",logo:"",reopenConversation:!0,conversationPending:!1,mergeBrazilContacts:!0,importContacts:!1,importMessages:!1,daysLimitImportMessages:7,autoCreate:!0,ignoreJids:[]}});v.useEffect(()=>{if(s){o.setValue("ignoreJids",s.ignoreJids||[]);const c={enabled:s.enabled,accountId:s.accountId,token:s.token,url:s.url,signMsg:s.signMsg||!1,signDelimiter:s.signDelimiter||"\\n",nameInbox:s.nameInbox||"",organization:s.organization||"",logo:s.logo||"",reopenConversation:s.reopenConversation||!1,conversationPending:s.conversationPending||!1,mergeBrazilContacts:s.mergeBrazilContacts||!1,importContacts:s.importContacts||!1,importMessages:s.importMessages||!1,daysLimitImportMessages:s.daysLimitImportMessages||7,autoCreate:s.autoCreate||!1,ignoreJids:s.ignoreJids};o.reset(c)}},[s,o]);const a=async c=>{if(!t)return;n(!0);const u={enabled:c.enabled,accountId:c.accountId,token:c.token,url:c.url,signMsg:c.signMsg||!1,signDelimiter:c.signDelimiter||"\\n",nameInbox:c.nameInbox||"",organization:c.organization||"",logo:c.logo||"",reopenConversation:c.reopenConversation||!1,conversationPending:c.conversationPending||!1,mergeBrazilContacts:c.mergeBrazilContacts||!1,importContacts:c.importContacts||!1,importMessages:c.importMessages||!1,daysLimitImportMessages:c.daysLimitImportMessages||7,autoCreate:c.autoCreate,ignoreJids:c.ignoreJids};await r({instanceName:t.name,token:t.token,data:u},{onSuccess:()=>{G.success(e("chatwoot.toast.success"))},onError:i=>{var d,p,f;console.error(e("chatwoot.toast.error"),i),G4(i)?G.error(`Error: ${(f=(p=(d=i==null?void 0:i.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`):G.error(e("chatwoot.toast.error"))},onSettled:()=>{n(!1)}})};return l.jsx(l.Fragment,{children:l.jsx(La,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"w-full space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("chatwoot.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:px-4 [&>*]:py-2",children:[l.jsx(ge,{name:"enabled",label:e("chatwoot.form.enabled.label"),className:"w-full justify-between",helper:e("chatwoot.form.enabled.description")}),l.jsx($,{name:"url",label:e("chatwoot.form.url.label"),children:l.jsx(F,{})}),l.jsx($,{name:"accountId",label:e("chatwoot.form.accountId.label"),children:l.jsx(F,{})}),l.jsx($,{name:"token",label:e("chatwoot.form.token.label"),children:l.jsx(F,{type:"password"})}),l.jsx(ge,{name:"signMsg",label:e("chatwoot.form.signMsg.label"),className:"w-full justify-between",helper:e("chatwoot.form.signMsg.description")}),l.jsx($,{name:"signDelimiter",label:e("chatwoot.form.signDelimiter.label"),children:l.jsx(F,{})}),l.jsx($,{name:"nameInbox",label:e("chatwoot.form.nameInbox.label"),children:l.jsx(F,{})}),l.jsx($,{name:"organization",label:e("chatwoot.form.organization.label"),children:l.jsx(F,{})}),l.jsx($,{name:"logo",label:e("chatwoot.form.logo.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"conversationPending",label:e("chatwoot.form.conversationPending.label"),className:"w-full justify-between",helper:e("chatwoot.form.conversationPending.description")}),l.jsx(ge,{name:"reopenConversation",label:e("chatwoot.form.reopenConversation.label"),className:"w-full justify-between",helper:e("chatwoot.form.reopenConversation.description")}),l.jsx(ge,{name:"importContacts",label:e("chatwoot.form.importContacts.label"),className:"w-full justify-between",helper:e("chatwoot.form.importContacts.description")}),l.jsx(ge,{name:"importMessages",label:e("chatwoot.form.importMessages.label"),className:"w-full justify-between",helper:e("chatwoot.form.importMessages.description")}),l.jsx($,{name:"daysLimitImportMessages",label:e("chatwoot.form.daysLimitImportMessages.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("chatwoot.form.ignoreJids.label"),placeholder:e("chatwoot.form.ignoreJids.placeholder")}),l.jsx(ge,{name:"autoCreate",label:e("chatwoot.form.autoCreate.label"),className:"w-full justify-between",helper:e("chatwoot.form.autoCreate.description")})]})]}),l.jsx("div",{className:"mx-4 flex justify-end",children:l.jsx(z,{type:"submit",children:e("chatwoot.button.save")})})]})})})}var Qh={},ZO={exports:{}},rY="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",sY=rY,oY=sY;function YO(){}function XO(){}XO.resetWarningCache=YO;var aY=function(){function e(r,s,o,a,c,u){if(u!==oY){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:XO,resetWarningCache:YO};return n.PropTypes=n,n};ZO.exports=aY();var eI=ZO.exports,tI={L:1,M:0,Q:3,H:2},nI={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},iY=nI;function rI(e){this.mode=iY.MODE_8BIT_BYTE,this.data=e}rI.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t>>7-e%8&1)==1},put:function(e,t){for(var n=0;n>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var uY=sI,ns={glog:function(e){if(e<1)throw new Error("glog("+e+")");return ns.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return ns.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var En=0;En<8;En++)ns.EXP_TABLE[En]=1<=0;)t^=Sn.G15<=0;)t^=Sn.G18<>>=1;return t},getPatternPosition:function(e){return Sn.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case Bo.PATTERN000:return(t+n)%2==0;case Bo.PATTERN001:return t%2==0;case Bo.PATTERN010:return n%3==0;case Bo.PATTERN011:return(t+n)%3==0;case Bo.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case Bo.PATTERN101:return t*n%2+t*n%3==0;case Bo.PATTERN110:return(t*n%2+t*n%3)%2==0;case Bo.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new nE([1],0),n=0;n5&&(n+=3+o-5)}for(var r=0;r=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Fs.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)};Nr.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)};Nr.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Ha.getLostPoint(this);(n==0||e>r)&&(e=r,t=n)}return t};Nr.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n),s=1;this.make();for(var o=0;o>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&(t>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}};Nr.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=Ha.getBCHTypeInfo(n),s=0;s<15;s++){var o=!e&&(r>>s&1)==1;s<6?this.modules[s][8]=o:s<8?this.modules[s+1][8]=o:this.modules[this.moduleCount-15+s][8]=o}for(var s=0;s<15;s++){var o=!e&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=o:s<9?this.modules[8][15-s-1+1]=o:this.modules[8][15-s-1]=o}this.modules[this.moduleCount-8][8]=!e};Nr.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,s=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[r][a-c]==null){var u=!1;o>>s&1)==1);var i=Ha.getMask(t,r,a-c);i&&(u=!u),this.modules[r][a-c]=u,s--,s==-1&&(o++,s=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}};Fs.PAD0=236;Fs.PAD1=17;Fs.createData=function(e,t,n){for(var r=iI.getRSBlocks(e,t),s=new lI,o=0;oc*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+c*8+")");for(s.getLengthInBits()+4<=c*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=c*8||(s.put(Fs.PAD0,8),s.getLengthInBits()>=c*8));)s.put(Fs.PAD1,8);return Fs.createBytes(s,r)};Fs.createBytes=function(e,t){for(var n=0,r=0,s=0,o=new Array(t.length),a=new Array(t.length),c=0;c=0?g.get(h):0}}for(var m=0,d=0;d=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var bY={bgColor:Or.default.oneOfType([Or.default.object,Or.default.string]).isRequired,bgD:Or.default.string.isRequired,fgColor:Or.default.oneOfType([Or.default.object,Or.default.string]).isRequired,fgD:Or.default.string.isRequired,size:Or.default.number.isRequired,title:Or.default.string,viewBoxSize:Or.default.number.isRequired,xmlns:Or.default.string},Hw=(0,cI.forwardRef)(function(e,t){var n=e.bgColor,r=e.bgD,s=e.fgD,o=e.fgColor,a=e.size,c=e.title,u=e.viewBoxSize,i=e.xmlns,d=i===void 0?"http://www.w3.org/2000/svg":i,p=yY(e,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return Wf.default.createElement("svg",mY({},p,{height:a,ref:t,viewBox:"0 0 "+u+" "+u,width:a,xmlns:d}),c?Wf.default.createElement("title",null,c):null,Wf.default.createElement("path",{d:r,fill:n}),Wf.default.createElement("path",{d:s,fill:o}))});Hw.displayName="QRCodeSvg";Hw.propTypes=bY;Vw.default=Hw;Object.defineProperty(Qh,"__esModule",{value:!0});Qh.QRCode=void 0;var xY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var _Y={bgColor:Xs.default.oneOfType([Xs.default.object,Xs.default.string]),fgColor:Xs.default.oneOfType([Xs.default.object,Xs.default.string]),level:Xs.default.string,size:Xs.default.number,value:Xs.default.string.isRequired},Zh=(0,dI.forwardRef)(function(e,t){var n=e.bgColor,r=n===void 0?"#FFFFFF":n,s=e.fgColor,o=s===void 0?"#000000":s,a=e.level,c=a===void 0?"L":a,u=e.size,i=u===void 0?256:u,d=e.value,p=NY(e,["bgColor","fgColor","level","size","value"]),f=new kY.default(-1,CY.default[c]);f.addData(d),f.make();var g=f.modules;return jY.default.createElement(MY.default,xY({},p,{bgColor:r,bgD:g.map(function(h,m){return h.map(function(x,b){return x?"":"M "+b+" "+m+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:o,fgD:g.map(function(h,m){return h.map(function(x,b){return x?"M "+b+" "+m+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:t,size:i,viewBoxSize:g.length}))});Qh.QRCode=Zh;Zh.displayName="QRCode";Zh.propTypes=_Y;var PY=Qh.default=Zh;const RY=ch("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7 space-y-1 [&_strong]:text-foreground",{variants:{variant:{default:"border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10 text-zinc-900 dark:text-zinc-300 [&>svg]:text-zinc-400 dark:[&>svg]:text-zinc-300",destructive:"border-red-500/20 bg-red-50/50 dark:border-red-500/30 dark:bg-red-500/10 text-red-900 dark:text-red-200 [&>svg]:text-red-600 dark:[&>svg]:text-red-400/80",warning:"border-amber-500/20 bg-amber-50/50 dark:border-amber-500/30 dark:bg-amber-500/10 text-amber-900 dark:text-amber-200 [&>svg]:text-amber-500",info:"border-sky-500/20 bg-sky-50/50 dark:border-sky-500/30 dark:bg-sky-500/10 text-sky-900 dark:text-sky-200 [&>svg]:text-sky-500",success:"border-emerald-500/20 bg-emerald-50/50 dark:border-emerald-500/30 dark:bg-emerald-500/10 text-emerald-900 dark:text-emerald-200 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400/80"}},defaultVariants:{variant:"default"}}),fI=v.forwardRef(({className:e,variant:t,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:me(RY({variant:t}),e),...n}));fI.displayName="Alert";const pI=v.forwardRef(({className:e,...t},n)=>l.jsx("h5",{ref:n,className:me("font-medium leading-none tracking-tight",e),...t}));pI.displayName="AlertTitle";const OY=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("text-sm [&_p]:leading-relaxed",e),...t}));OY.displayName="AlertDescription";const Tn=({size:e=45,className:t,...n})=>l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:me("animate-spin",t),children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})});function IY(){const{t:e,i18n:t}=Te(),n=new Intl.NumberFormat(t.language),[r,s]=v.useState(null),[o,a]=v.useState(""),c=zr(Fn.TOKEN),{theme:u}=Dx(),{connect:i,logout:d,restart:p}=Nh(),{instance:f,reloadInstance:g}=Ve();v.useEffect(()=>{f&&(localStorage.setItem(Fn.INSTANCE_ID,f.id),localStorage.setItem(Fn.INSTANCE_NAME,f.name),localStorage.setItem(Fn.INSTANCE_TOKEN,f.token))},[f]);const h=async()=>{await g()},m=async E=>{try{await p(E),await g()}catch(C){console.error("Error:",C)}},x=async E=>{try{await d(E),await g()}catch(C){console.error("Error:",C)}},b=async(E,C)=>{try{if(s(null),!c){console.error("Token not found.");return}if(C){const T=await i({instanceName:E,token:c,number:f==null?void 0:f.number});a(T.pairingCode)}else{const T=await i({instanceName:E,token:c});s(T.code)}}catch(T){console.error("Error:",T)}},y=async()=>{s(null),a(""),await g()},w=v.useMemo(()=>{var E,C,T;return f?{contacts:((E=f._count)==null?void 0:E.Contact)||0,chats:((C=f._count)==null?void 0:C.Chat)||0,messages:((T=f._count)==null?void 0:T.Message)||0}:{contacts:0,chats:0,messages:0}},[f]),S=v.useMemo(()=>u==="dark"?"#fff":u==="light"?"#000":"#189d68",[u]);return f?l.jsxs("main",{className:"flex flex-col gap-8",children:[l.jsx("section",{children:l.jsxs(oi,{children:[l.jsx(ai,{children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[l.jsx("h2",{className:"break-all text-lg font-semibold",children:f.name}),l.jsx(Y_,{status:f.connectionStatus})]})}),l.jsxs(ii,{className:"flex flex-col items-start space-y-6",children:[l.jsx("div",{className:"flex w-full flex-1",children:l.jsx(X_,{token:f.token})}),f.profileName&&l.jsxs("div",{className:"flex flex-1 gap-2",children:[l.jsx(Eh,{children:l.jsx(kh,{src:f.profilePicUrl,alt:""})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("strong",{children:f.profileName}),l.jsx("p",{className:"break-all text-sm text-muted-foreground",children:f.ownerJid})]})]}),f.connectionStatus!=="open"&&l.jsxs(fI,{variant:"warning",className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsx(pI,{className:"text-lg font-bold tracking-wide",children:e("instance.dashboard.alert")}),l.jsxs(pt,{children:[l.jsx(mt,{onClick:()=>b(f.name,!1),asChild:!0,children:l.jsx(z,{variant:"warning",children:e("instance.dashboard.button.qrcode.label")})}),l.jsxs(ut,{onCloseAutoFocus:y,children:[l.jsx(dt,{children:e("instance.dashboard.button.qrcode.title")}),l.jsx("div",{className:"flex items-center justify-center",children:r&&l.jsx(PY,{value:r,size:256,bgColor:"transparent",fgColor:S,className:"rounded-sm"})})]})]}),f.number&&l.jsxs(pt,{children:[l.jsx(mt,{className:"connect-code-button",onClick:()=>b(f.name,!0),children:e("instance.dashboard.button.pairingCode.label")}),l.jsx(ut,{onCloseAutoFocus:y,children:l.jsx(dt,{children:l.jsx(_o,{children:o?l.jsxs("div",{className:"py-3",children:[l.jsx("p",{className:"text-center",children:l.jsx("strong",{children:e("instance.dashboard.button.pairingCode.title")})}),l.jsxs("p",{className:"pairing-code text-center",children:[o.substring(0,4),"-",o.substring(4,8)]})]}):l.jsx(Tn,{})})})})]})]})]}),l.jsxs(Mh,{className:"flex flex-wrap items-center justify-end gap-3",children:[l.jsx(z,{variant:"outline",className:"refresh-button",size:"icon",onClick:h,children:l.jsx(rg,{size:"20"})}),l.jsx(z,{className:"action-button",variant:"secondary",onClick:()=>m(f.name),children:e("instance.dashboard.button.restart").toUpperCase()}),l.jsx(z,{variant:"destructive",onClick:()=>x(f.name),disabled:f.connectionStatus==="close",children:e("instance.dashboard.button.disconnect").toUpperCase()})]})]})}),l.jsxs("section",{className:"grid grid-cols-[repeat(auto-fit,_minmax(15rem,_1fr))] gap-6",children:[l.jsxs(oi,{className:"instance-card",children:[l.jsx(ai,{children:l.jsxs(Iu,{className:"flex items-center gap-2",children:[l.jsx(vM,{size:"20"}),e("instance.dashboard.contacts")]})}),l.jsx(ii,{children:n.format(w.contacts)})]}),l.jsxs(oi,{className:"instance-card",children:[l.jsx(ai,{children:l.jsxs(Iu,{className:"flex items-center gap-2",children:[l.jsx(i3,{size:"20"}),e("instance.dashboard.chats")]})}),l.jsx(ii,{children:n.format(w.chats)})]}),l.jsxs(oi,{className:"instance-card",children:[l.jsx(ai,{children:l.jsxs(Iu,{className:"flex items-center gap-2",children:[l.jsx(dh,{size:"20"}),e("instance.dashboard.messages")]})}),l.jsx(ii,{children:n.format(w.messages)})]})]})]}):l.jsx(Tn,{})}var DY="Separator",rE="horizontal",AY=["horizontal","vertical"],gI=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=rE,...s}=e,o=FY(r)?r:rE,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Ie.div,{"data-orientation":o,...c,...s,ref:t})});gI.displayName=DY;function FY(e){return AY.includes(e)}var hI=gI;const ht=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>l.jsx(hI,{ref:s,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ht.displayName=hI.displayName;const LY=e=>["dify","fetchDify",JSON.stringify(e)],$Y=async({instanceName:e,token:t})=>(await ie.get(`/dify/find/${e}`,{headers:{apikey:t}})).data,mI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:LY({instanceName:t,token:n}),queryFn:()=>$Y({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},BY=async({instanceName:e,token:t,data:n})=>(await ie.post(`/dify/create/${e}`,n,{headers:{apikey:t}})).data,zY=async({instanceName:e,difyId:t,data:n})=>(await ie.put(`/dify/update/${t}/${e}`,n)).data,UY=async({instanceName:e,difyId:t})=>(await ie.delete(`/dify/delete/${t}/${e}`)).data,VY=async({instanceName:e,token:t,data:n})=>(await ie.post(`/dify/settings/${e}`,n,{headers:{apikey:t}})).data,HY=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/dify/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Yh(){const e=Le(VY,{invalidateKeys:[["dify","fetchDefaultSettings"]]}),t=Le(HY,{invalidateKeys:[["dify","getDify"],["dify","fetchSessions"]]}),n=Le(UY,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),r=Le(zY,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),s=Le(BY,{invalidateKeys:[["dify","fetchDify"]]});return{setDefaultSettingsDify:e,changeStatusDify:t,deleteDify:n,updateDify:r,createDify:s}}const KY=e=>["dify","fetchDefaultSettings",JSON.stringify(e)],qY=async({instanceName:e,token:t})=>(await ie.get(`/dify/fetchSettings/${e}`,{headers:{apikey:t}})).data,WY=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:KY({instanceName:t,token:n}),queryFn:()=>qY({instanceName:t,token:n}),enabled:!!t})},GY=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),difyIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function JY(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsDify:n}=Yh(),[r,s]=v.useState(!1),{data:o,refetch:a}=mI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=WY({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),i=zt({resolver:Ut(GY),defaultValues:{expire:"0",keywordFinish:e("dify.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("dify.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],difyIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&i.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,difyIdFallback:c.difyIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),difyIdFallback:f.difyIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("dify.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){u(),a()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("dify.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("dify.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"difyIdFallback",label:e("dify.form.difyIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("dify.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("dify.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("dify.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("dify.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("dify.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("dify.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("dify.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("dify.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("dify.form.splitMessages.label"),reverse:!0}),l.jsx($,{name:"timePerChar",label:e("dify.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("dify.form.ignoreJids.label"),placeholder:e("dify.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("dify.button.save")})})]})})]})]})}/** - * table-core - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ia(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return n=>{t.setState(r=>({...r,[e]:ia(n,r[e])}))}}function Xh(e){return e instanceof Function}function QY(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function vI(e,t){const n=[],r=s=>{s.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function Ae(e,t,n){let r=[],s;return o=>{let a;n.key&&n.debug&&(a=Date.now());const c=e(o);if(!(c.length!==r.length||c.some((d,p)=>r[p]!==d)))return s;r=c;let i;if(n.key&&n.debug&&(i=Date.now()),s=t(...c),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-a)*100)/100,p=Math.round((Date.now()-i)*100)/100,f=p/16,g=(h,m)=>{for(h=String(h);h.length{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function ZY(e,t,n,r){const s=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:Ae(()=>[e,n,t,o],(a,c,u,i)=>({table:a,column:c,row:u,cell:i,getValue:i.getValue,renderValue:i.renderValue}),Fe(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function YY(e,t,n,r){var s,o;const c={...e._getDefaultColumnDef(),...t},u=c.accessorKey;let i=(s=(o=c.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?s:typeof c.header=="string"?c.header:void 0,d;if(c.accessorFn?d=c.accessorFn:u&&(u.includes(".")?d=f=>{let g=f;for(const m of u.split(".")){var h;g=(h=g)==null?void 0:h[m]}return g}:d=f=>f[c.accessorKey]),!i)throw new Error;let p={id:`${String(i)}`,accessorFn:d,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:Ae(()=>[!0],()=>{var f;return[p,...(f=p.columns)==null?void 0:f.flatMap(g=>g.getFlatColumns())]},Fe(e.options,"debugColumns")),getLeafColumns:Ae(()=>[e._getOrderColumnsFn()],f=>{var g;if((g=p.columns)!=null&&g.length){let h=p.columns.flatMap(m=>m.getLeafColumns());return f(h)}return[p]},Fe(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(p,e);return p}const In="debugHeaders";function sE(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(c),a.push(u)};return c(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const XY={createTable:e=>{e.getHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var o,a;const c=(o=r==null?void 0:r.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?o:[],u=(a=s==null?void 0:s.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?a:[],i=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(s!=null&&s.includes(p.id)));return Gf(t,[...c,...i,...u],e)},Fe(e.options,In)),e.getCenterHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(s!=null&&s.includes(o.id))),Gf(t,n,e,"center")),Fe(e.options,In)),e.getLeftHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const o=(s=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?s:[];return Gf(t,o,e,"left")},Fe(e.options,In)),e.getRightHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const o=(s=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?s:[];return Gf(t,o,e,"right")},Fe(e.options,In)),e.getFooterGroups=Ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getLeftFooterGroups=Ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getCenterFooterGroups=Ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getRightFooterGroups=Ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getFlatHeaders=Ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getLeftFlatHeaders=Ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getCenterFlatHeaders=Ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getRightFlatHeaders=Ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getCenterLeafHeaders=Ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Fe(e.options,In)),e.getLeftLeafHeaders=Ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Fe(e.options,In)),e.getRightLeafHeaders=Ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Fe(e.options,In)),e.getLeafHeaders=Ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,o,a,c,u,i;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(u=(i=r[0])==null?void 0:i.headers)!=null?u:[]].map(d=>d.getLeafHeaders()).flat()},Fe(e.options,In))}};function Gf(e,t,n,r){var s,o;let a=0;const c=function(f,g){g===void 0&&(g=1),a=Math.max(a,g),f.filter(h=>h.getIsVisible()).forEach(h=>{var m;(m=h.columns)!=null&&m.length&&c(h.columns,g+1)},0)};c(e);let u=[];const i=(f,g)=>{const h={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(x=>{const b=[...m].reverse()[0],y=x.column.depth===h.depth;let w,S=!1;if(y&&x.column.parent?w=x.column.parent:(w=x.column,S=!0),b&&(b==null?void 0:b.column)===w)b.subHeaders.push(x);else{const E=sE(n,w,{id:[r,g,w.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(C=>C.column===w).length}`:void 0,depth:g,index:m.length});E.subHeaders.push(x),m.push(E)}h.headers.push(x),x.headerGroup=h}),u.push(h),g>0&&i(m,g-1)},d=t.map((f,g)=>sE(n,f,{depth:a,index:g}));i(d,a-1),u.reverse();const p=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let m=0,x=0,b=[0];h.subHeaders&&h.subHeaders.length?(b=[],p(h.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:E}=w;m+=S,b.push(E)})):m=1;const y=Math.min(...b);return x=x+y,h.colSpan=m,h.rowSpan=x,{colSpan:m,rowSpan:x}});return p((s=(o=u[0])==null?void 0:o.headers)!=null?s:[]),u}const em=(e,t,n,r,s,o,a)=>{let c={id:t,index:r,original:n,depth:s,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(c._valuesCache.hasOwnProperty(u))return c._valuesCache[u];const i=e.getColumn(u);if(i!=null&&i.accessorFn)return c._valuesCache[u]=i.accessorFn(c.original,r),c._valuesCache[u]},getUniqueValues:u=>{if(c._uniqueValuesCache.hasOwnProperty(u))return c._uniqueValuesCache[u];const i=e.getColumn(u);if(i!=null&&i.accessorFn)return i.columnDef.getUniqueValues?(c._uniqueValuesCache[u]=i.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[u]):(c._uniqueValuesCache[u]=[c.getValue(u)],c._uniqueValuesCache[u])},renderValue:u=>{var i;return(i=c.getValue(u))!=null?i:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>vI(c.subRows,u=>u.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let u=[],i=c;for(;;){const d=i.getParentRow();if(!d)break;u.push(d),i=d}return u.reverse()},getAllCells:Ae(()=>[e.getAllLeafColumns()],u=>u.map(i=>ZY(e,c,i,i.id)),Fe(e.options,"debugRows")),_getAllCellsByColumnId:Ae(()=>[c.getAllCells()],u=>u.reduce((i,d)=>(i[d.column.id]=d,i),{}),Fe(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},yI=(e,t,n)=>{var r;const s=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};yI.autoRemove=e=>us(e);const bI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};bI.autoRemove=e=>us(e);const xI=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};xI.autoRemove=e=>us(e);const wI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};wI.autoRemove=e=>us(e)||!(e!=null&&e.length);const SI=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});SI.autoRemove=e=>us(e)||!(e!=null&&e.length);const CI=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});CI.autoRemove=e=>us(e)||!(e!=null&&e.length);const EI=(e,t,n)=>e.getValue(t)===n;EI.autoRemove=e=>us(e);const kI=(e,t,n)=>e.getValue(t)==n;kI.autoRemove=e=>us(e);const Kw=(e,t,n)=>{let[r,s]=n;const o=e.getValue(t);return o>=r&&o<=s};Kw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(s)?1/0:s;if(o>a){const c=o;o=a,a=c}return[o,a]};Kw.autoRemove=e=>us(e)||us(e[0])&&us(e[1]);const so={includesString:yI,includesStringSensitive:bI,equalsString:xI,arrIncludes:wI,arrIncludesAll:SI,arrIncludesSome:CI,equals:EI,weakEquals:kI,inNumberRange:Kw};function us(e){return e==null||e===""}const tX={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:kr("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?so.includesString:typeof r=="number"?so.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?so.equals:Array.isArray(r)?so.arrIncludes:so.weakEquals},e.getFilterFn=()=>{var n,r;return Xh(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:so[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),o=r==null?void 0:r.find(d=>d.id===e.id),a=ia(n,o?o.value:void 0);if(oE(s,a,e)){var c;return(c=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?c:[]}const u={id:e.id,value:a};if(o){var i;return(i=r==null?void 0:r.map(d=>d.id===e.id?u:d))!=null?i:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var o;return(o=ia(t,s))==null?void 0:o.filter(a=>{const c=n.find(u=>u.id===a.id);if(c){const u=c.getFilterFn();if(oE(u,a.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function oE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const nX=(e,t,n)=>n.reduce((r,s)=>{const o=s.getValue(e);return r+(typeof o=="number"?o:0)},0),rX=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},sX=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r=o)&&(r=o)}),r},oX=(e,t,n)=>{let r,s;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=s=a):(r>a&&(r=a),s{let n=0,r=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},iX=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!QY(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((o,a)=>o-a);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},lX=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),cX=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,uX=(e,t)=>t.length,xv={sum:nX,min:rX,max:sX,extent:oX,mean:aX,median:iX,unique:lX,uniqueCount:cX,count:uX},dX={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:kr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return xv.sum;if(Object.prototype.toString.call(r)==="[object Date]")return xv.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Xh(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:xv[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function fX(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const pX={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:kr("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ae(n=>[$u(t,n)],n=>n.findIndex(r=>r.id===e.id),Fe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$u(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=$u(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const a=[...t],c=[...s];for(;c.length&&a.length;){const u=a.shift(),i=c.findIndex(d=>d.id===u);i>-1&&o.push(c.splice(i,1)[0])}o=[...o,...c]}return fX(o,n,r)},Fe(e.options,"debugTable"))}},wv=()=>({left:[],right:[]}),gX={getInitialState:e=>({columnPinning:wv(),...e}),getDefaultOptions:e=>({onColumnPinningChange:kr("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,a;if(n==="right"){var c,u;return{left:((c=s==null?void 0:s.left)!=null?c:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((u=s==null?void 0:s.right)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var i,d;return{left:[...((i=s==null?void 0:s.left)!=null?i:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((d=s==null?void 0:s.right)!=null?d:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((o=s==null?void 0:s.left)!=null?o:[]).filter(p=>!(r!=null&&r.includes(p))),right:((a=s==null?void 0:s.right)!=null?a:[]).filter(p=>!(r!=null&&r.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,o,a;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(c=>c.id),{left:r,right:s}=t.getState().columnPinning,o=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>s==null?void 0:s.includes(c));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const o=[...r??[],...s??[]];return n.filter(a=>!o.includes(a.column.id))},Fe(t.options,"debugRows")),e.getLeftVisibleCells=Ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Fe(t.options,"debugRows")),e.getRightVisibleCells=Ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Fe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?wv():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:wv())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,o;return!!((s=r.left)!=null&&s.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Fe(e.options,"debugColumns")),e.getRightLeafColumns=Ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Fe(e.options,"debugColumns")),e.getCenterLeafColumns=Ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(o=>!s.includes(o.id))},Fe(e.options,"debugColumns"))}},Jf={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Sv=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hX={getDefaultColumnDef:()=>Jf,getInitialState:e=>({columnSizing:{},columnSizingInfo:Sv(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:kr("columnSizing",e),onColumnSizingInfoChange:kr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Jf.minSize,(r=o??e.columnDef.size)!=null?r:Jf.size),(s=e.columnDef.maxSize)!=null?s:Jf.maxSize)},e.getStart=Ae(n=>[n,$u(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,o)=>s+o.getSize(),0),Fe(t.options,"debugColumns")),e.getAfter=Ae(n=>[n,$u(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,o)=>s+o.getSize(),0),Fe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return o=>{if(!r||!s||(o.persist==null||o.persist(),Cv(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),c=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[r.id,r.getSize()]],u=Cv(o)?Math.round(o.touches[0].clientX):o.clientX,i={},d=(b,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(w=>{var S,E;const C=t.options.columnResizeDirection==="rtl"?-1:1,T=(y-((S=w==null?void 0:w.startOffset)!=null?S:0))*C,j=Math.max(T/((E=w==null?void 0:w.startSize)!=null?E:0),-.999999);return w.columnSizingStart.forEach(_=>{let[O,K]=_;i[O]=Math.round(Math.max(K+K*j,0)*100)/100}),{...w,deltaOffset:T,deltaPercentage:j}}),(t.options.columnResizeMode==="onChange"||b==="end")&&t.setColumnSizing(w=>({...w,...i})))},p=b=>d("move",b),f=b=>{d("end",b),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,h={moveHandler:b=>p(b.clientX),upHandler:b=>{g==null||g.removeEventListener("mousemove",h.moveHandler),g==null||g.removeEventListener("mouseup",h.upHandler),f(b.clientX)}},m={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),p(b.touches[0].clientX),!1),upHandler:b=>{var y;g==null||g.removeEventListener("touchmove",m.moveHandler),g==null||g.removeEventListener("touchend",m.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),f((y=b.touches[0])==null?void 0:y.clientX)}},x=mX()?{passive:!1}:!1;Cv(o)?(g==null||g.addEventListener("touchmove",m.moveHandler,x),g==null||g.addEventListener("touchend",m.upHandler,x)):(g==null||g.addEventListener("mousemove",h.moveHandler,x),g==null||g.addEventListener("mouseup",h.upHandler,x)),t.setColumnSizingInfo(b=>({...b,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Sv():(n=e.initialState.columnSizingInfo)!=null?n:Sv())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let Qf=null;function mX(){if(typeof Qf=="boolean")return Qf;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Qf=e,Qf}function Cv(e){return e.type==="touchstart"}const vX={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:kr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Fe(t.options,"debugRows")),e.getVisibleCells=Ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Fe(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ae(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Fe(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $u(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const yX={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},bX={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:kr("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>so.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Xh(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:so[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},xX={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:kr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,o;e.setExpanded(r?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(s=n)!=null?s:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:c,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},jb=0,Tb=10,Ev=()=>({pageIndex:jb,pageSize:Tb}),wX={getInitialState:e=>({...e,pagination:{...Ev(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:kr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=o=>ia(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?Ev():(s=e.initialState.pagination)!=null?s:Ev())},e.setPageIndex=r=>{e.setPagination(s=>{let o=ia(r,s.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...s,pageIndex:o}})},e.resetPageIndex=r=>{var s,o;e.setPageIndex(r?jb:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?s:jb)},e.resetPageSize=r=>{var s,o;e.setPageSize(r?Tb:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?s:Tb)},e.setPageSize=r=>{e.setPagination(s=>{const o=Math.max(1,ia(r,s.pageSize)),a=s.pageSize*s.pageIndex,c=Math.floor(a/o);return{...s,pageIndex:c,pageSize:o}})},e.setPageCount=r=>e.setPagination(s=>{var o;let a=ia(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...s,pageCount:a}}),e.getPageOptions=Ae(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((o,a)=>a)),s},Fe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},kv=()=>({top:[],bottom:[]}),SX={getInitialState:e=>({rowPinning:kv(),...e}),getDefaultOptions:e=>({onRowPinningChange:kr("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const o=r?e.getLeafRows().map(u=>{let{id:i}=u;return i}):[],a=s?e.getParentRows().map(u=>{let{id:i}=u;return i}):[],c=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var i,d;if(n==="bottom"){var p,f;return{top:((p=u==null?void 0:u.top)!=null?p:[]).filter(m=>!(c!=null&&c.has(m))),bottom:[...((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(c!=null&&c.has(m))),...Array.from(c)]}}if(n==="top"){var g,h;return{top:[...((g=u==null?void 0:u.top)!=null?g:[]).filter(m=>!(c!=null&&c.has(m))),...Array.from(c)],bottom:((h=u==null?void 0:u.bottom)!=null?h:[]).filter(m=>!(c!=null&&c.has(m)))}}return{top:((i=u==null?void 0:u.top)!=null?i:[]).filter(m=>!(c!=null&&c.has(m))),bottom:((d=u==null?void 0:u.bottom)!=null?d:[]).filter(m=>!(c!=null&&c.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,o=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>s==null?void 0:s.includes(c));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const o=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?kv():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:kv())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,o;return!!((s=r.top)!=null&&s.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(a=>{const c=e.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>t.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Fe(e.options,"debugRows")),e.getBottomRows=Ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Fe(e.options,"debugRows")),e.getCenterRows=Ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(o=>!s.has(o.id))},Fe(e.options,"debugRows"))}},CX={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:kr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):s.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{Mb(s,o.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?jv(e,n):{rows:[],flatRows:[],rowsById:{}},Fe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?jv(e,n):{rows:[],flatRows:[],rowsById:{}},Fe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?jv(e,n):{rows:[],flatRows:[],rowsById:{}},Fe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return o;const c={...o};return Mb(c,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Nb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Nb(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},Mb=(e,t,n,r,s)=>{var o;const a=s.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>Mb(e,c.id,n,r,s))};function jv(e,t){const n=e.getState().rowSelection,r=[],s={},o=function(a,c){return a.map(u=>{var i;const d=qw(u,n);if(d&&(r.push(u),s[u.id]=u),(i=u.subRows)!=null&&i.length&&(u={...u,subRows:o(u.subRows)}),d)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:s}}function qw(e,t){var n;return(n=t[e.id])!=null?n:!1}function Nb(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!s)&&(a.getCanSelect()&&(qw(a,t)?o=!0:s=!1),a.subRows&&a.subRows.length)){const c=Nb(a,t);c==="all"?o=!0:(c==="some"&&(o=!0),s=!1)}}),s?"all":o?"some":!1}const _b=/([0-9]+)/gm,EX=(e,t,n)=>jI(Ta(e.getValue(n)).toLowerCase(),Ta(t.getValue(n)).toLowerCase()),kX=(e,t,n)=>jI(Ta(e.getValue(n)),Ta(t.getValue(n))),jX=(e,t,n)=>Ww(Ta(e.getValue(n)).toLowerCase(),Ta(t.getValue(n)).toLowerCase()),TX=(e,t,n)=>Ww(Ta(e.getValue(n)),Ta(t.getValue(n))),MX=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:rWw(e.getValue(n),t.getValue(n));function Ww(e,t){return e===t?0:e>t?1:-1}function Ta(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function jI(e,t){const n=e.split(_b).filter(Boolean),r=t.split(_b).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),o=r.shift(),a=parseInt(s,10),c=parseInt(o,10),u=[a,c].sort();if(isNaN(u[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const cu={alphanumeric:EX,alphanumericCaseSensitive:kX,text:jX,textCaseSensitive:TX,datetime:MX,basic:NX},_X={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:kr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return cu.datetime;if(typeof o=="string"&&(r=!0,o.split(_b).length>1))return cu.alphanumeric}return r?cu.text:cu.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Xh(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:cu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const c=a==null?void 0:a.find(g=>g.id===e.id),u=a==null?void 0:a.findIndex(g=>g.id===e.id);let i=[],d,p=o?n:s==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?c?d="toggle":d="add":a!=null&&a.length&&u!==a.length-1?d="replace":c?d="toggle":d="replace",d==="toggle"&&(o||s||(d="remove")),d==="add"){var f;i=[...a,{id:e.id,desc:p}],i.splice(0,i.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?i=a.map(g=>g.id===e.id?{...g,desc:p}:g):d==="remove"?i=a.filter(g=>g.id!==e.id):i=[{id:e.id,desc:p}];return i})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},PX=[XY,vX,pX,gX,eX,tX,yX,bX,_X,dX,xX,wX,SX,CX,hX];function RX(e){var t,n;const r=[...PX,...(t=e._features)!=null?t:[]];let s={_features:r};const o=s._features.reduce((f,g)=>Object.assign(f,g.getDefaultOptions==null?void 0:g.getDefaultOptions(s)),{}),a=f=>s.options.mergeOptions?s.options.mergeOptions(o,f):{...o,...f};let u={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(f=>{var g;u=(g=f.getInitialState==null?void 0:f.getInitialState(u))!=null?g:u});const i=[];let d=!1;const p={_features:r,options:{...o,...e},initialState:u,_queue:f=>{i.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;i.length;)i.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const g=ia(f,s.options);s.options=a(g)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,g,h)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(f,g,h))!=null?m:`${h?[h.id,g].join("."):g}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,g)=>{let h=(g?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!h&&(h=s.getCoreRowModel().rowsById[f],!h))throw new Error;return h},_getDefaultColumnDef:Ae(()=>[s.options.defaultColumn],f=>{var g;return f=(g=f)!=null?g:{},{header:h=>{const m=h.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:h=>{var m,x;return(m=(x=h.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...s._features.reduce((h,m)=>Object.assign(h,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Fe(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Ae(()=>[s._getColumnDefs()],f=>{const g=function(h,m,x){return x===void 0&&(x=0),h.map(b=>{const y=YY(s,b,x,m),w=b;return y.columns=w.columns?g(w.columns,y,x+1):[],y})};return g(f)},Fe(e,"debugColumns")),getAllFlatColumns:Ae(()=>[s.getAllColumns()],f=>f.flatMap(g=>g.getFlatColumns()),Fe(e,"debugColumns")),_getAllFlatColumnsById:Ae(()=>[s.getAllFlatColumns()],f=>f.reduce((g,h)=>(g[h.id]=h,g),{}),Fe(e,"debugColumns")),getAllLeafColumns:Ae(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,g)=>{let h=f.flatMap(m=>m.getLeafColumns());return g(h)},Fe(e,"debugColumns")),getColumn:f=>s._getAllFlatColumnsById()[f]};Object.assign(s,p);for(let f=0;fAe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,o,a){o===void 0&&(o=0);const c=[];for(let i=0;ie._autoResetPageIndex()))}function IX(e,t,n){return n.options.filterFromLeafRows?DX(e,t,n):AX(e,t,n)}function DX(e,t,n){var r;const s=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(u,i){i===void 0&&(i=0);const d=[];for(let f=0;fAe(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f{var g;const h=e.getColumn(f.id);if(!h)return;const m=h.getFilterFn();m&&s.push({id:f.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?g:f.value})});const a=(n??[]).map(f=>f.id),c=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&c&&u.length&&(a.push("__global__"),u.forEach(f=>{var g;o.push({id:f.id,filterFn:c,resolvedValue:(g=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?g:r})}));let i,d;for(let f=0;f{g.columnFiltersMeta[m]=x})}if(o.length){for(let h=0;h{g.columnFiltersMeta[m]=x})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const p=f=>{for(let g=0;ge._autoResetPageIndex()))}function LX(){return e=>Ae(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach(u=>{u.depth=0,u.parentId=void 0}),n;const r=t.filter(u=>e.getColumn(u)),s=[],o={},a=function(u,i,d){if(i===void 0&&(i=0),i>=r.length)return u.map(h=>(h.depth=i,s.push(h),o[h.id]=h,h.subRows&&(h.subRows=a(h.subRows,i+1,h.id)),h));const p=r[i],f=$X(u,p);return Array.from(f.entries()).map((h,m)=>{let[x,b]=h,y=`${p}:${x}`;y=d?`${d}>${y}`:y;const w=a(b,i+1,y);w.forEach(C=>{C.parentId=y});const S=i?vI(b,C=>C.subRows):b,E=em(e,y,S[0].original,m,i,void 0,d);return Object.assign(E,{groupingColumnId:p,groupingValue:x,subRows:w,leafRows:S,getValue:C=>{if(r.includes(C)){if(E._valuesCache.hasOwnProperty(C))return E._valuesCache[C];if(b[0]){var T;E._valuesCache[C]=(T=b[0].getValue(C))!=null?T:void 0}return E._valuesCache[C]}if(E._groupingValuesCache.hasOwnProperty(C))return E._groupingValuesCache[C];const j=e.getColumn(C),_=j==null?void 0:j.getAggregationFn();if(_)return E._groupingValuesCache[C]=_(C,S,b),E._groupingValuesCache[C]}}),w.forEach(C=>{s.push(C),o[C.id]=C}),E})},c=a(n.rows,0);return c.forEach(u=>{s.push(u),o[u.id]=u}),{rows:c,flatRows:s,rowsById:o}},Fe(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function $X(e,t){const n=new Map;return e.reduce((r,s)=>{const o=`${s.getGroupingValue(t)}`,a=r.get(o);return a?a.push(s):r.set(o,[s]),r},n)}function BX(){return e=>Ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],o=r.filter(u=>{var i;return(i=e.getColumn(u.id))==null?void 0:i.getCanSort()}),a={};o.forEach(u=>{const i=e.getColumn(u.id);i&&(a[u.id]={sortUndefined:i.columnDef.sortUndefined,invertSorting:i.columnDef.invertSorting,sortingFn:i.getSortingFn()})});const c=u=>{const i=u.map(d=>({...d}));return i.sort((d,p)=>{for(let g=0;g{var p;s.push(d),(p=d.subRows)!=null&&p.length&&(d.subRows=c(d.subRows))}),i};return{rows:c(n.rows),flatRows:s,rowsById:n.rowsById}},Fe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** - * react-table - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function aE(e,t){return e?zX(e)?v.createElement(e,t):e:null}function zX(e){return UX(e)||typeof e=="function"||VX(e)}function UX(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function VX(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function HX(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:RX(t)})),[r,s]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{s(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const TI=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:me("w-full caption-bottom text-sm",e),...t})}));TI.displayName="Table";const MI=v.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));MI.displayName="TableHeader";const NI=v.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));NI.displayName="TableBody";const KX=v.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));KX.displayName="TableFooter";const Cu=v.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Cu.displayName="TableRow";const _I=v.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));_I.displayName="TableHead";const kp=v.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));kp.displayName="TableCell";const qX=v.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));qX.displayName="TableCaption";function Ka({columns:e,data:t,isLoading:n,loadingMessage:r,noResultsMessage:s,enableHeaders:o=!0,className:a,highlightedRows:c,...u}){var d;const i=HX({...u,data:t,columns:e,getCoreRowModel:OX(),getFilteredRowModel:FX(),getGroupedRowModel:LX(),getSortedRowModel:BX()});return l.jsx("div",{className:me("rounded-md border",a),children:l.jsxs(TI,{children:[o&&l.jsx(MI,{children:i.getHeaderGroups().map(p=>l.jsx(Cu,{children:p.headers.map(f=>l.jsx(_I,{children:f.isPlaceholder?null:aE(f.column.columnDef.header,f.getContext())},f.id))},p.id))}),l.jsx(NI,{children:n?l.jsx(Cu,{children:l.jsx(kp,{colSpan:e.length,className:"h-24 text-center text-muted-foreground",children:r??"Carregando..."})}):l.jsx(l.Fragment,{children:(d=i.getRowModel().rows)!=null&&d.length?i.getRowModel().rows.map(p=>l.jsx(Cu,{"data-state":p.getIsSelected()?"selected":c!=null&&c.includes(p.id)?"highlighted":"",children:p.getVisibleCells().map(f=>l.jsx(kp,{children:aE(f.column.columnDef.cell,f.getContext())},f.id))},p.id)):l.jsx(Cu,{children:l.jsx(kp,{colSpan:e.length,className:"h-24 text-center",children:s??"Nenhum resultado encontrado!"})})})})]})})}const WX=e=>["dify","fetchSessions",JSON.stringify(e)],GX=async({difyId:e,instanceName:t})=>(await ie.get(`/dify/fetchSessions/${e}/${t}`)).data,JX=e=>{const{difyId:t,instanceName:n,...r}=e;return qe({...r,queryKey:WX({difyId:t,instanceName:n}),queryFn:()=>GX({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function PI({difyId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusDify:r}=Yh(),[s,o]=v.useState([]),{data:a,refetch:c}=JX({difyId:e,instanceName:n==null?void 0:n.name}),[u,i]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("dify.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("dify.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("dify.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:u,onOpenChange:i,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("dify.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("dify.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("dify.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("dify.sessions.table.none")})]})]})]})}const QX=k.object({enabled:k.boolean(),description:k.string(),botType:k.string(),apiUrl:k.string(),apiKey:k.string(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function RI({initialData:e,onSubmit:t,handleDelete:n,difyId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(QX),defaultValues:e||{enabled:!0,description:"",botType:"chatBot",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("dify.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("dify.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.difySettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"botType",label:u("dify.form.botType.label"),options:[{label:u("dify.form.botType.chatBot"),value:"chatBot"},{label:u("dify.form.botType.textGenerator"),value:"textGenerator"},{label:u("dify.form.botType.agent"),value:"agent"},{label:u("dify.form.botType.workflow"),value:"workflow"}]}),l.jsx($,{name:"apiUrl",label:u("dify.form.apiUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("dify.form.apiKey.label"),required:!0,children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("dify.form.triggerType.label"),options:[{label:u("dify.form.triggerType.keyword"),value:"keyword"},{label:u("dify.form.triggerType.all"),value:"all"},{label:u("dify.form.triggerType.advanced"),value:"advanced"},{label:u("dify.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("dify.form.triggerOperator.label"),options:[{label:u("dify.form.triggerOperator.contains"),value:"contains"},{label:u("dify.form.triggerOperator.equals"),value:"equals"},{label:u("dify.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("dify.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("dify.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("dify.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("dify.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("dify.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("dify.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("dify.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("dify.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("dify.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("dify.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("dify.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("dify.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("dify.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("dify.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"dify.button.saving":"dify.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(PI,{difyId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"dify.button.saving":"dify.button.update")})]})]})]})})}function ZX({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createDify:c}=Yh(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,botType:i.botType,apiUrl:i.apiUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("dify.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("dify.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("dify.form.title")})}),l.jsx(RI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const YX=e=>["dify","getDify",JSON.stringify(e)],XX=async({difyId:e,instanceName:t})=>(await ie.get(`/dify/fetch/${e}/${t}`)).data,eee=e=>{const{difyId:t,instanceName:n,...r}=e;return qe({...r,queryKey:YX({difyId:t,instanceName:n}),queryFn:()=>XX({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function tee({difyId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteDify:c,updateDify:u}=Yh(),{data:i,isLoading:d}=eee({difyId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",botType:(i==null?void 0:i.botType)??"",apiUrl:(i==null?void 0:i.apiUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:(i==null?void 0:i.triggerValue)??"",expire:(i==null?void 0:i.expire)??0,keywordFinish:(i==null?void 0:i.keywordFinish)??"",delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:(i==null?void 0:i.unknownMessage)??"",listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.apiKey,i==null?void 0:i.apiUrl,i==null?void 0:i.botType,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,botType:h.botType,apiUrl:h.apiUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,difyId:e,data:y}),G.success(n("dify.toast.success.update")),t(),s(`/manager/instance/${r.id}/dify/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,difyId:e}),G.success(n("dify.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/dify`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(RI,{initialData:p,onSubmit:f,difyId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function iE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{difyId:r}=gs(),{data:s,refetch:o,isLoading:a}=mI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/dify/${d}`)},i=()=>{o()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("dify.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(PI,{}),l.jsx(JY,{}),l.jsx(ZX,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsxs(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:[l.jsx("h4",{className:"text-base",children:d.description||d.id}),l.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:d.botType})]},d.id)):l.jsx(z,{variant:"link",children:e("dify.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(tee,{difyId:r,resetTable:i})})]})]})]})}const nee=e=>["evoai","fetchEvoai",JSON.stringify(e)],ree=async({instanceName:e,token:t})=>(await ie.get(`/evoai/find/${e}`,{headers:{apikey:t}})).data,OI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:nee({instanceName:t,token:n}),queryFn:()=>ree({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},see=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evoai/create/${e}`,n,{headers:{apikey:t}})).data,oee=async({instanceName:e,evoaiId:t,data:n})=>(await ie.put(`/evoai/update/${t}/${e}`,n)).data,aee=async({instanceName:e,evoaiId:t})=>(await ie.delete(`/evoai/delete/${t}/${e}`)).data,iee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evoai/settings/${e}`,n,{headers:{apikey:t}})).data,lee=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/evoai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function tm(){const e=Le(iee,{invalidateKeys:[["evoai","fetchDefaultSettings"]]}),t=Le(lee,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchSessions"]]}),n=Le(aee,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),r=Le(oee,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),s=Le(see,{invalidateKeys:[["evoai","fetchEvoai"]]});return{setDefaultSettingsEvoai:e,changeStatusEvoai:t,deleteEvoai:n,updateEvoai:r,createEvoai:s}}const cee=e=>["evoai","fetchDefaultSettings",JSON.stringify(e)],uee=async({instanceName:e,token:t})=>(await ie.get(`/evoai/fetchSettings/${e}`,{headers:{apikey:t}})).data,dee=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:cee({instanceName:t,token:n}),queryFn:()=>uee({instanceName:t,token:n}),enabled:!!t})},fee=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),evoaiIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function pee(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsEvoai:n}=tm(),[r,s]=v.useState(!1),{data:o,refetch:a}=OI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=dee({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),i=zt({resolver:Ut(fee),defaultValues:{expire:"0",keywordFinish:e("evoai.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evoai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],evoaiIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&i.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,evoaiIdFallback:c.evoaiIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),evoaiIdFallback:f.evoaiIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("evoai.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){u(),a()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("evoai.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("evoai.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"evoaiIdFallback",label:e("evoai.form.evoaiIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("evoai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("evoai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("evoai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("evoai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("evoai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("evoai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("evoai.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("evoai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("evoai.form.splitMessages.label"),reverse:!0}),l.jsx($,{name:"timePerChar",label:e("evoai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("evoai.form.ignoreJids.label"),placeholder:e("evoai.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("evoai.button.save")})})]})})]})]})}const gee=e=>["evoai","fetchSessions",JSON.stringify(e)],hee=async({evoaiId:e,instanceName:t})=>(await ie.get(`/evoai/fetchSessions/${e}/${t}`)).data,mee=e=>{const{evoaiId:t,instanceName:n,...r}=e;return qe({...r,queryKey:gee({evoaiId:t,instanceName:n}),queryFn:()=>hee({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function II({evoaiId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusEvoai:r}=tm(),[s,o]=v.useState([]),{data:a,refetch:c}=mee({evoaiId:e,instanceName:n==null?void 0:n.name}),[u,i]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("evoai.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("evoai.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("evoai.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:u,onOpenChange:i,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evoai.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evoai.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("evoai.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("evoai.sessions.table.none")})]})]})]})}const vee=k.object({enabled:k.boolean(),description:k.string(),agentUrl:k.string(),apiKey:k.string(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function DI({initialData:e,onSubmit:t,handleDelete:n,evoaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(vee),defaultValues:e||{enabled:!0,description:"",agentUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("evoai.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("evoai.form.description.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.evoaiSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"agentUrl",label:u("evoai.form.agentUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("evoai.form.apiKey.label"),className:"flex-1",children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("evoai.form.triggerType.label"),options:[{label:u("evoai.form.triggerType.keyword"),value:"keyword"},{label:u("evoai.form.triggerType.all"),value:"all"},{label:u("evoai.form.triggerType.advanced"),value:"advanced"},{label:u("evoai.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("evoai.form.triggerOperator.label"),options:[{label:u("evoai.form.triggerOperator.contains"),value:"contains"},{label:u("evoai.form.triggerOperator.equals"),value:"equals"},{label:u("evoai.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("evoai.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("evoai.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("evoai.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("evoai.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("evoai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("evoai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("evoai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("evoai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("evoai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("evoai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("evoai.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("evoai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("evoai.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("evoai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"evoai.button.saving":"evoai.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(II,{evoaiId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("evoai.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"evoai.button.saving":"evoai.button.update")})]})]})]})})}function yee({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createEvoai:c}=tm(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,agentUrl:i.agentUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("evoai.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evoai.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evoai.form.title")})}),l.jsx(DI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const bee=e=>["evoai","getEvoai",JSON.stringify(e)],xee=async({evoaiId:e,instanceName:t})=>(await ie.get(`/evoai/fetch/${e}/${t}`)).data,wee=e=>{const{evoaiId:t,instanceName:n,...r}=e;return qe({...r,queryKey:bee({evoaiId:t,instanceName:n}),queryFn:()=>xee({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function See({evoaiId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteEvoai:c,updateEvoai:u}=tm(),{data:i,isLoading:d}=wee({evoaiId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",agentUrl:(i==null?void 0:i.agentUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:(i==null?void 0:i.triggerValue)??"",expire:(i==null?void 0:i.expire)??0,keywordFinish:(i==null?void 0:i.keywordFinish)??"",delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:(i==null?void 0:i.unknownMessage)??"",listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.agentUrl,i==null?void 0:i.apiKey,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,agentUrl:h.agentUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,evoaiId:e,data:y}),G.success(n("evoai.toast.success.update")),t(),s(`/manager/instance/${r.id}/evoai/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,evoaiId:e}),G.success(n("evoai.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/evoai`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir evoai:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(DI,{initialData:p,onSubmit:f,evoaiId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function lE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{evoaiId:r}=gs(),{data:s,refetch:o,isLoading:a}=OI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/evoai/${d}`)},i=()=>{o()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("evoai.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(II,{}),l.jsx(pee,{}),l.jsx(yee,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("evoai.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(See,{evoaiId:r,resetTable:i})})]})]})]})}const Cee=e=>["evolutionBot","findEvolutionBot",JSON.stringify(e)],Eee=async({instanceName:e,token:t})=>(await ie.get(`/evolutionBot/find/${e}`,{headers:{apiKey:t}})).data,AI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Cee({instanceName:t}),queryFn:()=>Eee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},kee=e=>["evolutionBot","fetchDefaultSettings",JSON.stringify(e)],jee=async({instanceName:e,token:t})=>{const n=await ie.get(`/evolutionBot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Tee=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:kee({instanceName:t}),queryFn:()=>jee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Mee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evolutionBot/create/${e}`,n,{headers:{apikey:t}})).data,Nee=async({instanceName:e,token:t,evolutionBotId:n,data:r})=>(await ie.put(`/evolutionBot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,_ee=async({instanceName:e,evolutionBotId:t})=>(await ie.delete(`/evolutionBot/delete/${t}/${e}`)).data,Pee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evolutionBot/settings/${e}`,n,{headers:{apikey:t}})).data,Ree=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/evolutionBot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function nm(){const e=Le(Pee,{invalidateKeys:[["evolutionBot","fetchDefaultSettings"]]}),t=Le(Ree,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","fetchSessions"]]}),n=Le(_ee,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),r=Le(Nee,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),s=Le(Mee,{invalidateKeys:[["evolutionBot","findEvolutionBot"]]});return{setDefaultSettingsEvolutionBot:e,changeStatusEvolutionBot:t,deleteEvolutionBot:n,updateEvolutionBot:r,createEvolutionBot:s}}const Oee=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),botIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function Iee(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{data:s,refetch:o}=Tee({instanceName:t==null?void 0:t.name,enabled:n}),{data:a,refetch:c}=AI({instanceName:t==null?void 0:t.name,enabled:n}),{setDefaultSettingsEvolutionBot:u}=nm(),i=zt({resolver:Ut(Oee),defaultValues:{expire:"0",keywordFinish:e("evolutionBot.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evolutionBot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],botIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{s&&i.reset({expire:s!=null&&s.expire?s.expire.toString():"0",keywordFinish:s.keywordFinish,delayMessage:s.delayMessage?s.delayMessage.toString():"0",unknownMessage:s.unknownMessage,listeningFromMe:s.listeningFromMe,stopBotFromMe:s.stopBotFromMe,keepOpen:s.keepOpen,debounceTime:s.debounceTime?s.debounceTime.toString():"0",ignoreJids:s.ignoreJids,botIdFallback:s.botIdFallback,splitMessages:s.splitMessages,timePerChar:s.timePerChar?s.timePerChar.toString():"0"})},[s]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),botIdFallback:f.botIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await u({instanceName:t.name,token:t.token,data:x}),G.success(e("evolutionBot.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){o(),c()}return l.jsxs(pt,{open:n,onOpenChange:r,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("evolutionBot.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("evolutionBot.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"botIdFallback",label:e("evolutionBot.form.botIdFallback.label"),options:(a==null?void 0:a.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("evolutionBot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("evolutionBot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("evolutionBot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("evolutionBot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("evolutionBot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("evolutionBot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("evolutionBot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("evolutionBot.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:e("evolutionBot.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("evolutionBot.form.ignoreJids.label"),placeholder:e("evolutionBot.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("evolutionBot.button.save")})})]})})]})]})}const Dee=e=>["evolutionBot","fetchSessions",JSON.stringify(e)],Aee=async({instanceName:e,evolutionBotId:t,token:n})=>(await ie.get(`/evolutionBot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Fee=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return qe({...s,queryKey:Dee({instanceName:t}),queryFn:()=>Aee({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function FI({evolutionBotId:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState([]),[o,a]=v.useState(!1),[c,u]=v.useState(""),{data:i,refetch:d}=Fee({instanceName:n==null?void 0:n.name,evolutionBotId:e,enabled:o}),{changeStatusEvolutionBot:p}=nm();function f(){d()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await p({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("evolutionBot.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("evolutionBot.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("evolutionBot.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evolutionBot.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("evolutionBot.sessions.search"),value:c,onChange:m=>u(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:i??[],onSortingChange:s,state:{sorting:r,globalFilter:c},onGlobalFilterChange:u,enableGlobalFilter:!0,noResultsMessage:t("evolutionBot.sessions.table.none")})]})]})]})}const Lee=k.object({enabled:k.boolean(),description:k.string(),apiUrl:k.string(),apiKey:k.string().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function LI({initialData:e,onSubmit:t,handleDelete:n,evolutionBotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(Lee),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("evolutionBot.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("evolutionBot.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.evolutionBotSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"apiUrl",label:u("evolutionBot.form.apiUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("evolutionBot.form.apiKey.label"),children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("evolutionBot.form.triggerType.label"),options:[{label:u("evolutionBot.form.triggerType.keyword"),value:"keyword"},{label:u("evolutionBot.form.triggerType.all"),value:"all"},{label:u("evolutionBot.form.triggerType.advanced"),value:"advanced"},{label:u("evolutionBot.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("evolutionBot.form.triggerOperator.label"),options:[{label:u("evolutionBot.form.triggerOperator.contains"),value:"contains"},{label:u("evolutionBot.form.triggerOperator.equals"),value:"equals"},{label:u("evolutionBot.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("evolutionBot.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("evolutionBot.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("evolutionBot.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("evolutionBot.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("evolutionBot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("evolutionBot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("evolutionBot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("evolutionBot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("evolutionBot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("evolutionBot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("evolutionBot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("evolutionBot.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("evolutionBot.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"evolutionBot.button.saving":"evolutionBot.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(FI,{evolutionBotId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"evolutionBot.button.saving":"evolutionBot.button.update")})]})]})]})})}function $ee({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createEvolutionBot:c}=nm(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,apiUrl:i.apiUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar?i.timePerChar:0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("evolutionBot.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evolutionBot.form.title")})}),l.jsx(LI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const Bee=e=>["evolutionBot","getEvolutionBot",JSON.stringify(e)],zee=async({instanceName:e,token:t,evolutionBotId:n})=>{const r=await ie.get(`/evolutionBot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Uee=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return qe({...s,queryKey:Bee({instanceName:t}),queryFn:()=>zee({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Vee({evolutionBotId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteEvolutionBot:c,updateEvolutionBot:u}=nm(),{data:i,isLoading:d}=Uee({instanceName:r==null?void 0:r.name,evolutionBotId:e}),p=v.useMemo(()=>({enabled:(i==null?void 0:i.enabled)??!0,description:(i==null?void 0:i.description)??"",apiUrl:(i==null?void 0:i.apiUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)??0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:i==null?void 0:i.listeningFromMe,stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:i!=null&&i.timePerChar?i==null?void 0:i.timePerChar:0}),[i==null?void 0:i.apiKey,i==null?void 0:i.apiUrl,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,apiUrl:h.apiUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar?h.timePerChar:0};await u({instanceName:r.name,evolutionBotId:e,data:y}),G.success(n("evolutionBot.toast.success.update")),t(),s(`/manager/instance/${r.id}/evolutionBot/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,evolutionBotId:e}),G.success(n("evolutionBot.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/evolutionBot`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir evolutionBot:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(LI,{initialData:p,onSubmit:f,evolutionBotId:e,handleDelete:g,isModal:!1,openDeletionDialog:o,setOpenDeletionDialog:a})})}function cE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{evolutionBotId:r}=gs(),{data:s,isLoading:o,refetch:a}=AI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/evolutionBot/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("evolutionBot.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(FI,{}),l.jsx(Iee,{}),l.jsx($ee,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("evolutionBot.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(Vee,{evolutionBotId:r,resetTable:i})})]})]})]})}const Hee=e=>["flowise","findFlowise",JSON.stringify(e)],Kee=async({instanceName:e,token:t})=>(await ie.get(`/flowise/find/${e}`,{headers:{apiKey:t}})).data,$I=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Hee({instanceName:t}),queryFn:()=>Kee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},qee=e=>["flowise","fetchDefaultSettings",JSON.stringify(e)],Wee=async({instanceName:e,token:t})=>{const n=await ie.get(`/flowise/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Gee=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:qee({instanceName:t}),queryFn:()=>Wee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Jee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/flowise/create/${e}`,n,{headers:{apikey:t}})).data,Qee=async({instanceName:e,flowiseId:t,data:n})=>(await ie.put(`/flowise/update/${t}/${e}`,n)).data,Zee=async({instanceName:e,flowiseId:t})=>(await ie.delete(`/flowise/delete/${t}/${e}`)).data,Yee=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/flowise/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data,Xee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/flowise/settings/${e}`,n,{headers:{apikey:t}})).data;function rm(){const e=Le(Xee,{invalidateKeys:[["flowise","fetchDefaultSettings"]]}),t=Le(Yee,{invalidateKeys:[["flowise","getFlowise"],["flowise","fetchSessions"]]}),n=Le(Zee,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),r=Le(Qee,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),s=Le(Jee,{invalidateKeys:[["flowise","findFlowise"]]});return{setDefaultSettingsFlowise:e,changeStatusFlowise:t,deleteFlowise:n,updateFlowise:r,createFlowise:s}}const ete=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),flowiseIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function tte(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsFlowise:n}=rm(),[r,s]=v.useState(!1),{data:o,refetch:a}=Gee({instanceName:t==null?void 0:t.name,enabled:r}),{data:c,refetch:u}=$I({instanceName:t==null?void 0:t.name,enabled:r}),i=zt({resolver:Ut(ete),defaultValues:{expire:"0",keywordFinish:e("flowise.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("flowise.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],flowiseIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{o&&i.reset({expire:o!=null&&o.expire?o.expire.toString():"0",keywordFinish:o.keywordFinish,delayMessage:o.delayMessage?o.delayMessage.toString():"0",unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime?o.debounceTime.toString():"0",ignoreJids:o.ignoreJids,flowiseIdFallback:o.flowiseIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar?o.timePerChar.toString():"0"})},[o]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),flowiseIdFallback:f.flowiseIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("flowise.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){a(),u()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("flowise.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("flowise.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"flowiseIdFallback",label:e("flowise.form.flowiseIdFallback.label"),options:(c==null?void 0:c.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("flowise.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("flowise.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("flowise.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("flowise.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("flowise.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("flowise.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("flowise.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("flowise.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("flowise.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:e("flowise.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("flowise.form.ignoreJids.label"),placeholder:e("flowise.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("flowise.button.save")})})]})})]})]})}const nte=e=>["flowise","fetchSessions",JSON.stringify(e)],rte=async({instanceName:e,flowiseId:t,token:n})=>(await ie.get(`/flowise/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,ste=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return qe({...s,queryKey:nte({instanceName:t}),queryFn:()=>rte({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function BI({flowiseId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusFlowise:r}=rm(),[s,o]=v.useState([]),[a,c]=v.useState(!1),[u,i]=v.useState(""),{data:d,refetch:p}=ste({instanceName:n==null?void 0:n.name,flowiseId:e,enabled:a});function f(){p()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("flowise.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("flowise.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("flowise.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("flowise.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("flowise.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("flowise.sessions.search"),value:u,onChange:m=>i(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:d??[],onSortingChange:o,state:{sorting:s,globalFilter:u},onGlobalFilterChange:i,enableGlobalFilter:!0,noResultsMessage:t("flowise.sessions.table.none")})]})]})]})}const ote=k.object({enabled:k.boolean(),description:k.string(),apiUrl:k.string(),apiKey:k.string().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function zI({initialData:e,onSubmit:t,handleDelete:n,flowiseId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(ote),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("flowise.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("flowise.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.flowiseSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"apiUrl",label:u("flowise.form.apiUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("flowise.form.apiKey.label"),children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("flowise.form.triggerType.label"),options:[{label:u("flowise.form.triggerType.keyword"),value:"keyword"},{label:u("flowise.form.triggerType.all"),value:"all"},{label:u("flowise.form.triggerType.advanced"),value:"advanced"},{label:u("flowise.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("flowise.form.triggerOperator.label"),options:[{label:u("flowise.form.triggerOperator.contains"),value:"contains"},{label:u("flowise.form.triggerOperator.equals"),value:"equals"},{label:u("flowise.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("flowise.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("flowise.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("flowise.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("flowise.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("flowise.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("flowise.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("flowise.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("flowise.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("flowise.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("flowise.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("flowise.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("flowise.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("flowise.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("flowise.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"flowise.button.saving":"flowise.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(BI,{flowiseId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"flowise.button.saving":"flowise.button.update")})]})]})]})})}function ate({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),{createFlowise:r}=rm(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const g={enabled:i.enabled,description:i.description,apiUrl:i.apiUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await r({instanceName:n.name,token:n.token,data:g}),G.success(t("flowise.toast.success.create")),c(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("flowise.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("flowise.form.title")})}),l.jsx(zI,{onSubmit:u,isModal:!0,isLoading:s})]})]})}const ite=e=>["flowise","getFlowise",JSON.stringify(e)],lte=async({instanceName:e,token:t,flowiseId:n})=>{const r=await ie.get(`/flowise/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},cte=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return qe({...s,queryKey:ite({instanceName:t}),queryFn:()=>lte({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function ute({flowiseId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteFlowise:c,updateFlowise:u}=rm(),{data:i,isLoading:d}=cte({instanceName:r==null?void 0:r.name,flowiseId:e}),p=v.useMemo(()=>({enabled:(i==null?void 0:i.enabled)??!0,description:(i==null?void 0:i.description)??"",apiUrl:(i==null?void 0:i.apiUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)??0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:i==null?void 0:i.listeningFromMe,stopBotFromMe:i==null?void 0:i.stopBotFromMe,keepOpen:i==null?void 0:i.keepOpen,debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.apiKey,i==null?void 0:i.apiUrl,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,apiUrl:h.apiUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,flowiseId:e,data:y}),G.success(n("flowise.toast.success.update")),t(),s(`/manager/instance/${r.id}/flowise/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,flowiseId:e}),G.success(n("flowise.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/flowise`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(zI,{initialData:p,onSubmit:f,flowiseId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function uE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{flowiseId:r}=gs(),{data:s,isLoading:o,refetch:a}=$I({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/flowise/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("flowise.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(BI,{}),l.jsx(tte,{}),l.jsx(ate,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("flowise.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(ute,{flowiseId:r,resetTable:i})})]})]})]})}const dte=e=>["n8n","fetchN8n",JSON.stringify(e)],fte=async({instanceName:e,token:t})=>(await ie.get(`/n8n/find/${e}`,{headers:{apikey:t}})).data,UI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:dte({instanceName:t,token:n}),queryFn:()=>fte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},pte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/n8n/create/${e}`,n,{headers:{apikey:t}})).data,gte=async({instanceName:e,n8nId:t,data:n})=>(await ie.put(`/n8n/update/${t}/${e}`,n)).data,hte=async({instanceName:e,n8nId:t})=>(await ie.delete(`/n8n/delete/${t}/${e}`)).data,mte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/n8n/settings/${e}`,n,{headers:{apikey:t}})).data,vte=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/n8n/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function sm(){const e=Le(mte,{invalidateKeys:[["n8n","fetchDefaultSettings"]]}),t=Le(vte,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchSessions"]]}),n=Le(hte,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),r=Le(gte,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),s=Le(pte,{invalidateKeys:[["n8n","fetchN8n"]]});return{setDefaultSettingsN8n:e,changeStatusN8n:t,deleteN8n:n,updateN8n:r,createN8n:s}}const yte=e=>["n8n","fetchDefaultSettings",JSON.stringify(e)],bte=async({instanceName:e,token:t})=>(await ie.get(`/n8n/fetchSettings/${e}`,{headers:{apikey:t}})).data,xte=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:yte({instanceName:t,token:n}),queryFn:()=>bte({instanceName:t,token:n}),enabled:!!t})},wte=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),n8nIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function Ste(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsN8n:n}=sm(),[r,s]=v.useState(!1),{data:o,refetch:a}=UI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=xte({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),i=zt({resolver:Ut(wte),defaultValues:{expire:"0",keywordFinish:e("n8n.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("n8n.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],n8nIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&i.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,n8nIdFallback:c.n8nIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),n8nIdFallback:f.n8nIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("n8n.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){u(),a()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("n8n.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("n8n.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"n8nIdFallback",label:e("n8n.form.n8nIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("n8n.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("n8n.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("n8n.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("n8n.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("n8n.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("n8n.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("n8n.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("n8n.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("n8n.form.splitMessages.label"),reverse:!0}),l.jsx($,{name:"timePerChar",label:e("n8n.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("n8n.form.ignoreJids.label"),placeholder:e("n8n.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("n8n.button.save")})})]})})]})]})}const Cte=e=>["n8n","fetchSessions",JSON.stringify(e)],Ete=async({n8nId:e,instanceName:t})=>(await ie.get(`/n8n/fetchSessions/${e}/${t}`)).data,kte=e=>{const{n8nId:t,instanceName:n,...r}=e;return qe({...r,queryKey:Cte({n8nId:t,instanceName:n}),queryFn:()=>Ete({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function VI({n8nId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusN8n:r}=sm(),[s,o]=v.useState([]),{data:a,refetch:c}=kte({n8nId:e,instanceName:n==null?void 0:n.name}),[u,i]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("n8n.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("n8n.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("n8n.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:u,onOpenChange:i,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("n8n.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("n8n.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("n8n.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("n8n.sessions.table.none")})]})]})]})}const jte=k.object({enabled:k.boolean(),description:k.string(),webhookUrl:k.string(),basicAuthUser:k.string(),basicAuthPass:k.string(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function HI({initialData:e,onSubmit:t,handleDelete:n,n8nId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(jte),defaultValues:e||{enabled:!0,description:"",webhookUrl:"",basicAuthUser:"",basicAuthPass:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("n8n.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("n8n.form.description.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.n8nSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"webhookUrl",label:u("n8n.form.webhookUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.basicAuth.label")}),l.jsx(ht,{})]}),l.jsxs("div",{className:"flex w-full flex-row gap-4",children:[l.jsx($,{name:"basicAuthUser",label:u("n8n.form.basicAuthUser.label"),className:"flex-1",children:l.jsx(F,{})}),l.jsx($,{name:"basicAuthPass",label:u("n8n.form.basicAuthPass.label"),className:"flex-1",children:l.jsx(F,{type:"password"})})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("n8n.form.triggerType.label"),options:[{label:u("n8n.form.triggerType.keyword"),value:"keyword"},{label:u("n8n.form.triggerType.all"),value:"all"},{label:u("n8n.form.triggerType.advanced"),value:"advanced"},{label:u("n8n.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("n8n.form.triggerOperator.label"),options:[{label:u("n8n.form.triggerOperator.contains"),value:"contains"},{label:u("n8n.form.triggerOperator.equals"),value:"equals"},{label:u("n8n.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("n8n.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("n8n.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("n8n.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("n8n.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("n8n.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("n8n.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("n8n.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("n8n.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("n8n.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("n8n.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("n8n.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("n8n.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("n8n.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("n8n.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"n8n.button.saving":"n8n.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(VI,{n8nId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("n8n.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"n8n.button.saving":"n8n.button.update")})]})]})]})})}function Tte({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createN8n:c}=sm(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,webhookUrl:i.webhookUrl,basicAuthUser:i.basicAuthUser,basicAuthPass:i.basicAuthPass,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("n8n.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("n8n.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("n8n.form.title")})}),l.jsx(HI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const Mte=e=>["n8n","getN8n",JSON.stringify(e)],Nte=async({n8nId:e,instanceName:t})=>(await ie.get(`/n8n/fetch/${e}/${t}`)).data,_te=e=>{const{n8nId:t,instanceName:n,...r}=e;return qe({...r,queryKey:Mte({n8nId:t,instanceName:n}),queryFn:()=>Nte({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Pte({n8nId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteN8n:c,updateN8n:u}=sm(),{data:i,isLoading:d}=_te({n8nId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",webhookUrl:(i==null?void 0:i.webhookUrl)??"",basicAuthUser:(i==null?void 0:i.basicAuthUser)??"",basicAuthPass:(i==null?void 0:i.basicAuthPass)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:(i==null?void 0:i.triggerValue)??"",expire:(i==null?void 0:i.expire)??0,keywordFinish:(i==null?void 0:i.keywordFinish)??"",delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:(i==null?void 0:i.unknownMessage)??"",listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.webhookUrl,i==null?void 0:i.basicAuthUser,i==null?void 0:i.basicAuthPass,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,webhookUrl:h.webhookUrl,basicAuthUser:h.basicAuthUser,basicAuthPass:h.basicAuthPass,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,n8nId:e,data:y}),G.success(n("n8n.toast.success.update")),t(),s(`/manager/instance/${r.id}/n8n/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,n8nId:e}),G.success(n("n8n.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/n8n`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir n8n:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(HI,{initialData:p,onSubmit:f,n8nId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function dE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{n8nId:r}=gs(),{data:s,refetch:o,isLoading:a}=UI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/n8n/${d}`)},i=()=>{o()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("n8n.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(VI,{}),l.jsx(Ste,{}),l.jsx(Tte,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("n8n.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(Pte,{n8nId:r,resetTable:i})})]})]})]})}const Rte=e=>["openai","findOpenai",JSON.stringify(e)],Ote=async({instanceName:e,token:t})=>(await ie.get(`/openai/find/${e}`,{headers:{apiKey:t}})).data,KI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Rte({instanceName:t}),queryFn:()=>Ote({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ite=e=>["openai","findOpenaiCreds",JSON.stringify(e)],Dte=async({instanceName:e,token:t})=>(await ie.get(`/openai/creds/${e}`,{headers:{apiKey:t}})).data,Gw=e=>{const{instanceName:t,token:n,...r}=e;return qe({staleTime:1e3*60*60*6,...r,queryKey:Ite({instanceName:t}),queryFn:()=>Dte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ate=async({instanceName:e,token:t,data:n})=>(await ie.post(`/openai/creds/${e}`,n,{headers:{apikey:t}})).data,Fte=async({openaiCredsId:e,instanceName:t})=>(await ie.delete(`/openai/creds/${e}/${t}`)).data,Lte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/openai/create/${e}`,n,{headers:{apikey:t}})).data,$te=async({instanceName:e,token:t,openaiId:n,data:r})=>(await ie.put(`/openai/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Bte=async({instanceName:e,token:t,openaiId:n})=>(await ie.delete(`/openai/delete/${n}/${e}`,{headers:{apikey:t}})).data,zte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/openai/settings/${e}`,n,{headers:{apikey:t}})).data,Ute=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/openai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function sf(){const e=Le(zte,{invalidateKeys:[["openai","fetchDefaultSettings"]]}),t=Le(Ute,{invalidateKeys:[["openai","getOpenai"],["openai","fetchSessions"]]}),n=Le(Bte,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),r=Le($te,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),s=Le(Lte,{invalidateKeys:[["openai","findOpenai"]]}),o=Le(Ate,{invalidateKeys:[["openai","findOpenaiCreds"]]}),a=Le(Fte,{invalidateKeys:[["openai","findOpenaiCreds"]]});return{setDefaultSettingsOpenai:e,changeStatusOpenai:t,deleteOpenai:n,updateOpenai:r,createOpenai:s,createOpenaiCreds:o,deleteOpenaiCreds:a}}const Vte=k.object({name:k.string(),apiKey:k.string()});function qI({onCredentialsUpdate:e,showText:t=!0}){const{t:n}=Te(),{instance:r}=Ve(),{createOpenaiCreds:s,deleteOpenaiCreds:o}=sf(),[a,c]=v.useState(!1),[u,i]=v.useState([]),{data:d}=Gw({instanceName:r==null?void 0:r.name,enabled:a}),p=zt({resolver:Ut(Vte),defaultValues:{name:"",apiKey:""}}),f=async m=>{var x,b,y;try{if(!r||!r.name)throw new Error("instance not found.");const w={name:m.name,apiKey:m.apiKey};await s({instanceName:r.name,token:r.token,data:w}),G.success(n("openai.toast.success.credentialsCreate")),p.reset(),e&&e()}catch(w){console.error("Error:",w),G.error(`Error: ${(y=(b=(x=w==null?void 0:w.response)==null?void 0:x.data)==null?void 0:b.response)==null?void 0:y.message}`)}},g=async m=>{var x,b,y;if(!(r!=null&&r.name)){G.error("Instance not found.");return}try{await o({openaiCredsId:m,instanceName:r==null?void 0:r.name}),G.success(n("openai.toast.success.credentialsDelete")),e&&e()}catch(w){console.error("Error:",w),G.error(`Error: ${(y=(b=(x=w==null?void 0:w.response)==null?void 0:x.data)==null?void 0:b.response)==null?void 0:y.message}`)}},h=[{accessorKey:"name",header:({column:m})=>l.jsxs(z,{variant:"ghost",onClick:()=>m.toggleSorting(m.getIsSorted()==="asc"),children:[n("openai.credentials.table.name"),l.jsx($B,{className:"ml-2 h-4 w-4"})]}),cell:({row:m})=>l.jsx("div",{children:m.getValue("name")})},{accessorKey:"apiKey",header:()=>l.jsx("div",{className:"text-right",children:n("openai.credentials.table.apiKey")}),cell:({row:m})=>l.jsxs("div",{children:[`${m.getValue("apiKey")}`.slice(0,20),"..."]})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:n("openai.credentials.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:n("openai.credentials.table.actions.title")}),l.jsx(Gs,{}),l.jsx(tt,{onClick:()=>g(x.id),children:n("openai.credentials.table.actions.delete")})]})]})}}];return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"secondary",size:"sm",type:"button",children:t?l.jsxs(l.Fragment,{children:[l.jsx(n3,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden md:inline",children:n("openai.credentials.title")})]}):l.jsx(Ws,{size:16})})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:n("openai.credentials.title")})}),l.jsx(Mn,{...p,children:l.jsx("div",{onClick:m=>m.stopPropagation(),onSubmit:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),children:l.jsxs("form",{onSubmit:m=>{m.preventDefault(),m.stopPropagation(),p.handleSubmit(f)(m)},className:"w-full space-y-6",children:[l.jsx("div",{children:l.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[l.jsx($,{name:"name",label:n("openai.credentials.table.name"),children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:n("openai.credentials.table.apiKey"),children:l.jsx(F,{type:"password"})})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:n("openai.button.save")})})]})})}),l.jsx(ht,{}),l.jsx("div",{children:l.jsx(Ka,{columns:h,data:d??[],onSortingChange:i,state:{sorting:u},noResultsMessage:n("openai.credentials.table.none")})})]})]})}const Hte=e=>["openai","fetchDefaultSettings",JSON.stringify(e)],Kte=async({instanceName:e,token:t})=>{const n=await ie.get(`/openai/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},qte=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Hte({instanceName:t}),queryFn:()=>Kte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Wte=k.object({openaiCredsId:k.string(),expire:k.coerce.number(),keywordFinish:k.string(),delayMessage:k.coerce.number().default(0),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.coerce.number(),speechToText:k.boolean(),ignoreJids:k.array(k.string()).default([]),openaiIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function Gte(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsOpenai:n}=sf(),[r,s]=v.useState(!1),{data:o,refetch:a}=qte({instanceName:t==null?void 0:t.name,enabled:r}),{data:c,refetch:u}=KI({instanceName:t==null?void 0:t.name,enabled:r}),{data:i}=Gw({instanceName:t==null?void 0:t.name,enabled:r}),d=zt({resolver:Ut(Wte),defaultValues:{openaiCredsId:"",expire:0,keywordFinish:e("openai.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("openai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,speechToText:!1,ignoreJids:[],openaiIdFallback:void 0,splitMessages:!1,timePerChar:0}});v.useEffect(()=>{o&&d.reset({openaiCredsId:o.openaiCredsId,expire:(o==null?void 0:o.expire)??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0,speechToText:o.speechToText,ignoreJids:o.ignoreJids,openaiIdFallback:o.openaiIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar??0})},[o]);const p=async g=>{var h,m,x;try{if(!t||!t.name)throw new Error("instance not found.");const b={openaiCredsId:g.openaiCredsId,expire:g.expire,keywordFinish:g.keywordFinish,delayMessage:g.delayMessage,unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:g.debounceTime,speechToText:g.speechToText,openaiIdFallback:g.openaiIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:g.timePerChar};await n({instanceName:t.name,token:t.token,data:b}),G.success(e("openai.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),G.error(`Error: ${(x=(m=(h=b==null?void 0:b.response)==null?void 0:h.data)==null?void 0:m.response)==null?void 0:x.message}`)}};function f(){a(),u()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden md:inline",children:e("openai.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("openai.defaultSettings")})}),l.jsx(Mn,{...d,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:d.handleSubmit(p),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"openaiCredsId",label:e("openai.form.openaiCredsId.label"),options:(i==null?void 0:i.filter(g=>!!g.id).map(g=>({label:g.name?g.name:g.apiKey.substring(0,15)+"...",value:g.id})))||[]}),l.jsx(jt,{name:"openaiIdFallback",label:e("openai.form.openaiIdFallback.label"),options:(c==null?void 0:c.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id})))??[]}),l.jsx($,{name:"expire",label:e("openai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("openai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("openai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("openai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("openai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("openai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("openai.form.keepOpen.label"),reverse:!0}),l.jsx(ge,{name:"speechToText",label:e("openai.form.speechToText.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("openai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("openai.form.splitMessages.label"),reverse:!0}),d.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:e("openai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("openai.form.ignoreJids.label"),placeholder:e("openai.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("openai.button.save")})})]})})]})]})}const Jte=e=>["openai","getModels",JSON.stringify(e)],Qte=async({instanceName:e,openaiCredsId:t,token:n})=>{const r=t?{openaiCredsId:t}:{};return(await ie.get(`/openai/getModels/${e}`,{headers:{apiKey:n},params:r})).data},Zte=e=>{const{instanceName:t,openaiCredsId:n,token:r,...s}=e;return qe({staleTime:1e3*60*60*6,...s,queryKey:Jte({instanceName:t,openaiCredsId:n}),queryFn:()=>Qte({instanceName:t,openaiCredsId:n,token:r}),enabled:!!t&&!!n&&(e.enabled??!0)})},Yte=e=>["openai","fetchSessions",JSON.stringify(e)],Xte=async({instanceName:e,openaiId:t,token:n})=>(await ie.get(`/openai/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,ene=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return qe({...s,queryKey:Yte({instanceName:t}),queryFn:()=>Xte({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function WI({openaiId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusOpenai:r}=sf(),[s,o]=v.useState([]),[a,c]=v.useState(!1),{data:u,refetch:i}=ene({instanceName:n==null?void 0:n.name,openaiId:e,enabled:a}),[d,p]=v.useState("");function f(){i()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("openai.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",size:"icon",children:[l.jsx("span",{className:"sr-only",children:t("openai.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("openai.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden md:inline",children:t("openai.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("openai.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("openai.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{size:16})})]}),l.jsx(Ka,{columns:h,data:u??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("openai.sessions.table.none")})]})]})]})}const tne=k.object({enabled:k.boolean(),description:k.string(),openaiCredsId:k.string(),botType:k.string(),assistantId:k.string().optional(),functionUrl:k.string().optional(),model:k.string().optional(),systemMessages:k.string().optional(),assistantMessages:k.string().optional(),userMessages:k.string().optional(),maxTokens:k.coerce.number().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function GI({initialData:e,onSubmit:t,handleDelete:n,openaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{},open:u}){const{t:i}=Te(),{instance:d}=Ve(),[p,f]=v.useState(!1),{data:g,refetch:h}=Gw({instanceName:d==null?void 0:d.name,enabled:u}),m=zt({resolver:Ut(tne),defaultValues:e||{enabled:!0,description:"",openaiCredsId:"",botType:"assistant",assistantId:"",functionUrl:"",model:"",systemMessages:"",assistantMessages:"",userMessages:"",maxTokens:0,triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),x=m.watch("botType"),b=m.watch("triggerType"),y=m.watch("openaiCredsId"),{data:w,isLoading:S,refetch:E}=Zte({instanceName:d==null?void 0:d.name,openaiCredsId:y,token:d==null?void 0:d.token,enabled:p&&!!y}),C=()=>{y&&(f(!0),E())},T=()=>{h()};return l.jsx(Mn,{...m,children:l.jsxs("form",{onSubmit:m.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:i("openai.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:i("openai.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsx("div",{className:"space-y-2",children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx(jt,{name:"openaiCredsId",label:i("openai.form.openaiCredsId.label"),required:!0,options:(g==null?void 0:g.filter(j=>!!j.id).map(j=>({label:j.name?j.name:j.apiKey.substring(0,15)+"...",value:j.id})))??[]})}),l.jsx(qI,{onCredentialsUpdate:T,showText:!1})]})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:i("openai.form.openaiSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"botType",label:i("openai.form.botType.label"),required:!0,options:[{label:i("openai.form.botType.assistant"),value:"assistant"},{label:i("openai.form.botType.chatCompletion"),value:"chatCompletion"}]}),x==="assistant"&&l.jsxs(l.Fragment,{children:[l.jsx($,{name:"assistantId",label:i("openai.form.assistantId.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"functionUrl",label:i("openai.form.functionUrl.label"),required:!0,children:l.jsx(F,{})})]}),x==="chatCompletion"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-2",children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx(jt,{name:"model",label:i("openai.form.model.label"),required:!0,disabled:!w||w.length===0,options:(w==null?void 0:w.map(j=>({label:j.id,value:j.id})))??[]})}),l.jsx(z,{type:"button",variant:"outline",size:"sm",disabled:!y||S,onClick:C,className:"mb-2",children:S?l.jsxs(l.Fragment,{children:[l.jsx(rg,{className:"mr-2 h-4 w-4 animate-spin"}),i("openai.button.loading")]}):l.jsxs(l.Fragment,{children:[l.jsx(rg,{className:"mr-2 h-4 w-4"}),i("openai.button.loadModels")]})})]})}),l.jsx($,{name:"systemMessages",label:i("openai.form.systemMessages.label"),children:l.jsx(Vl,{})}),l.jsx($,{name:"assistantMessages",label:i("openai.form.assistantMessages.label"),children:l.jsx(Vl,{})}),l.jsx($,{name:"userMessages",label:i("openai.form.userMessages.label"),children:l.jsx(Vl,{})}),l.jsx($,{name:"maxTokens",label:i("openai.form.maxTokens.label"),children:l.jsx(F,{type:"number"})})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:i("openai.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:i("openai.form.triggerType.label"),required:!0,options:[{label:i("openai.form.triggerType.keyword"),value:"keyword"},{label:i("openai.form.triggerType.all"),value:"all"},{label:i("openai.form.triggerType.advanced"),value:"advanced"},{label:i("openai.form.triggerType.none"),value:"none"}]}),b==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:i("openai.form.triggerOperator.label"),required:!0,options:[{label:i("openai.form.triggerOperator.contains"),value:"contains"},{label:i("openai.form.triggerOperator.equals"),value:"equals"},{label:i("openai.form.triggerOperator.startsWith"),value:"startsWith"},{label:i("openai.form.triggerOperator.endsWith"),value:"endsWith"},{label:i("openai.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:i("openai.form.triggerValue.label"),required:!0,children:l.jsx(F,{})})]}),b==="advanced"&&l.jsx($,{name:"triggerValue",label:i("openai.form.triggerConditions.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:i("openai.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:i("openai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:i("openai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:i("openai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:i("openai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:i("openai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:i("openai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:i("openai.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:i("openai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:i("openai.form.splitMessages.label"),reverse:!0}),m.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:i("openai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:i(o?"openai.button.saving":"openai.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(WI,{openaiId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:i("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:i("modal.delete.title")}),l.jsx(_o,{children:i("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:i("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:i("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:i(o?"openai.button.saving":"openai.button.update")})]})]})]})})}function nne({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),{createOpenai:r}=sf(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const g={enabled:i.enabled,description:i.description,openaiCredsId:i.openaiCredsId,botType:i.botType,assistantId:i.assistantId||"",functionUrl:i.functionUrl||"",model:i.model||"",systemMessages:[i.systemMessages||""],assistantMessages:[i.assistantMessages||""],userMessages:[i.userMessages||""],maxTokens:i.maxTokens||0,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await r({instanceName:n.name,token:n.token,data:g}),G.success(t("openai.toast.success.create")),c(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("openai.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("openai.form.title")})}),l.jsx(GI,{onSubmit:u,isModal:!0,isLoading:s,open:a})]})]})}const rne=e=>["openai","getOpenai",JSON.stringify(e)],sne=async({instanceName:e,token:t,openaiId:n})=>{const r=await ie.get(`/openai/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},one=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return qe({...s,queryKey:rne({instanceName:t}),queryFn:()=>sne({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function ane({openaiId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteOpenai:c,updateOpenai:u}=sf(),{data:i,isLoading:d}=one({instanceName:r==null?void 0:r.name,openaiId:e}),p=v.useMemo(()=>({enabled:(i==null?void 0:i.enabled)??!0,description:(i==null?void 0:i.description)??"",openaiCredsId:(i==null?void 0:i.openaiCredsId)??"",botType:(i==null?void 0:i.botType)??"",assistantId:(i==null?void 0:i.assistantId)||"",functionUrl:(i==null?void 0:i.functionUrl)||"",model:(i==null?void 0:i.model)||"",systemMessages:Array.isArray(i==null?void 0:i.systemMessages)?i==null?void 0:i.systemMessages.join(", "):(i==null?void 0:i.systemMessages)||"",assistantMessages:Array.isArray(i==null?void 0:i.assistantMessages)?i==null?void 0:i.assistantMessages.join(", "):(i==null?void 0:i.assistantMessages)||"",userMessages:Array.isArray(i==null?void 0:i.userMessages)?i==null?void 0:i.userMessages.join(", "):(i==null?void 0:i.userMessages)||"",maxTokens:(i==null?void 0:i.maxTokens)||0,triggerType:(i==null?void 0:i.triggerType)||"",triggerOperator:(i==null?void 0:i.triggerOperator)||"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)||0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)||0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:i==null?void 0:i.listeningFromMe,stopBotFromMe:i==null?void 0:i.stopBotFromMe,keepOpen:i==null?void 0:i.keepOpen,debounceTime:(i==null?void 0:i.debounceTime)||0,splitMessages:(i==null?void 0:i.splitMessages)||!1,timePerChar:(i==null?void 0:i.timePerChar)||0}),[i==null?void 0:i.assistantId,i==null?void 0:i.assistantMessages,i==null?void 0:i.botType,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.functionUrl,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.maxTokens,i==null?void 0:i.model,i==null?void 0:i.openaiCredsId,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.systemMessages,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.userMessages,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,openaiCredsId:h.openaiCredsId,botType:h.botType,assistantId:h.assistantId||"",functionUrl:h.functionUrl||"",model:h.model||"",systemMessages:[h.systemMessages||""],assistantMessages:[h.assistantMessages||""],userMessages:[h.userMessages||""],maxTokens:h.maxTokens||0,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,openaiId:e,data:y}),G.success(n("openai.toast.success.update")),t(),s(`/manager/instance/${r.id}/openai/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,openaiId:e}),G.success(n("openai.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/openai`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(GI,{initialData:p,onSubmit:f,openaiId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function fE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{botId:r}=gs(),{data:s,isLoading:o,refetch:a}=KI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/openai/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("openai.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(WI,{}),l.jsx(Gte,{}),l.jsx(qI,{}),l.jsx(nne,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsxs(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:[l.jsx("h4",{className:"text-base",children:d.description||d.id}),l.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:d.botType})]},d.id)):l.jsx(z,{variant:"link",children:e("openai.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(ane,{openaiId:r,resetTable:i})})]})]})]})}const ine=e=>["proxy","fetchProxy",JSON.stringify(e)],lne=async({instanceName:e,token:t})=>(await ie.get(`/proxy/find/${e}`,{headers:{apiKey:t}})).data,cne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:ine({instanceName:t,token:n}),queryFn:()=>lne({instanceName:t,token:n}),enabled:!!t})},une=async({instanceName:e,token:t,data:n})=>(await ie.post(`/proxy/set/${e}`,n,{headers:{apikey:t}})).data;function dne(){return{createProxy:Le(une,{invalidateKeys:[["proxy","fetchProxy"]]})}}const fne=k.object({enabled:k.boolean(),host:k.string(),port:k.string(),protocol:k.string(),username:k.string(),password:k.string()});function pne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createProxy:s}=dne(),{data:o}=cne({instanceName:t==null?void 0:t.name}),a=zt({resolver:Ut(fne),defaultValues:{enabled:!1,host:"",port:"",protocol:"http",username:"",password:""}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,host:o.host,port:o.port,protocol:o.protocol,username:o.username,password:o.password})},[o]);const c=async u=>{var i,d,p;if(t){r(!0);try{const f={enabled:u.enabled,host:u.host,port:u.port,protocol:u.protocol,username:u.username,password:u.password};await s({instanceName:t.name,token:t.token,data:f}),G.success(e("proxy.toast.success"))}catch(f){console.error(e("proxy.toast.error"),f),G.error(`Error : ${(p=(d=(i=f==null?void 0:f.response)==null?void 0:i.data)==null?void 0:d.response)==null?void 0:p.message}`)}finally{r(!1)}}};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("proxy.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("proxy.form.enabled.label"),className:"w-full justify-between",helper:e("proxy.form.enabled.description")}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-[10rem_1fr_10rem] md:gap-8",children:[l.jsx($,{name:"protocol",label:e("proxy.form.protocol.label"),children:l.jsx(F,{})}),l.jsx($,{name:"host",label:e("proxy.form.host.label"),children:l.jsx(F,{})}),l.jsx($,{name:"port",label:e("proxy.form.port.label"),children:l.jsx(F,{type:"number"})})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 md:gap-8",children:[l.jsx($,{name:"username",label:e("proxy.form.username.label"),children:l.jsx(F,{})}),l.jsx($,{name:"password",label:e("proxy.form.password.label"),children:l.jsx(F,{type:"password"})})]}),l.jsx("div",{className:"flex justify-end px-4 pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"proxy.button.saving":"proxy.button.save")})})]})]})})})})}const gne=e=>["rabbitmq","fetchRabbitmq",JSON.stringify(e)],hne=async({instanceName:e,token:t})=>(await ie.get(`/rabbitmq/find/${e}`,{headers:{apiKey:t}})).data,mne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:gne({instanceName:t,token:n}),queryFn:()=>hne({instanceName:t,token:n}),enabled:!!t})},vne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/rabbitmq/set/${e}`,{rabbitmq:n},{headers:{apikey:t}})).data;function yne(){return{createRabbitmq:Le(vne,{invalidateKeys:[["rabbitmq","fetchRabbitmq"]]})}}const bne=k.object({enabled:k.boolean(),events:k.array(k.string())});function xne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createRabbitmq:s}=yne(),{data:o}=mne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(bne),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("rabbitmq.toast.success"))}catch(m){console.error(e("rabbitmq.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("rabbitmq.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("rabbitmq.form.enabled.label"),className:"w-full justify-between",helper:e("rabbitmq.form.enabled.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("rabbitmq.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"rabbitmq.button.saving":"rabbitmq.button.save")})})]})})})})}const wne=e=>["instance","fetchSettings",JSON.stringify(e)],Sne=async({instanceName:e,token:t})=>(await ie.get(`/settings/find/${e}`,{headers:{apikey:t}})).data,Cne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:wne({instanceName:t,token:n}),queryFn:()=>Sne({instanceName:t,token:n}),enabled:!!t})},Ene=k.object({rejectCall:k.boolean(),msgCall:k.string().optional(),groupsIgnore:k.boolean(),alwaysOnline:k.boolean(),readMessages:k.boolean(),syncFullHistory:k.boolean(),readStatus:k.boolean()});function kne(){const{t:e}=Te(),[t,n]=v.useState(!1),{instance:r}=Ve(),{updateSettings:s}=Nh(),{data:o,isLoading:a}=Cne({instanceName:r==null?void 0:r.name,token:r==null?void 0:r.token}),c=zt({resolver:Ut(Ene),defaultValues:{rejectCall:!1,msgCall:"",groupsIgnore:!1,alwaysOnline:!1,readMessages:!1,syncFullHistory:!1,readStatus:!1}});v.useEffect(()=>{o&&c.reset({rejectCall:o.rejectCall,msgCall:o.msgCall||"",groupsIgnore:o.groupsIgnore,alwaysOnline:o.alwaysOnline,readMessages:o.readMessages,syncFullHistory:o.syncFullHistory,readStatus:o.readStatus})},[c,o]);const u=async p=>{try{if(!r||!r.name)throw new Error("instance not found");n(!0);const f={rejectCall:p.rejectCall,msgCall:p.msgCall,groupsIgnore:p.groupsIgnore,alwaysOnline:p.alwaysOnline,readMessages:p.readMessages,syncFullHistory:p.syncFullHistory,readStatus:p.readStatus};await s({instanceName:r.name,token:r.token,data:f}),G.success(e("settings.toast.success"))}catch(f){console.error(e("settings.toast.success"),f),G.error(e("settings.toast.error"))}finally{n(!1)}},i=[{name:"groupsIgnore",label:e("settings.form.groupsIgnore.label"),description:e("settings.form.groupsIgnore.description")},{name:"alwaysOnline",label:e("settings.form.alwaysOnline.label"),description:e("settings.form.alwaysOnline.description")},{name:"readMessages",label:e("settings.form.readMessages.label"),description:e("settings.form.readMessages.description")},{name:"syncFullHistory",label:e("settings.form.syncFullHistory.label"),description:e("settings.form.syncFullHistory.description")},{name:"readStatus",label:e("settings.form.readStatus.label"),description:e("settings.form.readStatus.description")}],d=c.watch("rejectCall");return a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:l.jsx(La,{...c,children:l.jsx("form",{onSubmit:c.handleSubmit(u),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("settings.title")}),l.jsx(ht,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y",children:[l.jsxs("div",{className:"flex flex-col p-4",children:[l.jsx(ge,{name:"rejectCall",label:e("settings.form.rejectCall.label"),className:"w-full justify-between",helper:e("settings.form.rejectCall.description")}),d&&l.jsx("div",{className:"mr-16 mt-2",children:l.jsx($,{name:"msgCall",children:l.jsx(Vl,{placeholder:e("settings.form.msgCall.description")})})})]}),i.map(p=>l.jsx("div",{className:"flex p-4",children:l.jsx(ge,{name:p.name,label:p.label,className:"w-full justify-between",helper:p.description})},p.name)),l.jsx("div",{className:"flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:t,children:e(t?"settings.button.saving":"settings.button.save")})})]})]})})})})}const jne=e=>["sqs","fetchSqs",JSON.stringify(e)],Tne=async({instanceName:e,token:t})=>(await ie.get(`/sqs/find/${e}`,{headers:{apiKey:t}})).data,Mne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:jne({instanceName:t,token:n}),queryFn:()=>Tne({instanceName:t,token:n}),enabled:!!t})},Nne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/sqs/set/${e}`,{sqs:n},{headers:{apikey:t}})).data;function _ne(){return{createSqs:Le(Nne,{invalidateKeys:[["sqs","fetchSqs"]]})}}const Pne=k.object({enabled:k.boolean(),events:k.array(k.string())});function Rne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createSqs:s}=_ne(),{data:o}=Mne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(Pne),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("sqs.toast.success"))}catch(m){console.error(e("sqs.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("sqs.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("sqs.form.enabled.label"),className:"w-full justify-between",helper:e("sqs.form.enabled.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("sqs.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"sqs.button.saving":"sqs.button.save")})})]})})})})}const One=e=>["typebot","findTypebot",JSON.stringify(e)],Ine=async({instanceName:e,token:t})=>(await ie.get(`/typebot/find/${e}`,{headers:{apiKey:t}})).data,JI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:One({instanceName:t}),queryFn:()=>Ine({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Dne=e=>["typebot","fetchDefaultSettings",JSON.stringify(e)],Ane=async({instanceName:e,token:t})=>{const n=await ie.get(`/typebot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Fne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Dne({instanceName:t}),queryFn:()=>Ane({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Lne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/typebot/create/${e}`,n,{headers:{apikey:t}})).data,$ne=async({instanceName:e,token:t,typebotId:n,data:r})=>(await ie.put(`/typebot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Bne=async({instanceName:e,typebotId:t})=>(await ie.delete(`/typebot/delete/${t}/${e}`)).data,zne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/typebot/settings/${e}`,n,{headers:{apikey:t}})).data,Une=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/typebot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function om(){const e=Le(zne,{invalidateKeys:[["typebot","fetchDefaultSettings"]]}),t=Le(Une,{invalidateKeys:[["typebot","getTypebot"],["typebot","fetchSessions"]]}),n=Le(Bne,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),r=Le($ne,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),s=Le(Lne,{invalidateKeys:[["typebot","findTypebot"]]});return{setDefaultSettingsTypebot:e,changeStatusTypebot:t,deleteTypebot:n,updateTypebot:r,createTypebot:s}}const Vne=k.object({expire:k.coerce.number(),keywordFinish:k.string(),delayMessage:k.coerce.number(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.coerce.number()});function Hne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{setDefaultSettingsTypebot:s}=om(),{data:o,refetch:a}=Fne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:n}),{data:c,refetch:u}=JI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:n}),i=zt({resolver:Ut(Vne),defaultValues:{expire:0,keywordFinish:e("typebot.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("typebot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}});v.useEffect(()=>{o&&i.reset({expire:(o==null?void 0:o.expire)??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0})},[o]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:f.expire,keywordFinish:f.keywordFinish,delayMessage:f.delayMessage,unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:f.debounceTime};await s({instanceName:t.name,token:t.token,data:x}),G.success(e("typebot.toast.defaultSettings.success"))}catch(x){console.error(e("typebot.toast.defaultSettings.error"),x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){a(),u()}return l.jsxs(pt,{open:n,onOpenChange:r,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("typebot.button.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("typebot.modal.defaultSettings.title")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"typebotIdFallback",label:e("typebot.form.typebotIdFallback.label"),options:(c==null?void 0:c.filter(f=>!!f.id).map(f=>({label:f.typebot,value:f.description})))??[]}),l.jsx($,{name:"expire",label:e("typebot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("typebot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("typebot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("typebot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("typebot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("typebot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("typebot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("typebot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("typebot.form.ignoreJids.label"),placeholder:e("typebot.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("typebot.button.save")})})]})})]})]})}const Kne=e=>["typebot","fetchSessions",JSON.stringify(e)],qne=async({instanceName:e,typebotId:t,token:n})=>(await ie.get(`/typebot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Wne=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return qe({...s,queryKey:Kne({instanceName:t}),queryFn:()=>qne({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function QI({typebotId:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState([]),[o,a]=v.useState(!1),[c,u]=v.useState(""),{changeStatusTypebot:i}=om(),{data:d,refetch:p}=Wne({instanceName:n==null?void 0:n.name,token:n==null?void 0:n.token,typebotId:e});function f(){p()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await i({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("typebot.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("typebot.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:"Actions"}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"})," ",l.jsx("span",{className:"hidden sm:inline",children:t("typebot.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("typebot.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("typebot.sessions.search"),value:c,onChange:m=>u(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{size:16})})]}),l.jsx(Ka,{columns:h,data:d??[],onSortingChange:s,state:{sorting:r,globalFilter:c},onGlobalFilterChange:u,enableGlobalFilter:!0,noResultsMessage:t("typebot.sessions.table.none")})]})]})]})}const Gne=k.object({enabled:k.boolean(),description:k.string(),url:k.string(),typebot:k.string().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional()});function ZI({initialData:e,onSubmit:t,handleDelete:n,typebotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(Gne),defaultValues:e||{enabled:!0,description:"",url:"",typebot:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("typebot.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("typebot.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.typebotSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"url",label:u("typebot.form.url.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"typebot",label:u("typebot.form.typebot.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("typebot.form.triggerType.label"),options:[{label:u("typebot.form.triggerType.keyword"),value:"keyword"},{label:u("typebot.form.triggerType.all"),value:"all"},{label:u("typebot.form.triggerType.advanced"),value:"advanced"},{label:u("typebot.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("typebot.form.triggerOperator.label"),options:[{label:u("typebot.form.triggerOperator.contains"),value:"contains"},{label:u("typebot.form.triggerOperator.equals"),value:"equals"},{label:u("typebot.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("typebot.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("typebot.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("typebot.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("typebot.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("typebot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("typebot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("typebot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("typebot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("typebot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("typebot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("typebot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("typebot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"typebot.button.saving":"typebot.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(QI,{typebotId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"typebot.button.saving":"typebot.button.update")})]})]})]})})}function Jne({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),{createTypebot:r}=om(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const g={enabled:i.enabled,description:i.description,url:i.url,typebot:i.typebot||"",triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0};await r({instanceName:n.name,token:n.token,data:g}),G.success(t("typebot.toast.success.create")),c(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("typebot.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("typebot.form.title")})}),l.jsx(ZI,{onSubmit:u,isModal:!0,isLoading:s})]})]})}const Qne=e=>["typebot","getTypebot",JSON.stringify(e)],Zne=async({instanceName:e,token:t,typebotId:n})=>{const r=await ie.get(`/typebot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Yne=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return qe({...s,queryKey:Qne({instanceName:t}),queryFn:()=>Zne({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Xne({typebotId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteTypebot:c,updateTypebot:u}=om(),{data:i,isLoading:d}=Yne({instanceName:r==null?void 0:r.name,typebotId:e}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",url:(i==null?void 0:i.url)??"",typebot:(i==null?void 0:i.typebot)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)??0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0}),[i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.typebot,i==null?void 0:i.unknownMessage,i==null?void 0:i.url]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,url:h.url,typebot:h.typebot||"",triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0};await u({instanceName:r.name,typebotId:e,data:y}),G.success(n("typebot.toast.success.update")),t(),s(`/manager/instance/${r.id}/typebot/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,typebotId:e}),G.success(n("typebot.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/typebot`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(ZI,{initialData:p,onSubmit:f,typebotId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function pE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{typebotId:r}=gs(),{data:s,isLoading:o,refetch:a}=JI({instanceName:n==null?void 0:n.name,token:n==null?void 0:n.token}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/typebot/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("typebot.title")}),l.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[l.jsx(QI,{}),l.jsx(Hne,{}),l.jsx(Jne,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:d.description?l.jsxs(l.Fragment,{children:[l.jsx("h4",{className:"text-base",children:d.description}),l.jsxs("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:[d.url," - ",d.typebot]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h4",{className:"text-base",children:d.url}),l.jsx("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:d.typebot})]})},d.id)):l.jsx(z,{variant:"link",children:e("typebot.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-black"}),l.jsx(Bn,{children:l.jsx(Xne,{typebotId:r,resetTable:i})})]})]})]})}const ere=e=>["webhook","fetchWebhook",JSON.stringify(e)],tre=async({instanceName:e,token:t})=>(await ie.get(`/webhook/find/${e}`,{headers:{apiKey:t}})).data,nre=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:ere({instanceName:t,token:n}),queryFn:()=>tre({instanceName:t,token:n}),enabled:!!t})},rre=async({instanceName:e,token:t,data:n})=>(await ie.post(`/webhook/set/${e}`,{webhook:n},{headers:{apikey:t}})).data;function sre(){return{createWebhook:Le(rre,{invalidateKeys:[["webhook","fetchWebhook"]]})}}const ore=k.object({enabled:k.boolean(),url:k.string().url("Invalid URL format"),events:k.array(k.string()),base64:k.boolean(),byEvents:k.boolean()});function are(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createWebhook:s}=sre(),{data:o}=nre({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(ore),defaultValues:{enabled:!1,url:"",events:[],base64:!1,byEvents:!1}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,url:o.url,events:o.events,base64:o.webhookBase64,byEvents:o.webhookByEvents})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,url:p.url,events:p.events,base64:p.base64,byEvents:p.byEvents};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("webhook.toast.success"))}catch(m){console.error(e("webhook.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("webhook.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("webhook.form.enabled.label"),className:"w-full justify-between",helper:e("webhook.form.enabled.description")}),l.jsx($,{name:"url",label:"URL",children:l.jsx(F,{})}),l.jsx(ge,{name:"byEvents",label:e("webhook.form.byEvents.label"),className:"w-full justify-between",helper:e("webhook.form.byEvents.description")}),l.jsx(ge,{name:"base64",label:e("webhook.form.base64.label"),className:"w-full justify-between",helper:e("webhook.form.base64.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("webhook.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"webhook.button.saving":"webhook.button.save")})})]})})})})}const ire=e=>["websocket","fetchWebsocket",JSON.stringify(e)],lre=async({instanceName:e,token:t})=>(await ie.get(`/websocket/find/${e}`,{headers:{apiKey:t}})).data,cre=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:ire({instanceName:t,token:n}),queryFn:()=>lre({instanceName:t,token:n}),enabled:!!t})},ure=async({instanceName:e,token:t,data:n})=>(await ie.post(`/websocket/set/${e}`,{websocket:n},{headers:{apikey:t}})).data;function dre(){return{createWebsocket:Le(ure,{invalidateKeys:[["websocket","fetchWebsocket"]]})}}const fre=k.object({enabled:k.boolean(),events:k.array(k.string())});function pre(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createWebsocket:s}=dre(),{data:o}=cre({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(fre),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("websocket.toast.success"))}catch(m){console.error(e("websocket.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("websocket.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("websocket.form.enabled.label"),className:"w-full justify-between",helper:e("websocket.form.enabled.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("websocket.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"websocket.button.saving":"websocket.button.save")})})]})})})})}const gre=async({url:e,token:t})=>{try{const{data:n}=await Bt.post(`${e}/verify-creds`,{},{headers:{apikey:t}});return AT({facebookAppId:n.facebookAppId,facebookConfigId:n.facebookConfigId,facebookUserToken:n.facebookUserToken}),n}catch{return null}},hre=k.object({serverUrl:k.string({required_error:"serverUrl is required"}).url("URL inválida"),apiKey:k.string({required_error:"ApiKey is required"})});function mre(){const{t:e}=Te(),t=an(),n=zt({resolver:Ut(hre),defaultValues:{serverUrl:window.location.protocol+"//"+window.location.host,apiKey:""}}),r=async s=>{const o=await lM({url:s.serverUrl});if(!o||!o.version){FT(),n.setError("serverUrl",{type:"manual",message:e("login.message.invalidServer")});return}if(!await gre({token:s.apiKey,url:s.serverUrl})){n.setError("apiKey",{type:"manual",message:e("login.message.invalidCredentials")});return}AT({version:o.version,clientName:o.clientName,url:s.serverUrl,token:s.apiKey}),t("/manager/")};return l.jsxs("div",{className:"flex min-h-screen flex-col",children:[l.jsx("div",{className:"flex items-center justify-center pt-2",children:l.jsx("img",{className:"h-10",src:"/assets/images/evolution-logo.png",alt:"logo"})}),l.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:l.jsxs(oi,{className:"b-none w-[350px] shadow-none",children:[l.jsxs(ai,{children:[l.jsx(Iu,{className:"text-center",children:e("login.title")}),l.jsx(eP,{className:"text-center",children:e("login.description")})]}),l.jsx(La,{...n,children:l.jsxs("form",{onSubmit:n.handleSubmit(r),children:[l.jsx(ii,{children:l.jsxs("div",{className:"grid w-full items-center gap-4",children:[l.jsx($,{required:!0,name:"serverUrl",label:e("login.form.serverUrl"),children:l.jsx(F,{})}),l.jsx($,{required:!0,name:"apiKey",label:e("login.form.apiKey"),children:l.jsx(F,{type:"password"})})]})}),l.jsx(Mh,{className:"flex justify-center",children:l.jsx(z,{className:"w-full",type:"submit",children:e("login.button.login")})})]})})]})}),l.jsx(zx,{})]})}const vre=HL([{path:"/manager/login",element:l.jsx(x$,{children:l.jsx(mre,{})})},{path:"/manager/",element:l.jsx(Rt,{children:l.jsx(IV,{children:l.jsx(aZ,{})})})},{path:"/manager/instance/:instanceId/dashboard",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(IY,{})})})},{path:"/manager/instance/:instanceId/chat",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(tE,{})})})},{path:"/manager/instance/:instanceId/chat/:remoteJid",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(tE,{})})})},{path:"/manager/instance/:instanceId/settings",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(kne,{})})})},{path:"/manager/instance/:instanceId/openai",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(fE,{})})})},{path:"/manager/instance/:instanceId/openai/:botId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(fE,{})})})},{path:"/manager/instance/:instanceId/webhook",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(are,{})})})},{path:"/manager/instance/:instanceId/websocket",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pre,{})})})},{path:"/manager/instance/:instanceId/rabbitmq",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(xne,{})})})},{path:"/manager/instance/:instanceId/sqs",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(Rne,{})})})},{path:"/manager/instance/:instanceId/chatwoot",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(nY,{})})})},{path:"/manager/instance/:instanceId/typebot",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pE,{})})})},{path:"/manager/instance/:instanceId/typebot/:typebotId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pE,{})})})},{path:"/manager/instance/:instanceId/dify",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(iE,{})})})},{path:"/manager/instance/:instanceId/dify/:difyId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(iE,{})})})},{path:"/manager/instance/:instanceId/n8n",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(dE,{})})})},{path:"/manager/instance/:instanceId/n8n/:n8nId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(dE,{})})})},{path:"/manager/instance/:instanceId/evoai",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(lE,{})})})},{path:"/manager/instance/:instanceId/evoai/:evoaiId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(lE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(cE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot/:evolutionBotId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(cE,{})})})},{path:"/manager/instance/:instanceId/flowise",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(uE,{})})})},{path:"/manager/instance/:instanceId/flowise/:flowiseId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(uE,{})})})},{path:"/manager/instance/:instanceId/proxy",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pne,{})})})}]),yre={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class _g{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||yre,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[c,u]=a;for(let i=0;i{let[c,u]=a;for(let i=0;i{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},gE=e=>e==null?"":""+e,bre=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},xre=/###/g,hE=e=>e&&e.indexOf("###")>-1?e.replace(xre,"."):e,mE=e=>!e||typeof e=="string",Bu=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let s=0;for(;s{const{obj:r,k:s}=Bu(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),c=Bu(e,a,Object);for(;c.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),c=Bu(e,a,Object),c&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},wre=(e,t,n,r)=>{const{obj:s,k:o}=Bu(e,t,Object);s[o]=s[o]||[],s[o].push(n)},Pg=(e,t)=>{const{obj:n,k:r}=Bu(e,t);if(n)return n[r]},Sre=(e,t,n)=>{const r=Pg(e,n);return r!==void 0?r:Pg(t,n)},YI=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):YI(e[r],t[r],n):e[r]=t[r]);return e},dl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Cre={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Ere=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Cre[t]):e;class kre{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const jre=[" ",",","?","!",";"],Tre=new kre(20),Mre=(e,t,n)=>{t=t||"",n=n||"";const r=jre.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=Tre.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(e);if(!o){const a=e.indexOf(n);a>0&&!s.test(e.substring(0,a))&&(o=!0)}return o},Pb=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o-1&&ue&&e.indexOf("_")>0?e.replace("_","-"):e;class yE extends am{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&o?c.push(...r.split(o)):c.push(r)));const u=Pg(this.data,c);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),u||!a||typeof r!="string"?u:Pb(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(c=t.split("."),s=n,n=c[1]),this.addNamespaces(n),vE(this.data,c,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),s=r,r=n,n=c[1]),this.addNamespaces(n);let u=Pg(this.data,c)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?YI(u,r,o):u={...u,...r},vE(this.data,c,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var XI={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const bE={};class Og extends am{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),bre(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ls.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Mre(t,r,s);if(a&&!c){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:o};const i=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),t=i.join(s)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(t[t.length-1],n),u=c[c.length-1],i=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(i&&i.toLowerCase()==="cimode"){if(d){const S=n.nsSeparator||this.options.nsSeparator;return s?{res:`${u}${S}${a}`,usedKey:a,exactUsedKey:a,usedLng:i,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${S}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:i,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a}const p=this.resolve(t,n);let f=p&&p.res;const g=p&&p.usedKey||a,h=p&&p.exactUsedKey||a,m=Object.prototype.toString.apply(f),x=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&x.indexOf(m)<0&&!(typeof b=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,f,{...n,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(p.res=S,p.usedParams=this.getUsedParamsDetails(n),p):S}if(o){const S=Array.isArray(f),E=S?[]:{},C=S?h:g;for(const T in f)if(Object.prototype.hasOwnProperty.call(f,T)){const j=`${C}${o}${T}`;E[T]=this.translate(j,{...n,joinArrays:!1,ns:c}),E[T]===j&&(E[T]=f[T])}f=E}}else if(y&&typeof b=="string"&&Array.isArray(f))f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let S=!1,E=!1;const C=n.count!==void 0&&typeof n.count!="string",T=Og.hasDefaultValue(n),j=C?this.pluralResolver.getSuffix(i,n.count,n):"",_=n.ordinal&&C?this.pluralResolver.getSuffix(i,n.count,{ordinal:!1}):"",O=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),K=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${j}`]||n[`defaultValue${_}`]||n.defaultValue;!this.isValidLookup(f)&&T&&(S=!0,f=K),this.isValidLookup(f)||(E=!0,f=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:f,q=T&&K!==f&&this.options.updateMissing;if(E||S||q){if(this.logger.log(q?"updateKey":"missingKey",i,u,a,q?K:f),o){const L=this.resolve(a,{...n,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Z=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let L=0;L{const fe=T&&X!==f?X:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(L,u,A,fe,q,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(L,u,A,fe,q,n),this.emit("missingKey",L,u,A,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?Z.forEach(L=>{const A=this.pluralResolver.getSuffixes(L,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&A.indexOf(`${this.options.pluralSeparator}zero`)<0&&A.push(`${this.options.pluralSeparator}zero`),A.forEach(X=>{J([L],a+X,n[`defaultValue${X}`]||K)})}):J(Z,a,K))}f=this.extendTranslation(f,t,n,p,r),E&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${u}:${a}`),(E||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,S?f:void 0):f=this.options.parseMissingKeyHandler(f))}return s?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(t,n,r,s,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const i=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(i){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let p=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||s.usedLng,r),i){const f=t.match(this.interpolator.nestingRegexp),g=f&&f.length;d1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,c;return typeof t=="string"&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const i=this.extractFromKey(u,n),d=i.key;s=d;let p=i.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",g=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),h=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(x=>{this.isValidLookup(r)||(c=x,!bE[`${m[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(bE[`${m[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,d,b,x,n);else{let S;f&&(S=this.pluralResolver.getSuffix(b,n.count,n));const E=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(d+S),n.ordinal&&S.indexOf(C)===0&&y.push(d+S.replace(C,this.options.pluralSeparator)),g&&y.push(d+E)),h){const T=`${d}${this.options.contextSeparator}${n.context}`;y.push(T),f&&(y.push(T+S),n.ordinal&&S.indexOf(C)===0&&y.push(T+S.replace(C,this.options.pluralSeparator)),g&&y.push(T+E))}}let w;for(;w=y.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(b,x,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Tv=e=>e.charAt(0).toUpperCase()+e.slice(1);class xE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ls.create("languageUtils")}getScriptPartFromCode(t){if(t=Rg(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Rg(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tv(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tv(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Tv(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}let Nre=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_re={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const Pre=["v1","v2","v3"],Rre=["v4"],wE={zero:0,one:1,two:2,few:3,many:4,other:5},Ore=()=>{const e={};return Nre.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:_re[t.fc]}})}),e};class Ire{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ls.create("pluralResolver"),(!this.options.compatibilityJSON||Rre.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Ore(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Rg(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const a=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=a,a}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>wE[s]-wE[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Pre.includes(this.options.compatibilityJSON)}}const SE=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Sre(e,t,n);return!o&&s&&typeof n=="string"&&(o=Pb(e,n,r),o===void 0&&(o=Pb(t,n,r))),o},Mv=e=>e.replace(/\$/g,"$$$$");class Dre{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ls.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:c,suffixEscaped:u,formatSeparator:i,unescapeSuffix:d,unescapePrefix:p,nestingPrefix:f,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:b,alwaysFormat:y}=t.interpolation;this.escape=n!==void 0?n:Ere,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?dl(o):a||"{{",this.suffix=c?dl(c):u||"}}",this.formatSeparator=i||",",this.unescapePrefix=d?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?dl(f):g||dl("$t("),this.nestingSuffix=h?dl(h):m||dl(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=b||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,a,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},i=g=>{if(g.indexOf(this.formatSeparator)<0){const b=SE(n,u,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...s,...n,interpolationkey:g}):b}const h=g.split(this.formatSeparator),m=h.shift().trim(),x=h.join(this.formatSeparator).trim();return this.format(SE(n,u,m,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>Mv(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?Mv(this.escape(g)):Mv(g)}].forEach(g=>{for(c=0;o=g.regex.exec(t);){const h=o[1].trim();if(a=i(h),a===void 0)if(typeof d=="function"){const x=d(t,o,s);a=typeof x=="string"?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,h))a="";else if(p){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=gE(a));const m=g.safeValue(a);if(t=t.replace(o[0],m),p?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=o[0].length):g.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const c=(u,i)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const p=u.split(new RegExp(`${d}[ ]*{`));let f=`{${p[1]}`;u=p[0],f=this.interpolate(f,a);const g=f.match(/'/g),h=f.match(/"/g);(g&&g.length%2===0&&!h||h.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),i&&(a={...i,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,m),`${u}${d}${f}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;s=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let i=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(p=>p.trim());s[1]=d.shift(),u=d,i=!0}if(o=n(c.call(this,s[1].trim(),a),a),o&&s[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=gE(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),i&&(o=u.reduce((d,p)=>this.format(d,p,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const Are=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[c,...u]=a.split(":"),i=u.join(":").trim().replace(/^'+|'+$/g,""),d=c.trim();n[d]||(n[d]=i),i==="false"&&(n[d]=!1),i==="true"&&(n[d]=!0),isNaN(i)||(n[d]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},fl=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let c=t[a];return c||(c=e(Rg(r),s),t[a]=c),c(n)}};class Fre{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ls.create("formatter"),this.options=t,this.formats={number:fl((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:fl((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:fl((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:fl((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:fl((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=fl(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,u)=>{const{formatName:i,formatOptions:d}=Are(u);if(this.formats[i]){let p=c;try{const f=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},g=f.locale||f.lng||s.locale||s.lng||r;p=this.formats[i](c,g,{...d,...s,...f})}catch(f){this.logger.warn(f)}return p}else this.logger.warn(`there was no format function for ${i}`);return c},t)}}const Lre=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class $re extends am{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ls.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},a={},c={},u={};return t.forEach(i=>{let d=!0;n.forEach(p=>{const f=`${i}|${p}`;!r.reload&&this.store.hasResourceBundle(i,p)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,d=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),u[p]===void 0&&(u[p]=!0)))}),d||(c[i]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const s=t.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(u=>{wre(u.loaded,[o],a),Lre(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(i=>{c[i]||(c[i]={});const d=u.loaded[i];d.length&&d.forEach(p=>{c[i][p]===void 0&&(c[i][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const c=(i,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(i&&d&&s{this.read.call(this,t,n,r,s+1,o*2,a)},o);return}a(i,d)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const i=u(t,n);i&&typeof i.then=="function"?i.then(d=>c(null,d)).catch(c):c(null,i)}catch(i){c(i)}return}return u(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,c)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,c),this.loaded(t,a,c)})}saveMissing(t,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:o},i=this.backend.create.bind(this.backend);if(i.length<6)try{let d;i.length===5?d=i(t,n,r,s,u):d=i(t,n,r,s),d&&typeof d.then=="function"?d.then(p=>c(null,p)).catch(c):c(null,d)}catch(d){c(d)}else i(t,n,r,s,c,u)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const CE=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),EE=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Zf=()=>{},Bre=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Ad extends am{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=EE(t),this.services={},this.logger=Ls,this.modules={external:[]},Bre(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=CE();this.options={...s,...this.options,...EE(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Ls.init(o(this.modules.logger),this.options):Ls.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Fre);const p=new xE(this.options);this.store=new yE(this.options.resources,this.options);const f=this.services;f.logger=Ls,f.resourceStore=this.store,f.languageUtils=p,f.pluralResolver=new Ire(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=o(d),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Dre(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new $re(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var h=arguments.length,m=new Array(h>1?h-1:0),x=1;x1?h-1:0),x=1;x{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Zf),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const u=uu(),i=()=>{const d=(p,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(f),r(p,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zf;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(i=>{i!=="cimode"&&o.indexOf(i)<0&&o.push(i)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(c=>a(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const s=uu();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Zf),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&XI.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=uu();this.emit("languageChanging",t);const o=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},c=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const i=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(i)),this.loadResources(i,d=>{a(d,i)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),s}getFixedT(t,n,r){var s=this;const o=function(a,c){let u;if(typeof c!="object"){for(var i=arguments.length,d=new Array(i>2?i-2:0),p=2;p`${u.keyPrefix}${f}${h}`):g=u.keyPrefix?`${u.keyPrefix}${f}${a}`:a,s.t(g,u)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(c,u)=>{const i=this.services.backendConnector.state[`${c}|${u}`];return i===-1||i===0||i===2};if(n.precheck){const c=n.precheck(this,a);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!s||a(o,t)))}loadNamespaces(t,n){const r=uu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=uu();typeof t=="string"&&(t=[t]);const s=this.options.preload||[],o=t.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new xE(CE());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Ad(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zf;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Ad(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new yE(this.store.data,s),o.services.resourceStore=o.store),o.translator=new Og(o.services,s),o.translator.on("*",function(c){for(var u=arguments.length,i=new Array(u>1?u-1:0),d=1;d{throw TypeError(e)};var FA=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Am=(e,t,n)=>t.has(e)||J0("Cannot "+n);var M=(e,t,n)=>(Am(e,t,"read from private field"),n?n.call(e):t.get(e)),Le=(e,t,n)=>t.has(e)?J0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Se=(e,t,n,r)=>(Am(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),et=(e,t,n)=>(Am(e,t,"access private method"),n);var Nf=(e,t,n,r)=>({set _(s){Se(e,t,s,n)},get _(){return M(e,t,r)}});var $le=FA((bo,xo)=>{function VE(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function vx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var HE={exports:{}},ig={},qE={exports:{}},it={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var sf=Symbol.for("react.element"),LA=Symbol.for("react.portal"),$A=Symbol.for("react.fragment"),BA=Symbol.for("react.strict_mode"),zA=Symbol.for("react.profiler"),UA=Symbol.for("react.provider"),VA=Symbol.for("react.context"),HA=Symbol.for("react.forward_ref"),qA=Symbol.for("react.suspense"),KA=Symbol.for("react.memo"),WA=Symbol.for("react.lazy"),Q0=Symbol.iterator;function GA(e){return e===null||typeof e!="object"?null:(e=Q0&&e[Q0]||e["@@iterator"],typeof e=="function"?e:null)}var KE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},WE=Object.assign,GE={};function Oc(e,t,n){this.props=e,this.context=t,this.refs=GE,this.updater=n||KE}Oc.prototype.isReactComponent={};Oc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Oc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JE(){}JE.prototype=Oc.prototype;function yx(e,t,n){this.props=e,this.context=t,this.refs=GE,this.updater=n||KE}var bx=yx.prototype=new JE;bx.constructor=yx;WE(bx,Oc.prototype);bx.isPureReactComponent=!0;var Z0=Array.isArray,QE=Object.prototype.hasOwnProperty,xx={current:null},ZE={key:!0,ref:!0,__self:!0,__source:!0};function YE(e,t,n){var r,s={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)QE.call(t,r)&&!ZE.hasOwnProperty(r)&&(s[r]=t[r]);var c=arguments.length-2;if(c===1)s.children=n;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hc=typeof window>"u"||"Deno"in globalThis;function $r(){}function oF(e,t){return typeof e=="function"?e(t):e}function cy(e){return typeof e=="number"&&e>=0&&e!==1/0}function tj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ul(e,t){return typeof e=="function"?e(t):e}function is(e,t){return typeof e=="function"?e(t):e}function X0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:c}=e;if(a){if(r){if(t.queryHash!==Sx(a,t.options))return!1}else if(!sd(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||o&&!o(t))}function eS(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Oi(t.options.mutationKey)!==Oi(o))return!1}else if(!sd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Sx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Oi)(e)}function Oi(e){return JSON.stringify(e,(t,n)=>uy(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function sd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!sd(e[n],t[n])):!1}function nj(e,t){if(e===t)return e;const n=tS(e)&&tS(t);if(n||uy(e)&&uy(t)){const r=n?e:Object.keys(e),s=r.length,o=n?t:Object.keys(t),a=o.length,c=n?[]:{};let u=0;for(let l=0;l{setTimeout(t,e)})}function dy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nj(e,t):t}function iF(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lF(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rj=Symbol();function sj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===rj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var vi,aa,tc,OE,cF=(OE=class extends Ic{constructor(){super();Le(this,vi);Le(this,aa);Le(this,tc);Se(this,tc,t=>{if(!hc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,aa)||this.setEventListener(M(this,tc))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,aa))==null||t.call(this),Se(this,aa,void 0))}setEventListener(t){var n;Se(this,tc,t),(n=M(this,aa))==null||n.call(this),Se(this,aa,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){M(this,vi)!==t&&(Se(this,vi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,vi)=="boolean"?M(this,vi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},vi=new WeakMap,aa=new WeakMap,tc=new WeakMap,OE),Cx=new cF,nc,ia,rc,IE,uF=(IE=class extends Ic{constructor(){super();Le(this,nc,!0);Le(this,ia);Le(this,rc);Se(this,rc,t=>{if(!hc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){M(this,ia)||this.setEventListener(M(this,rc))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,ia))==null||t.call(this),Se(this,ia,void 0))}setEventListener(t){var n;Se(this,rc,t),(n=M(this,ia))==null||n.call(this),Se(this,ia,t(this.setOnline.bind(this)))}setOnline(t){M(this,nc)!==t&&(Se(this,nc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return M(this,nc)}},nc=new WeakMap,ia=new WeakMap,rc=new WeakMap,IE),Yp=new uF;function dF(e){return Math.min(1e3*2**e,3e4)}function oj(e){return(e??"online")==="online"?Yp.isOnline():!0}var aj=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Lm(e){return e instanceof aj}function ij(e){let t=!1,n=0,r=!1,s,o,a;const c=new Promise((b,y)=>{o=b,a=y}),u=b=>{var y;r||(g(new aj(b)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},d=()=>{t=!1},p=()=>Cx.isFocused()&&(e.networkMode==="always"||Yp.isOnline())&&e.canRun(),f=()=>oj(e.networkMode)&&e.canRun(),h=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),s==null||s(),o(b))},g=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),s==null||s(),a(b))},m=()=>new Promise(b=>{var y;s=w=>{(r||p())&&b(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;s=void 0,r||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(h).catch(w=>{var E;if(r)return;const S=e.retry??(hc?0:3),k=e.retryDelay??dF,C=typeof k=="function"?k(n,w):k,T=S===!0||typeof S=="number"&&np()?void 0:m()).then(()=>{t?g(w):x()})})};return{promise:c,cancel:u,continue:()=>(s==null||s(),c),cancelRetry:l,continueRetry:d,canStart:f,start:()=>(f()?x():m().then(x),c)}}function fF(){let e=[],t=0,n=f=>{f()},r=f=>{f()},s=f=>setTimeout(f,0);const o=f=>{s=f},a=f=>{let h;t++;try{h=f()}finally{t--,t||l()}return h},c=f=>{t?e.push(f):s(()=>{n(f)})},u=f=>(...h)=>{c(()=>{f(...h)})},l=()=>{const f=e;e=[],f.length&&s(()=>{r(()=>{f.forEach(h=>{n(h)})})})};return{batch:a,batchCalls:u,schedule:c,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:o}}var hn=fF(),yi,DE,lj=(DE=class{constructor(){Le(this,yi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cy(this.gcTime)&&Se(this,yi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hc?1/0:5*60*1e3))}clearGcTimeout(){M(this,yi)&&(clearTimeout(M(this,yi)),Se(this,yi,void 0))}},yi=new WeakMap,DE),sc,oc,Lr,$n,ef,bi,rs,io,AE,pF=(AE=class extends lj{constructor(t){super();Le(this,rs);Le(this,sc);Le(this,oc);Le(this,Lr);Le(this,$n);Le(this,ef);Le(this,bi);Se(this,bi,!1),Se(this,ef,t.defaultOptions),this.setOptions(t.options),this.observers=[],Se(this,Lr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Se(this,sc,hF(this.options)),this.state=t.state??M(this,sc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,$n))==null?void 0:t.promise}setOptions(t){this.options={...M(this,ef),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,Lr).remove(this)}setData(t,n){const r=dy(this.state.data,t,this.options);return et(this,rs,io).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){et(this,rs,io).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=M(this,$n))==null?void 0:r.promise;return(s=M(this,$n))==null||s.cancel(t),n?n.then($r).catch($r):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,sc))}isActive(){return this.observers.some(t=>is(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!tj(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,$n))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,$n))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,Lr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,$n)&&(M(this,bi)?M(this,$n).cancel({revert:!0}):M(this,$n).cancelRetry()),this.scheduleGc()),M(this,Lr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||et(this,rs,io).call(this,{type:"invalidate"})}fetch(t,n){var u,l,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,$n))return M(this,$n).continueRetry(),M(this,$n).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(f=>f.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Se(this,bi,!0),r.signal)})},o=()=>{const p=sj(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return s(f),Se(this,bi,!1),this.options.persister?this.options.persister(p,f,this):p(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(u=this.options.behavior)==null||u.onFetch(a,this),Se(this,oc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&et(this,rs,io).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const c=p=>{var f,h,g,m;Lm(p)&&p.silent||et(this,rs,io).call(this,{type:"error",error:p}),Lm(p)||((h=(f=M(this,Lr).config).onError)==null||h.call(f,p,this),(m=(g=M(this,Lr).config).onSettled)==null||m.call(g,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Se(this,$n,ij({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var f,h,g,m;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(h=(f=M(this,Lr).config).onSuccess)==null||h.call(f,p,this),(m=(g=M(this,Lr).config).onSettled)==null||m.call(g,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(p,f)=>{et(this,rs,io).call(this,{type:"failed",failureCount:p,error:f})},onPause:()=>{et(this,rs,io).call(this,{type:"pause"})},onContinue:()=>{et(this,rs,io).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),M(this,$n).start()}},sc=new WeakMap,oc=new WeakMap,Lr=new WeakMap,$n=new WeakMap,ef=new WeakMap,bi=new WeakMap,rs=new WeakSet,io=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cj(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Lm(s)&&s.revert&&M(this,oc)?{...M(this,oc),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),hn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),M(this,Lr).notify({query:this,type:"updated",action:t})})},AE);function cj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hF(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ps,FE,gF=(FE=class extends Ic{constructor(t={}){super();Le(this,Ps);this.config=t,Se(this,Ps,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Sx(s,n);let a=this.get(o);return a||(a=new pF({cache:this,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){M(this,Ps).has(t.queryHash)||(M(this,Ps).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,Ps).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,Ps).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){hn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,Ps).get(t)}getAll(){return[...M(this,Ps).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>X0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>X0(t,r)):n}notify(t){hn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){hn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){hn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ps=new WeakMap,FE),Os,Hn,xi,Is,Zo,LE,mF=(LE=class extends lj{constructor(t){super();Le(this,Is);Le(this,Os);Le(this,Hn);Le(this,xi);this.mutationId=t.mutationId,Se(this,Hn,t.mutationCache),Se(this,Os,[]),this.state=t.state||uj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,Os).includes(t)||(M(this,Os).push(t),this.clearGcTimeout(),M(this,Hn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Se(this,Os,M(this,Os).filter(n=>n!==t)),this.scheduleGc(),M(this,Hn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,Os).length||(this.state.status==="pending"?this.scheduleGc():M(this,Hn).remove(this))}continue(){var t;return((t=M(this,xi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,a,c,u,l,d,p,f,h,g,m,x,b,y,w,S,k,C,T;Se(this,xi,ij({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{et(this,Is,Zo).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{et(this,Is,Zo).call(this,{type:"pause"})},onContinue:()=>{et(this,Is,Zo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,Hn).canRun(this)}));const n=this.state.status==="pending",r=!M(this,xi).canStart();try{if(!n){et(this,Is,Zo).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(s=M(this,Hn).config).onMutate)==null?void 0:o.call(s,t,this));const N=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t));N!==this.state.context&&et(this,Is,Zo).call(this,{type:"pending",context:N,variables:t,isPaused:r})}const E=await M(this,xi).start();return await((l=(u=M(this,Hn).config).onSuccess)==null?void 0:l.call(u,E,t,this.state.context,this)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,E,t,this.state.context)),await((h=(f=M(this,Hn).config).onSettled)==null?void 0:h.call(f,E,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,E,null,t,this.state.context)),et(this,Is,Zo).call(this,{type:"success",data:E}),E}catch(E){try{throw await((b=(x=M(this,Hn).config).onError)==null?void 0:b.call(x,E,t,this.state.context,this)),await((w=(y=this.options).onError)==null?void 0:w.call(y,E,t,this.state.context)),await((k=(S=M(this,Hn).config).onSettled)==null?void 0:k.call(S,void 0,E,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,E,t,this.state.context)),E}finally{et(this,Is,Zo).call(this,{type:"error",error:E})}}finally{M(this,Hn).runNext(this)}}},Os=new WeakMap,Hn=new WeakMap,xi=new WeakMap,Is=new WeakSet,Zo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),hn.batch(()=>{M(this,Os).forEach(r=>{r.onMutationUpdate(t)}),M(this,Hn).notify({mutation:this,type:"updated",action:t})})},LE);function uj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mr,tf,$E,vF=($E=class extends Ic{constructor(t={}){super();Le(this,mr);Le(this,tf);this.config=t,Se(this,mr,new Map),Se(this,tf,Date.now())}build(t,n,r){const s=new mF({mutationCache:this,mutationId:++Nf(this,tf)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=Mf(t),r=M(this,mr).get(n)??[];r.push(t),M(this,mr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Mf(t);if(M(this,mr).has(n)){const s=(r=M(this,mr).get(n))==null?void 0:r.filter(o=>o!==t);s&&(s.length===0?M(this,mr).delete(n):M(this,mr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=M(this,mr).get(Mf(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=M(this,mr).get(Mf(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){hn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...M(this,mr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eS(n,r))}findAll(t={}){return this.getAll().filter(n=>eS(t,n))}notify(t){hn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return hn.batch(()=>Promise.all(t.map(n=>n.continue().catch($r))))}},mr=new WeakMap,tf=new WeakMap,$E);function Mf(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function yF(e){return{onFetch:(t,n)=>{const r=async()=>{var g,m,x,b,y;const s=t.options,o=(x=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:x.direction,a=((b=t.state.data)==null?void 0:b.pages)||[],c=((y=t.state.data)==null?void 0:y.pageParams)||[],u={pages:[],pageParams:[]};let l=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},p=sj(t.options,t.fetchOptions),f=async(w,S,k)=>{if(l)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};d(C);const T=await p(C),{maxPages:E}=t.options,N=k?lF:iF;return{pages:N(w.pages,T,E),pageParams:N(w.pageParams,S,E)}};let h;if(o&&a.length){const w=o==="backward",S=w?bF:rS,k={pages:a,pageParams:c},C=S(s,k);h=await f(k,C,w)}else{h=await f(u,c[0]??s.initialPageParam);const w=e??a.length;for(let S=1;S{var s,o;return(o=(s=t.options).persister)==null?void 0:o.call(s,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function rS(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bF(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Yt,la,ca,ac,ic,ua,lc,cc,BE,xF=(BE=class{constructor(e={}){Le(this,Yt);Le(this,la);Le(this,ca);Le(this,ac);Le(this,ic);Le(this,ua);Le(this,lc);Le(this,cc);Se(this,Yt,e.queryCache||new gF),Se(this,la,e.mutationCache||new vF),Se(this,ca,e.defaultOptions||{}),Se(this,ac,new Map),Se(this,ic,new Map),Se(this,ua,0)}mount(){Nf(this,ua)._++,M(this,ua)===1&&(Se(this,lc,Cx.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Yt).onFocus())})),Se(this,cc,Yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Yt).onOnline())})))}unmount(){var e,t;Nf(this,ua)._--,M(this,ua)===0&&((e=M(this,lc))==null||e.call(this),Se(this,lc,void 0),(t=M(this,cc))==null||t.call(this),Se(this,cc,void 0))}isFetching(e){return M(this,Yt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,la).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Yt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=M(this,Yt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ul(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return M(this,Yt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=M(this,Yt).get(r.queryHash),o=s==null?void 0:s.state.data,a=oF(t,o);if(a!==void 0)return M(this,Yt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return hn.batch(()=>M(this,Yt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Yt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,Yt);hn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,Yt),r={type:"active",...e};return hn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=hn.batch(()=>M(this,Yt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then($r).catch($r)}invalidateQueries(e={},t={}){return hn.batch(()=>{if(M(this,Yt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=hn.batch(()=>M(this,Yt).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch($r)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($r)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,Yt).build(this,t);return n.isStaleByTime(Ul(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($r).catch($r)}fetchInfiniteQuery(e){return e.behavior=yF(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($r).catch($r)}resumePausedMutations(){return Yp.isOnline()?M(this,la).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Yt)}getMutationCache(){return M(this,la)}getDefaultOptions(){return M(this,ca)}setDefaultOptions(e){Se(this,ca,e)}setQueryDefaults(e,t){M(this,ac).set(Oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,ac).values()];let n={};return t.forEach(r=>{sd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){M(this,ic).set(Oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,ic).values()];let n={};return t.forEach(r=>{sd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,ca).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Sx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===rj&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,ca).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,Yt).clear(),M(this,la).clear()}},Yt=new WeakMap,la=new WeakMap,ca=new WeakMap,ac=new WeakMap,ic=new WeakMap,ua=new WeakMap,lc=new WeakMap,cc=new WeakMap,BE),rr,ut,nf,qn,wi,uc,Ds,rf,dc,fc,Si,Ci,da,pc,St,ju,fy,py,hy,gy,my,vy,yy,dj,zE,wF=(zE=class extends Ic{constructor(t,n){super();Le(this,St);Le(this,rr);Le(this,ut);Le(this,nf);Le(this,qn);Le(this,wi);Le(this,uc);Le(this,Ds);Le(this,rf);Le(this,dc);Le(this,fc);Le(this,Si);Le(this,Ci);Le(this,da);Le(this,pc,new Set);this.options=n,Se(this,rr,t),Se(this,Ds,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,ut).addObserver(this),sS(M(this,ut),this.options)?et(this,St,ju).call(this):this.updateResult(),et(this,St,gy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return by(M(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return by(M(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,et(this,St,my).call(this),et(this,St,vy).call(this),M(this,ut).removeObserver(this)}setOptions(t,n){const r=this.options,s=M(this,ut);if(this.options=M(this,rr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof is(this.options.enabled,M(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");et(this,St,yy).call(this),M(this,ut).setOptions(this.options),r._defaulted&&!Zp(this.options,r)&&M(this,rr).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,ut),observer:this});const o=this.hasListeners();o&&oS(M(this,ut),s,this.options,r)&&et(this,St,ju).call(this),this.updateResult(n),o&&(M(this,ut)!==s||is(this.options.enabled,M(this,ut))!==is(r.enabled,M(this,ut))||Ul(this.options.staleTime,M(this,ut))!==Ul(r.staleTime,M(this,ut)))&&et(this,St,fy).call(this);const a=et(this,St,py).call(this);o&&(M(this,ut)!==s||is(this.options.enabled,M(this,ut))!==is(r.enabled,M(this,ut))||a!==M(this,da))&&et(this,St,hy).call(this,a)}getOptimisticResult(t){const n=M(this,rr).getQueryCache().build(M(this,rr),t),r=this.createResult(n,t);return CF(this,r)&&(Se(this,qn,r),Se(this,uc,this.options),Se(this,wi,M(this,ut).state)),r}getCurrentResult(){return M(this,qn)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){M(this,pc).add(t)}getCurrentQuery(){return M(this,ut)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=M(this,rr).defaultQueryOptions(t),r=M(this,rr).getQueryCache().build(M(this,rr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return et(this,St,ju).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,qn)))}createResult(t,n){var T;const r=M(this,ut),s=this.options,o=M(this,qn),a=M(this,wi),c=M(this,uc),l=t!==r?t.state:M(this,nf),{state:d}=t;let p={...d},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),N=!E&&sS(t,n),P=E&&oS(t,r,n,s);(N||P)&&(p={...p,...cj(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:x}=p;if(n.select&&p.data!==void 0)if(o&&p.data===(a==null?void 0:a.data)&&n.select===M(this,rf))h=M(this,dc);else try{Se(this,rf,n.select),h=n.select(p.data),h=dy(o==null?void 0:o.data,h,n),Se(this,dc,h),Se(this,Ds,null)}catch(E){Se(this,Ds,E)}else h=p.data;if(n.placeholderData!==void 0&&h===void 0&&x==="pending"){let E;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData))E=o.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((T=M(this,fc))==null?void 0:T.state.data,M(this,fc)):n.placeholderData,n.select&&E!==void 0)try{E=n.select(E),Se(this,Ds,null)}catch(N){Se(this,Ds,N)}E!==void 0&&(x="success",h=dy(o==null?void 0:o.data,E,n),f=!0)}M(this,Ds)&&(g=M(this,Ds),h=M(this,dc),m=Date.now(),x="error");const b=p.fetchStatus==="fetching",y=x==="pending",w=x==="error",S=y&&b,k=h!==void 0;return{status:x,fetchStatus:p.fetchStatus,isPending:y,isSuccess:x==="success",isError:w,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:p.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>l.dataUpdateCount||p.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:w&&!k,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&k,isStale:kx(t,n),refetch:this.refetch}}updateResult(t){const n=M(this,qn),r=this.createResult(M(this,ut),this.options);if(Se(this,wi,M(this,ut).state),Se(this,uc,this.options),M(this,wi).data!==void 0&&Se(this,fc,M(this,ut)),Zp(r,n))return;Se(this,qn,r);const s={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,c=typeof a=="function"?a():a;if(c==="all"||!c&&!M(this,pc).size)return!0;const u=new Set(c??M(this,pc));return this.options.throwOnError&&u.add("error"),Object.keys(M(this,qn)).some(l=>{const d=l;return M(this,qn)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(s.listeners=!0),et(this,St,dj).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&et(this,St,gy).call(this)}},rr=new WeakMap,ut=new WeakMap,nf=new WeakMap,qn=new WeakMap,wi=new WeakMap,uc=new WeakMap,Ds=new WeakMap,rf=new WeakMap,dc=new WeakMap,fc=new WeakMap,Si=new WeakMap,Ci=new WeakMap,da=new WeakMap,pc=new WeakMap,St=new WeakSet,ju=function(t){et(this,St,yy).call(this);let n=M(this,ut).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($r)),n},fy=function(){et(this,St,my).call(this);const t=Ul(this.options.staleTime,M(this,ut));if(hc||M(this,qn).isStale||!cy(t))return;const r=tj(M(this,qn).dataUpdatedAt,t)+1;Se(this,Si,setTimeout(()=>{M(this,qn).isStale||this.updateResult()},r))},py=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,ut)):this.options.refetchInterval)??!1},hy=function(t){et(this,St,vy).call(this),Se(this,da,t),!(hc||is(this.options.enabled,M(this,ut))===!1||!cy(M(this,da))||M(this,da)===0)&&Se(this,Ci,setInterval(()=>{(this.options.refetchIntervalInBackground||Cx.isFocused())&&et(this,St,ju).call(this)},M(this,da)))},gy=function(){et(this,St,fy).call(this),et(this,St,hy).call(this,et(this,St,py).call(this))},my=function(){M(this,Si)&&(clearTimeout(M(this,Si)),Se(this,Si,void 0))},vy=function(){M(this,Ci)&&(clearInterval(M(this,Ci)),Se(this,Ci,void 0))},yy=function(){const t=M(this,rr).getQueryCache().build(M(this,rr),this.options);if(t===M(this,ut))return;const n=M(this,ut);Se(this,ut,t),Se(this,nf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},dj=function(t){hn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(M(this,qn))}),M(this,rr).getQueryCache().notify({query:M(this,ut),type:"observerResultsUpdated"})})},zE);function SF(e,t){return is(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sS(e,t){return SF(e,t)||e.state.data!==void 0&&by(e,t,t.refetchOnMount)}function by(e,t,n){if(is(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&kx(e,t)}return!1}function oS(e,t,n,r){return(e!==t||is(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kx(e,n)}function kx(e,t){return is(t.enabled,e)!==!1&&e.isStaleByTime(Ul(t.staleTime,e))}function CF(e,t){return!Zp(e.getCurrentResult(),t)}var fa,pa,sr,ho,Co,xp,xy,UE,kF=(UE=class extends Ic{constructor(n,r){super();Le(this,Co);Le(this,fa);Le(this,pa);Le(this,sr);Le(this,ho);Se(this,fa,n),this.setOptions(r),this.bindMethods(),et(this,Co,xp).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=M(this,fa).defaultMutationOptions(n),Zp(this.options,r)||M(this,fa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,sr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Oi(r.mutationKey)!==Oi(this.options.mutationKey)?this.reset():((s=M(this,sr))==null?void 0:s.state.status)==="pending"&&M(this,sr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=M(this,sr))==null||n.removeObserver(this)}onMutationUpdate(n){et(this,Co,xp).call(this),et(this,Co,xy).call(this,n)}getCurrentResult(){return M(this,pa)}reset(){var n;(n=M(this,sr))==null||n.removeObserver(this),Se(this,sr,void 0),et(this,Co,xp).call(this),et(this,Co,xy).call(this)}mutate(n,r){var s;return Se(this,ho,r),(s=M(this,sr))==null||s.removeObserver(this),Se(this,sr,M(this,fa).getMutationCache().build(M(this,fa),this.options)),M(this,sr).addObserver(this),M(this,sr).execute(n)}},fa=new WeakMap,pa=new WeakMap,sr=new WeakMap,ho=new WeakMap,Co=new WeakSet,xp=function(){var r;const n=((r=M(this,sr))==null?void 0:r.state)??uj();Se(this,pa,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},xy=function(n){hn.batch(()=>{var r,s,o,a,c,u,l,d;if(M(this,ho)&&this.hasListeners()){const p=M(this,pa).variables,f=M(this,pa).context;(n==null?void 0:n.type)==="success"?((s=(r=M(this,ho)).onSuccess)==null||s.call(r,n.data,p,f),(a=(o=M(this,ho)).onSettled)==null||a.call(o,n.data,null,p,f)):(n==null?void 0:n.type)==="error"&&((u=(c=M(this,ho)).onError)==null||u.call(c,n.error,p,f),(d=(l=M(this,ho)).onSettled)==null||d.call(l,void 0,n.error,p,f))}this.listeners.forEach(p=>{p(M(this,pa))})})},UE),fj=v.createContext(void 0),Ex=e=>{const t=v.useContext(fj);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pj=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(fj.Provider,{value:e,children:t})),hj=v.createContext(!1),EF=()=>v.useContext(hj);hj.Provider;function jF(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var TF=v.createContext(jF()),NF=()=>v.useContext(TF);function gj(e,t){return typeof e=="function"?e(...t):!!e}function _F(){}var MF=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},RF=e=>{v.useEffect(()=>{e.clearReset()},[e])},PF=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&gj(n,[e.error,r]),OF=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},IF=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,DF=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function AF(e,t,n){var l,d,p,f;const r=Ex(),s=EF(),o=NF(),a=r.defaultQueryOptions(e);(d=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_beforeQuery)==null||d.call(l,a),a._optimisticResults=s?"isRestoring":"optimistic",OF(a),MF(a,o),RF(o);const[c]=v.useState(()=>new t(r,a)),u=c.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(h=>{const g=s?()=>{}:c.subscribe(hn.batchCalls(h));return c.updateResult(),g},[c,s]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),IF(a,u))throw DF(a,c,o);if(PF({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw u.error;return(f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||f.call(p,a,u),a.notifyOnChangeProps?u:c.trackResult(u)}function We(e,t){return AF(e,wF)}function FF(e,t){const n=Ex(),[r]=v.useState(()=>new kF(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const s=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(hn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,c)=>{r.mutate(a,c).catch(_F)},[r]);if(s.error&&gj(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}var wy={},mj={exports:{}},_r={},vj={exports:{}},yj={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(A,D){var X=A.length;A.push(D);e:for(;0>>1,H=A[se];if(0>>1;ses(ne,X))res(W,ne)?(A[se]=W,A[re]=X,se=re):(A[se]=ne,A[Q]=X,se=Q);else if(res(W,X))A[se]=W,A[re]=X,se=re;else break e}}return D}function s(A,D){var X=A.sortIndex-D.sortIndex;return X!==0?X:A.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],l=[],d=1,p=null,f=3,h=!1,g=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(A){for(var D=n(l);D!==null;){if(D.callback===null)r(l);else if(D.startTime<=A)r(l),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(l)}}function S(A){if(m=!1,w(A),!g)if(n(u)!==null)g=!0,K(k);else{var D=n(l);D!==null&&V(S,D.startTime-A)}}function k(A,D){g=!1,m&&(m=!1,b(E),E=-1),h=!0;var X=f;try{for(w(D),p=n(u);p!==null&&(!(p.expirationTime>D)||A&&!q());){var se=p.callback;if(typeof se=="function"){p.callback=null,f=p.priorityLevel;var H=se(p.expirationTime<=D);D=e.unstable_now(),typeof H=="function"?p.callback=H:p===n(u)&&r(u),w(D)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var Q=n(l);Q!==null&&V(S,Q.startTime-D),oe=!1}return oe}finally{p=null,f=X,h=!1}}var C=!1,T=null,E=-1,N=5,P=-1;function q(){return!(e.unstable_now()-PA||125se?(A.sortIndex=X,t(l,A),n(u)===null&&A===n(l)&&(m?(b(E),E=-1):m=!0,V(S,X-se))):(A.sortIndex=H,t(u,A),g||h||(g=!0,K(k))),A},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(A){var D=f;return function(){var X=f;f=D;try{return A.apply(this,arguments)}finally{f=X}}}})(yj);vj.exports=yj;var LF=vj.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $F=v,Tr=LF;function ae(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sy=Object.prototype.hasOwnProperty,BF=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,aS={},iS={};function zF(e){return Sy.call(iS,e)?!0:Sy.call(aS,e)?!1:BF.test(e)?iS[e]=!0:(aS[e]=!0,!1)}function UF(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function VF(e,t,n,r){if(t===null||typeof t>"u"||UF(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xn(e,t,n,r,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rn[e]=new Xn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rn[t]=new Xn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rn[e]=new Xn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rn[e]=new Xn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Rn[e]=new Xn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rn[e]=new Xn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rn[e]=new Xn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rn[e]=new Xn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rn[e]=new Xn(e,5,!1,e.toLowerCase(),null,!1,!1)});var jx=/[\-:]([a-z])/g;function Tx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(jx,Tx);Rn[t]=new Xn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(jx,Tx);Rn[t]=new Xn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(jx,Tx);Rn[t]=new Xn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rn[e]=new Xn(e,1,!1,e.toLowerCase(),null,!1,!1)});Rn.xlinkHref=new Xn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rn[e]=new Xn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nx(e,t,n,r){var s=Rn.hasOwnProperty(t)?Rn[t]:null;(s!==null?s.type!==0:r||!(2c||s[a]!==o[c]){var u=` +`+s[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=c);break}}}finally{Bm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tu(e):""}function HF(e){switch(e.tag){case 5:return Tu(e.type);case 16:return Tu("Lazy");case 13:return Tu("Suspense");case 19:return Tu("SuspenseList");case 0:case 2:case 15:return e=zm(e.type,!1),e;case 11:return e=zm(e.type.render,!1),e;case 1:return e=zm(e.type,!0),e;default:return""}}function jy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tl:return"Fragment";case jl:return"Portal";case Cy:return"Profiler";case _x:return"StrictMode";case ky:return"Suspense";case Ey:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wj:return(e.displayName||"Context")+".Consumer";case xj:return(e._context.displayName||"Context")+".Provider";case Mx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rx:return t=e.displayName||null,t!==null?t:jy(e.type)||"Memo";case ea:t=e._payload,e=e._init;try{return jy(e(t))}catch{}}return null}function qF(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jy(t);case 8:return t===_x?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ta(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function KF(e){var t=Cj(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pf(e){e._valueTracker||(e._valueTracker=KF(e))}function kj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Cj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ty(e,t){var n=t.checked;return Jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function cS(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ta(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ej(e,t){t=t.checked,t!=null&&Nx(e,"checked",t,!1)}function Ny(e,t){Ej(e,t);var n=Ta(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_y(e,t.type,n):t.hasOwnProperty("defaultValue")&&_y(e,t.type,Ta(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uS(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function _y(e,t,n){(t!=="number"||Xp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nu=Array.isArray;function Vl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Of.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ad(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},WF=["Webkit","ms","Moz","O"];Object.keys(Bu).forEach(function(e){WF.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bu[t]=Bu[e]})});function _j(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bu.hasOwnProperty(e)&&Bu[e]?(""+t).trim():t+"px"}function Mj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=_j(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var GF=Jt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Py(e,t){if(t){if(GF[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ae(62))}}function Oy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Iy=null;function Px(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dy=null,Hl=null,ql=null;function pS(e){if(e=lf(e)){if(typeof Dy!="function")throw Error(ae(280));var t=e.stateNode;t&&(t=pg(t),Dy(e.stateNode,e.type,t))}}function Rj(e){Hl?ql?ql.push(e):ql=[e]:Hl=e}function Pj(){if(Hl){var e=Hl,t=ql;if(ql=Hl=null,pS(e),t)for(e=0;e>>=0,e===0?32:31-(o2(e)/a2|0)|0}var If=64,Df=4194304;function _u(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function rh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var c=a&~s;c!==0?r=_u(c):(o&=a,o!==0&&(r=_u(o)))}else a=n&~s,a!==0?r=_u(a):o!==0&&(r=_u(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function of(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fs(t),e[t]=n}function u2(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Uu),SS=" ",CS=!1;function Yj(e,t){switch(e){case"keyup":return L2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nl=!1;function B2(e,t){switch(e){case"compositionend":return Xj(t);case"keypress":return t.which!==32?null:(CS=!0,SS);case"textInput":return e=t.data,e===SS&&CS?null:e;default:return null}}function z2(e,t){if(Nl)return e==="compositionend"||!Bx&&Yj(e,t)?(e=Qj(),Sp=Fx=ha=null,Nl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=TS(n)}}function rT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sT(){for(var e=window,t=Xp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xp(e.document)}return t}function zx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Q2(e){var t=sT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rT(n.ownerDocument.documentElement,n)){if(r!==null&&zx(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=NS(n,o);var a=NS(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,_l=null,zy=null,Hu=null,Uy=!1;function _S(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uy||_l==null||_l!==Xp(r)||(r=_l,"selectionStart"in r&&zx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hu&&fd(Hu,r)||(Hu=r,r=ah(zy,"onSelect"),0Pl||(e.current=Gy[Pl],Gy[Pl]=null,Pl--)}function Mt(e,t){Pl++,Gy[Pl]=e.current,e.current=t}var Na={},zn=Ba(Na),lr=Ba(!1),Ii=Na;function mc(e,t){var n=e.type.contextTypes;if(!n)return Na;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function cr(e){return e=e.childContextTypes,e!=null}function lh(){Ft(lr),Ft(zn)}function AS(e,t,n){if(zn.current!==Na)throw Error(ae(168));Mt(zn,t),Mt(lr,n)}function pT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ae(108,qF(e)||"Unknown",s));return Jt({},n,r)}function ch(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Na,Ii=zn.current,Mt(zn,e),Mt(lr,lr.current),!0}function FS(e,t,n){var r=e.stateNode;if(!r)throw Error(ae(169));n?(e=pT(e,t,Ii),r.__reactInternalMemoizedMergedChildContext=e,Ft(lr),Ft(zn),Mt(zn,e)):Ft(lr),Mt(lr,n)}var po=null,hg=!1,tv=!1;function hT(e){po===null?po=[e]:po.push(e)}function lL(e){hg=!0,hT(e)}function za(){if(!tv&&po!==null){tv=!0;var e=0,t=kt;try{var n=po;for(kt=1;e>=a,s-=a,mo=1<<32-fs(t)+s|n<E?(N=T,T=null):N=T.sibling;var P=f(b,T,w[E],S);if(P===null){T===null&&(T=N);break}e&&T&&P.alternate===null&&t(b,T),y=o(P,y,E),C===null?k=P:C.sibling=P,C=P,T=N}if(E===w.length)return n(b,T),Vt&&ni(b,E),k;if(T===null){for(;EE?(N=T,T=null):N=T.sibling;var q=f(b,T,P.value,S);if(q===null){T===null&&(T=N);break}e&&T&&q.alternate===null&&t(b,T),y=o(q,y,E),C===null?k=q:C.sibling=q,C=q,T=N}if(P.done)return n(b,T),Vt&&ni(b,E),k;if(T===null){for(;!P.done;E++,P=w.next())P=p(b,P.value,S),P!==null&&(y=o(P,y,E),C===null?k=P:C.sibling=P,C=P);return Vt&&ni(b,E),k}for(T=r(b,T);!P.done;E++,P=w.next())P=h(T,b,E,P.value,S),P!==null&&(e&&P.alternate!==null&&T.delete(P.key===null?E:P.key),y=o(P,y,E),C===null?k=P:C.sibling=P,C=P);return e&&T.forEach(function(O){return t(b,O)}),Vt&&ni(b,E),k}function x(b,y,w,S){if(typeof w=="object"&&w!==null&&w.type===Tl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Rf:e:{for(var k=w.key,C=y;C!==null;){if(C.key===k){if(k=w.type,k===Tl){if(C.tag===7){n(b,C.sibling),y=s(C,w.props.children),y.return=b,b=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ea&&BS(k)===C.type){n(b,C.sibling),y=s(C,w.props),y.ref=lu(b,C,w),y.return=b,b=y;break e}n(b,C);break}else t(b,C);C=C.sibling}w.type===Tl?(y=Ei(w.props.children,b.mode,S,w.key),y.return=b,b=y):(S=Mp(w.type,w.key,w.props,null,b.mode,S),S.ref=lu(b,y,w),S.return=b,b=S)}return a(b);case jl:e:{for(C=w.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(b,y.sibling),y=s(y,w.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=cv(w,b.mode,S),y.return=b,b=y}return a(b);case ea:return C=w._init,x(b,y,C(w._payload),S)}if(Nu(w))return g(b,y,w,S);if(ru(w))return m(b,y,w,S);Uf(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(b,y.sibling),y=s(y,w),y.return=b,b=y):(n(b,y),y=lv(w,b.mode,S),y.return=b,b=y),a(b)):n(b,y)}return x}var yc=yT(!0),bT=yT(!1),fh=Ba(null),ph=null,Dl=null,qx=null;function Kx(){qx=Dl=ph=null}function Wx(e){var t=fh.current;Ft(fh),e._currentValue=t}function Zy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Wl(e,t){ph=e,qx=Dl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ir=!0),e.firstContext=null)}function Jr(e){var t=e._currentValue;if(qx!==e)if(e={context:e,memoizedValue:t,next:null},Dl===null){if(ph===null)throw Error(ae(308));Dl=e,ph.dependencies={lanes:0,firstContext:e}}else Dl=Dl.next=e;return t}var ii=null;function Gx(e){ii===null?ii=[e]:ii.push(e)}function xT(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Gx(t)):(n.next=s.next,s.next=n),t.interleaved=n,jo(e,r)}function jo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ta=!1;function Jx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wT(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,gt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,jo(e,n)}return s=r.interleaved,s===null?(t.next=t,Gx(r)):(t.next=s.next,s.next=t),r.interleaved=t,jo(e,n)}function kp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ix(e,n)}}function zS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hh(e,t,n,r){var s=e.updateQueue;ta=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,c=s.shared.pending;if(c!==null){s.shared.pending=null;var u=c,l=u.next;u.next=null,a===null?o=l:a.next=l,a=u;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==a&&(c===null?d.firstBaseUpdate=l:c.next=l,d.lastBaseUpdate=u))}if(o!==null){var p=s.baseState;a=0,d=l=u=null,c=o;do{var f=c.lane,h=c.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:h,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var g=e,m=c;switch(f=t,h=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){p=g.call(h,p,f);break e}p=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(h,p,f):g,f==null)break e;p=Jt({},p,f);break e;case 2:ta=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[c]:f.push(c))}else h={eventTime:h,lane:f,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(l=d=h,u=p):d=d.next=h,a|=f;if(c=c.next,c===null){if(c=s.shared.pending,c===null)break;f=c,c=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(u=p),s.baseState=u,s.firstBaseUpdate=l,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Fi|=a,e.lanes=a,e.memoizedState=p}}function US(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=rv.transition;rv.transition={};try{e(!1),t()}finally{kt=n,rv.transition=r}}function LT(){return Qr().memoizedState}function fL(e,t,n){var r=ka(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},$T(e))BT(t,n);else if(n=xT(e,t,n,r),n!==null){var s=Qn();ps(n,e,r,s),zT(n,t,r)}}function pL(e,t,n){var r=ka(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if($T(e))BT(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,c=o(a,n);if(s.hasEagerState=!0,s.eagerState=c,bs(c,a)){var u=t.interleaved;u===null?(s.next=s,Gx(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=xT(e,t,s,r),n!==null&&(s=Qn(),ps(n,e,r,s),zT(n,t,r))}}function $T(e){var t=e.alternate;return e===Gt||t!==null&&t===Gt}function BT(e,t){qu=mh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ix(e,n)}}var vh={readContext:Jr,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useInsertionEffect:Dn,useLayoutEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useMutableSource:Dn,useSyncExternalStore:Dn,useId:Dn,unstable_isNewReconciler:!1},hL={readContext:Jr,useCallback:function(e,t){return Rs().memoizedState=[e,t===void 0?null:t],e},useContext:Jr,useEffect:HS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,jp(4194308,4,OT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return jp(4194308,4,e,t)},useInsertionEffect:function(e,t){return jp(4,2,e,t)},useMemo:function(e,t){var n=Rs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Rs();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fL.bind(null,Gt,e),[r.memoizedState,e]},useRef:function(e){var t=Rs();return e={current:e},t.memoizedState=e},useState:VS,useDebugValue:rw,useDeferredValue:function(e){return Rs().memoizedState=e},useTransition:function(){var e=VS(!1),t=e[0];return e=dL.bind(null,e[1]),Rs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Gt,s=Rs();if(Vt){if(n===void 0)throw Error(ae(407));n=n()}else{if(n=t(),Sn===null)throw Error(ae(349));Ai&30||ET(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,HS(TT.bind(null,r,o,e),[e]),r.flags|=2048,xd(9,jT.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Rs(),t=Sn.identifierPrefix;if(Vt){var n=vo,r=mo;n=(r&~(1<<32-fs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=yd++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[As]=t,e[gd]=r,ZT(e,t,!1,!1),t.stateNode=e;e:{switch(a=Oy(n,r),n){case"dialog":Dt("cancel",e),Dt("close",e),s=r;break;case"iframe":case"object":case"embed":Dt("load",e),s=r;break;case"video":case"audio":for(s=0;swc&&(t.flags|=128,r=!0,cu(o,!1),t.lanes=4194304)}else{if(!r)if(e=gh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cu(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Vt)return An(t),null}else 2*nn()-o.renderingStartTime>wc&&n!==1073741824&&(t.flags|=128,r=!0,cu(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=nn(),t.sibling=null,n=Wt.current,Mt(Wt,r?n&1|2:n&1),t):(An(t),null);case 22:case 23:return cw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?yr&1073741824&&(An(t),t.subtreeFlags&6&&(t.flags|=8192)):An(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function SL(e,t){switch(Vx(t),t.tag){case 1:return cr(t.type)&&lh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bc(),Ft(lr),Ft(zn),Yx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zx(t),null;case 13:if(Ft(Wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));vc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ft(Wt),null;case 4:return bc(),null;case 10:return Wx(t.type._context),null;case 22:case 23:return cw(),null;case 24:return null;default:return null}}var Hf=!1,Bn=!1,CL=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Al(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xt(e,t,r)}else n.current=null}function ab(e,t,n){try{n()}catch(r){Xt(e,t,r)}}var tC=!1;function kL(e,t){if(Vy=sh,e=sT(),zx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,c=-1,u=-1,l=0,d=0,p=e,f=null;t:for(;;){for(var h;p!==n||s!==0&&p.nodeType!==3||(c=a+s),p!==o||r!==0&&p.nodeType!==3||(u=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(h=p.firstChild)!==null;)f=p,p=h;for(;;){if(p===e)break t;if(f===n&&++l===s&&(c=a),f===o&&++d===r&&(u=a),(h=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=h}n=c===-1||u===-1?null:{start:c,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hy={focusedElem:e,selectionRange:n},sh=!1,Ce=t;Ce!==null;)if(t=Ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ce=e;else for(;Ce!==null;){t=Ce;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,x=g.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:ns(t.type,m),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(S){Xt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ce=e;break}Ce=t.return}return g=tC,tC=!1,g}function Ku(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&ab(t,n,o)}s=s.next}while(s!==r)}}function vg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ib(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function eN(e){var t=e.alternate;t!==null&&(e.alternate=null,eN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[As],delete t[gd],delete t[Wy],delete t[aL],delete t[iL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tN(e){return e.tag===5||e.tag===3||e.tag===4}function nC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tN(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ih));else if(r!==4&&(e=e.child,e!==null))for(lb(e,t,n),e=e.sibling;e!==null;)lb(e,t,n),e=e.sibling}function cb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cb(e,t,n),e=e.sibling;e!==null;)cb(e,t,n),e=e.sibling}var Nn=null,ss=!1;function Ko(e,t,n){for(n=n.child;n!==null;)nN(e,t,n),n=n.sibling}function nN(e,t,n){if(qs&&typeof qs.onCommitFiberUnmount=="function")try{qs.onCommitFiberUnmount(cg,n)}catch{}switch(n.tag){case 5:Bn||Al(n,t);case 6:var r=Nn,s=ss;Nn=null,Ko(e,t,n),Nn=r,ss=s,Nn!==null&&(ss?(e=Nn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nn.removeChild(n.stateNode));break;case 18:Nn!==null&&(ss?(e=Nn,n=n.stateNode,e.nodeType===8?ev(e.parentNode,n):e.nodeType===1&&ev(e,n),ud(e)):ev(Nn,n.stateNode));break;case 4:r=Nn,s=ss,Nn=n.stateNode.containerInfo,ss=!0,Ko(e,t,n),Nn=r,ss=s;break;case 0:case 11:case 14:case 15:if(!Bn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&ab(n,t,a),s=s.next}while(s!==r)}Ko(e,t,n);break;case 1:if(!Bn&&(Al(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Xt(n,t,c)}Ko(e,t,n);break;case 21:Ko(e,t,n);break;case 22:n.mode&1?(Bn=(r=Bn)||n.memoizedState!==null,Ko(e,t,n),Bn=r):Ko(e,t,n);break;default:Ko(e,t,n)}}function rC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new CL),t.forEach(function(r){var s=OL.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ts(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~o}if(r=s,r=nn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jL(r/1960))-r,10e?16:e,ga===null)var r=!1;else{if(e=ga,ga=null,xh=0,gt&6)throw Error(ae(331));var s=gt;for(gt|=4,Ce=e.current;Ce!==null;){var o=Ce,a=o.child;if(Ce.flags&16){var c=o.deletions;if(c!==null){for(var u=0;unn()-iw?ki(e,0):aw|=n),ur(e,t)}function uN(e,t){t===0&&(e.mode&1?(t=Df,Df<<=1,!(Df&130023424)&&(Df=4194304)):t=1);var n=Qn();e=jo(e,t),e!==null&&(of(e,t,n),ur(e,n))}function PL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uN(e,n)}function OL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ae(314))}r!==null&&r.delete(t),uN(e,n)}var dN;dN=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||lr.current)ir=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ir=!1,xL(e,t,n);ir=!!(e.flags&131072)}else ir=!1,Vt&&t.flags&1048576&&gT(t,dh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tp(e,t),e=t.pendingProps;var s=mc(t,zn.current);Wl(t,n),s=ew(null,t,r,e,s,n);var o=tw();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,cr(r)?(o=!0,ch(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Jx(t),s.updater=mg,t.stateNode=s,s._reactInternals=t,Xy(t,r,e,n),t=nb(null,t,r,!0,o,n)):(t.tag=0,Vt&&o&&Ux(t),Wn(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Tp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=DL(r),e=ns(r,e),s){case 0:t=tb(null,t,r,e,n);break e;case 1:t=YS(null,t,r,e,n);break e;case 11:t=QS(null,t,r,e,n);break e;case 14:t=ZS(null,t,r,ns(r.type,e),n);break e}throw Error(ae(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),tb(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),YS(e,t,r,s,n);case 3:e:{if(GT(t),e===null)throw Error(ae(387));r=t.pendingProps,o=t.memoizedState,s=o.element,wT(e,t),hh(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=xc(Error(ae(423)),t),t=XS(e,t,r,n,s);break e}else if(r!==s){s=xc(Error(ae(424)),t),t=XS(e,t,r,n,s);break e}else for(Sr=wa(t.stateNode.containerInfo.firstChild),kr=t,Vt=!0,ls=null,n=bT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vc(),r===s){t=To(e,t,n);break e}Wn(e,t,r,n)}t=t.child}return t;case 5:return ST(t),e===null&&Qy(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,qy(r,s)?a=null:o!==null&&qy(r,o)&&(t.flags|=32),WT(e,t),Wn(e,t,a,n),t.child;case 6:return e===null&&Qy(t),null;case 13:return JT(e,t,n);case 4:return Qx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yc(t,null,r,n):Wn(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),QS(e,t,r,s,n);case 7:return Wn(e,t,t.pendingProps,n),t.child;case 8:return Wn(e,t,t.pendingProps.children,n),t.child;case 12:return Wn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,Mt(fh,r._currentValue),r._currentValue=a,o!==null)if(bs(o.value,a)){if(o.children===s.children&&!lr.current){t=To(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){a=o.child;for(var u=c.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=wo(-1,n&-n),u.tag=2;var l=o.updateQueue;if(l!==null){l=l.shared;var d=l.pending;d===null?u.next=u:(u.next=d.next,d.next=u),l.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Zy(o.return,n,t),c.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ae(341));a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Zy(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Wn(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Wl(t,n),s=Jr(s),r=r(s),t.flags|=1,Wn(e,t,r,n),t.child;case 14:return r=t.type,s=ns(r,t.pendingProps),s=ns(r.type,s),ZS(e,t,r,s,n);case 15:return qT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ns(r,s),Tp(e,t),t.tag=1,cr(r)?(e=!0,ch(t)):e=!1,Wl(t,n),UT(t,r,s),Xy(t,r,s,n),nb(null,t,r,!0,e,n);case 19:return QT(e,t,n);case 22:return KT(e,t,n)}throw Error(ae(156,t.tag))};function fN(e,t){return $j(e,t)}function IL(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hr(e,t,n,r){return new IL(e,t,n,r)}function dw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function DL(e){if(typeof e=="function")return dw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mx)return 11;if(e===Rx)return 14}return 2}function Ea(e,t){var n=e.alternate;return n===null?(n=Hr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Mp(e,t,n,r,s,o){var a=2;if(r=e,typeof e=="function")dw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Tl:return Ei(n.children,s,o,t);case _x:a=8,s|=8;break;case Cy:return e=Hr(12,n,t,s|2),e.elementType=Cy,e.lanes=o,e;case ky:return e=Hr(13,n,t,s),e.elementType=ky,e.lanes=o,e;case Ey:return e=Hr(19,n,t,s),e.elementType=Ey,e.lanes=o,e;case Sj:return bg(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xj:a=10;break e;case wj:a=9;break e;case Mx:a=11;break e;case Rx:a=14;break e;case ea:a=16,r=null;break e}throw Error(ae(130,e==null?e:typeof e,""))}return t=Hr(a,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Ei(e,t,n,r){return e=Hr(7,e,r,t),e.lanes=n,e}function bg(e,t,n,r){return e=Hr(22,e,r,t),e.elementType=Sj,e.lanes=n,e.stateNode={isHidden:!1},e}function lv(e,t,n){return e=Hr(6,e,null,t),e.lanes=n,e}function cv(e,t,n){return t=Hr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function AL(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vm(0),this.expirationTimes=Vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vm(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function fw(e,t,n,r,s,o,a,c,u){return e=new AL(e,t,n,c,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Hr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jx(o),e}function FL(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mN)}catch(e){console.error(e)}}mN(),mj.exports=_r;var Ua=mj.exports;const vN=vx(Ua),UL=VE({__proto__:null,default:vN},[Ua]);var dC=Ua;wy.createRoot=dC.createRoot,wy.hydrateRoot=dC.hydrateRoot;const VL=(...e)=>{console!=null&&console.warn&&(ji(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},fC={},hb=(...e)=>{ji(e[0])&&fC[e[0]]||(ji(e[0])&&(fC[e[0]]=new Date),VL(...e))},yN=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},pC=(e,t,n)=>{e.loadNamespaces(t,yN(e,n))},hC=(e,t,n,r)=>{ji(n)&&(n=[n]),n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,yN(e,r))},HL=(e,t,n={})=>!t.languages||!t.languages.length?(hb("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),ji=e=>typeof e=="string",qL=e=>typeof e=="object"&&e!==null,KL=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,WL={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},GL=e=>WL[e],JL=e=>e.replace(KL,GL);let gb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:JL};const QL=(e={})=>{gb={...gb,...e}},ZL=()=>gb;let bN;const YL=e=>{bN=e},XL=()=>bN,e4={type:"3rdParty",init(e){QL(e.options.react),YL(e)}},xN=v.createContext();class t4{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const n4=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},wN=(e,t,n,r)=>e.getFixedT(t,n,r),r4=(e,t,n,r)=>v.useCallback(wN(e,t,n,r),[e,t,n,r]),Ee=(e,t={})=>{var S,k,C,T;const{i18n:n}=t,{i18n:r,defaultNS:s}=v.useContext(xN)||{},o=n||r||XL();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new t4),!o){hb("You will need to pass in an i18next instance by using initReactI18next");const E=(P,q)=>ji(q)?q:qL(q)&&ji(q.defaultValue)?q.defaultValue:Array.isArray(P)?P[P.length-1]:P,N=[E,{},!1];return N.t=E,N.i18n={},N.ready=!1,N}(S=o.options.react)!=null&&S.wait&&hb("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...ZL(),...o.options.react,...t},{useSuspense:c,keyPrefix:u}=a;let l=s||((k=o.options)==null?void 0:k.defaultNS);l=ji(l)?[l]:l||["translation"],(T=(C=o.reportNamespaces).addUsedNamespaces)==null||T.call(C,l);const d=(o.isInitialized||o.initializedStoreOnce)&&l.every(E=>HL(E,o,a)),p=r4(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),f=()=>p,h=()=>wN(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),[g,m]=v.useState(f);let x=l.join();t.lng&&(x=`${t.lng}${x}`);const b=n4(x),y=v.useRef(!0);v.useEffect(()=>{const{bindI18n:E,bindI18nStore:N}=a;y.current=!0,!d&&!c&&(t.lng?hC(o,t.lng,l,()=>{y.current&&m(h)}):pC(o,l,()=>{y.current&&m(h)})),d&&b&&b!==x&&y.current&&m(h);const P=()=>{y.current&&m(h)};return E&&(o==null||o.on(E,P)),N&&(o==null||o.store.on(N,P)),()=>{y.current=!1,o&&(E==null||E.split(" ").forEach(q=>o.off(q,P))),N&&o&&N.split(" ").forEach(q=>o.store.off(q,P))}},[o,x]),v.useEffect(()=>{y.current&&d&&m(f)},[o,u,d]);const w=[g,o,d];if(w.t=g,w.i18n=o,w.ready=d,d||!d&&!c)return w;throw new Promise(E=>{t.lng?hC(o,t.lng,l,()=>E()):pC(o,l,()=>E())})};function s4({i18n:e,defaultNS:t,children:n}){const r=v.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return v.createElement(xN.Provider,{value:r},n)}/** + * @remix-run/router v1.18.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Sc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function a4(){return Math.random().toString(36).substr(2,8)}function mC(e,t){return{usr:e.state,key:e.key,idx:t}}function Sd(e,t,n,r){return n===void 0&&(n=null),Kt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Va(t):t,{state:n,key:t&&t.key||r||a4()})}function $i(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Va(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function i4(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,a=s.history,c=on.Pop,u=null,l=d();l==null&&(l=0,a.replaceState(Kt({},a.state,{idx:l}),""));function d(){return(a.state||{idx:null}).idx}function p(){c=on.Pop;let x=d(),b=x==null?null:x-l;l=x,u&&u({action:c,location:m.location,delta:b})}function f(x,b){c=on.Push;let y=Sd(m.location,x,b);l=d()+1;let w=mC(y,l),S=m.createHref(y);try{a.pushState(w,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(S)}o&&u&&u({action:c,location:m.location,delta:1})}function h(x,b){c=on.Replace;let y=Sd(m.location,x,b);l=d();let w=mC(y,l),S=m.createHref(y);a.replaceState(w,"",S),o&&u&&u({action:c,location:m.location,delta:0})}function g(x){let b=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof x=="string"?x:$i(x);return y=y.replace(/ $/,"%20"),nt(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let m={get action(){return c},get location(){return e(s,a)},listen(x){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(gC,p),u=x,()=>{s.removeEventListener(gC,p),u=null}},createHref(x){return t(s,x)},createURL:g,encodeLocation(x){let b=g(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:h,go(x){return a.go(x)}};return m}var _t;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_t||(_t={}));const l4=new Set(["lazy","caseSensitive","path","id","index","children"]);function c4(e){return e.index===!0}function Cd(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,o)=>{let a=[...n,String(o)],c=typeof s.id=="string"?s.id:a.join("-");if(nt(s.index!==!0||!s.children,"Cannot specify children on an index route"),nt(!r[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),c4(s)){let u=Kt({},s,t(s),{id:c});return r[c]=u,u}else{let u=Kt({},s,t(s),{id:c,children:void 0});return r[c]=u,s.children&&(u.children=Cd(s.children,t,a,r)),u}})}function oi(e,t,n){return n===void 0&&(n="/"),Rp(e,t,n,!1)}function Rp(e,t,n,r){let s=typeof t=="string"?Va(t):t,o=Fc(s.pathname||"/",n);if(o==null)return null;let a=SN(e);d4(a);let c=null;for(let u=0;c==null&&u{let u={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(nt(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=So([r,u.relativePath]),d=n.concat(u);o.children&&o.children.length>0&&(nt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),SN(o.children,t,d,l)),!(o.path==null&&!o.index)&&t.push({path:l,score:y4(l,o.index),routesMeta:d})};return e.forEach((o,a)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))s(o,a);else for(let u of CN(o.path))s(o,a,u)}),t}function CN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let a=CN(r.join("/")),c=[];return c.push(...a.map(u=>u===""?o:[o,u].join("/"))),s&&c.push(...a),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function d4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:b4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const f4=/^:[\w-]+$/,p4=3,h4=2,g4=1,m4=10,v4=-2,vC=e=>e==="*";function y4(e,t){let n=e.split("/"),r=n.length;return n.some(vC)&&(r+=v4),t&&(r+=h4),n.filter(s=>!vC(s)).reduce((s,o)=>s+(f4.test(o)?p4:o===""?g4:m4),r)}function b4(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function x4(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},o="/",a=[];for(let c=0;c{let{paramName:f,isOptional:h}=d;if(f==="*"){let m=c[p]||"";a=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const g=c[p];return h&&!g?l[f]=void 0:l[f]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:a,pattern:e}}function w4(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Sc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function S4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Fc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function C4(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Va(e):e;return{pathname:n?n.startsWith("/")?n:k4(n,t):t,search:j4(r),hash:T4(s)}}function k4(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function uv(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kg(e,t){let n=kN(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Eg(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Va(e):(s=Kt({},e),nt(!s.pathname||!s.pathname.includes("?"),uv("?","pathname","search",s)),nt(!s.pathname||!s.pathname.includes("#"),uv("#","pathname","hash",s)),nt(!s.search||!s.search.includes("#"),uv("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,c;if(a==null)c=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),p-=1;s.pathname=f.join("/")}c=p>=0?t[p]:"/"}let u=C4(s,c),l=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||d)&&(u.pathname+="/"),u}const So=e=>e.join("/").replace(/\/\/+/g,"/"),E4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class mw{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function jg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const EN=["post","put","patch","delete"],N4=new Set(EN),_4=["get",...EN],M4=new Set(_4),R4=new Set([301,302,303,307,308]),P4=new Set([307,308]),dv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},O4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},du={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},vw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,I4=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jN="remix-router-transitions";function D4(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;nt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let R=e.detectErrorBoundary;s=I=>({hasErrorBoundary:R(I)})}else s=I4;let o={},a=Cd(e.routes,s,void 0,o),c,u=e.basename||"/",l=e.unstable_dataStrategy||B4,d=e.unstable_patchRoutesOnMiss,p=Kt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,h=new Set,g=null,m=null,x=null,b=e.hydrationData!=null,y=oi(a,e.history.location,u),w=null;if(y==null&&!d){let R=Kn(404,{pathname:e.history.location.pathname}),{matches:I,route:U}=NC(a);y=I,w={[U.id]:R}}y&&d&&!e.hydrationData&&Dm(y,a,e.history.location.pathname).active&&(y=null);let S;if(!y)S=!1,y=[];else if(y.some(R=>R.route.lazy))S=!1;else if(!y.some(R=>R.route.loader))S=!0;else if(p.v7_partialHydration){let R=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null,U=te=>te.route.loader?typeof te.route.loader=="function"&&te.route.loader.hydrate===!0?!1:R&&R[te.route.id]!==void 0||I&&I[te.route.id]!==void 0:!0;if(I){let te=y.findIndex(xe=>I[xe.route.id]!==void 0);S=y.slice(0,te+1).every(U)}else S=y.every(U)}else S=e.hydrationData!=null;let k,C={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,navigation:dv,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},T=on.Pop,E=!1,N,P=!1,q=new Map,O=null,Y=!1,B=!1,ee=[],K=[],V=new Map,A=0,D=-1,X=new Map,se=new Set,H=new Map,oe=new Map,Q=new Set,ne=new Map,re=new Map,W=new Map,ge=!1;function je(){if(f=e.history.listen(R=>{let{action:I,location:U,delta:te}=R;if(ge){ge=!1;return}Sc(re.size===0||te!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let xe=Ho({currentLocation:C.location,nextLocation:U,historyAction:I});if(xe&&te!=null){ge=!0,e.history.go(te*-1),js(xe,{state:"blocked",location:U,proceed(){js(xe,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),e.history.go(te)},reset(){let _e=new Map(C.blockers);_e.set(xe,du),ye({blockers:_e})}});return}return tn(I,U)}),n){X4(t,q);let R=()=>e$(t,q);t.addEventListener("pagehide",R),O=()=>t.removeEventListener("pagehide",R)}return C.initialized||tn(on.Pop,C.location,{initialHydration:!0}),k}function Pe(){f&&f(),O&&O(),h.clear(),N&&N.abort(),C.fetchers.forEach((R,I)=>Es(I)),C.blockers.forEach((R,I)=>In(I))}function Ie(R){return h.add(R),()=>h.delete(R)}function ye(R,I){I===void 0&&(I={}),C=Kt({},C,R);let U=[],te=[];p.v7_fetcherPersist&&C.fetchers.forEach((xe,_e)=>{xe.state==="idle"&&(Q.has(_e)?te.push(_e):U.push(_e))}),[...h].forEach(xe=>xe(C,{deletedFetchers:te,unstable_viewTransitionOpts:I.viewTransitionOpts,unstable_flushSync:I.flushSync===!0})),p.v7_fetcherPersist&&(U.forEach(xe=>C.fetchers.delete(xe)),te.forEach(xe=>Es(xe)))}function ot(R,I,U){var te,xe;let{flushSync:_e}=U===void 0?{}:U,Ue=C.actionData!=null&&C.navigation.formMethod!=null&&os(C.navigation.formMethod)&&C.navigation.state==="loading"&&((te=R.state)==null?void 0:te._isRedirect)!==!0,pe;I.actionData?Object.keys(I.actionData).length>0?pe=I.actionData:pe=null:Ue?pe=C.actionData:pe=null;let Qe=I.loaderData?jC(C.loaderData,I.loaderData,I.matches||[],I.errors):C.loaderData,Oe=C.blockers;Oe.size>0&&(Oe=new Map(Oe),Oe.forEach((Ct,jt)=>Oe.set(jt,du)));let De=E===!0||C.navigation.formMethod!=null&&os(C.navigation.formMethod)&&((xe=R.state)==null?void 0:xe._isRedirect)!==!0;c&&(a=c,c=void 0),Y||T===on.Pop||(T===on.Push?e.history.push(R,R.state):T===on.Replace&&e.history.replace(R,R.state));let Et;if(T===on.Pop){let Ct=q.get(C.location.pathname);Ct&&Ct.has(R.pathname)?Et={currentLocation:C.location,nextLocation:R}:q.has(R.pathname)&&(Et={currentLocation:R,nextLocation:C.location})}else if(P){let Ct=q.get(C.location.pathname);Ct?Ct.add(R.pathname):(Ct=new Set([R.pathname]),q.set(C.location.pathname,Ct)),Et={currentLocation:C.location,nextLocation:R}}ye(Kt({},I,{actionData:pe,loaderData:Qe,historyAction:T,location:R,initialized:!0,navigation:dv,revalidation:"idle",restoreScrollPosition:W0(R,I.matches||C.matches),preventScrollReset:De,blockers:Oe}),{viewTransitionOpts:Et,flushSync:_e===!0}),T=on.Pop,E=!1,P=!1,Y=!1,B=!1,ee=[],K=[]}async function Ht(R,I){if(typeof R=="number"){e.history.go(R);return}let U=mb(C.location,C.matches,u,p.v7_prependBasename,R,p.v7_relativeSplatPath,I==null?void 0:I.fromRouteId,I==null?void 0:I.relative),{path:te,submission:xe,error:_e}=bC(p.v7_normalizeFormMethod,!1,U,I),Ue=C.location,pe=Sd(C.location,te,I&&I.state);pe=Kt({},pe,e.history.encodeLocation(pe));let Qe=I&&I.replace!=null?I.replace:void 0,Oe=on.Push;Qe===!0?Oe=on.Replace:Qe===!1||xe!=null&&os(xe.formMethod)&&xe.formAction===C.location.pathname+C.location.search&&(Oe=on.Replace);let De=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,Et=(I&&I.unstable_flushSync)===!0,Ct=Ho({currentLocation:Ue,nextLocation:pe,historyAction:Oe});if(Ct){js(Ct,{state:"blocked",location:pe,proceed(){js(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),Ht(R,I)},reset(){let jt=new Map(C.blockers);jt.set(Ct,du),ye({blockers:jt})}});return}return await tn(Oe,pe,{submission:xe,pendingError:_e,preventScrollReset:De,replace:I&&I.replace,enableViewTransition:I&&I.unstable_viewTransition,flushSync:Et})}function rn(){if(yn(),ye({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){tn(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}tn(T||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation})}}async function tn(R,I,U){N&&N.abort(),N=null,T=R,Y=(U&&U.startUninterruptedRevalidation)===!0,OA(C.location,C.matches),E=(U&&U.preventScrollReset)===!0,P=(U&&U.enableViewTransition)===!0;let te=c||a,xe=U&&U.overrideNavigation,_e=oi(te,I,u),Ue=(U&&U.flushSync)===!0,pe=Dm(_e,te,I.pathname);if(pe.active&&pe.matches&&(_e=pe.matches),!_e){let{error:xt,notFoundMatches:En,route:sn}=eu(I.pathname);ot(I,{matches:En,loaderData:{},errors:{[sn.id]:xt}},{flushSync:Ue});return}if(C.initialized&&!B&&K4(C.location,I)&&!(U&&U.submission&&os(U.submission.formMethod))){ot(I,{matches:_e},{flushSync:Ue});return}N=new AbortController;let Qe=pl(e.history,I,N.signal,U&&U.submission),Oe;if(U&&U.pendingError)Oe=[Ll(_e).route.id,{type:_t.error,error:U.pendingError}];else if(U&&U.submission&&os(U.submission.formMethod)){let xt=await dn(Qe,I,U.submission,_e,pe.active,{replace:U.replace,flushSync:Ue});if(xt.shortCircuited)return;if(xt.pendingActionResult){let[En,sn]=xt.pendingActionResult;if(xr(sn)&&jg(sn.error)&&sn.error.status===404){N=null,ot(I,{matches:xt.matches,loaderData:{},errors:{[En]:sn.error}});return}}_e=xt.matches||_e,Oe=xt.pendingActionResult,xe=fv(I,U.submission),Ue=!1,pe.active=!1,Qe=pl(e.history,Qe.url,Qe.signal)}let{shortCircuited:De,matches:Et,loaderData:Ct,errors:jt}=await _(Qe,I,_e,pe.active,xe,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,Ue,Oe);De||(N=null,ot(I,Kt({matches:Et||_e},TC(Oe),{loaderData:Ct,errors:jt})))}async function dn(R,I,U,te,xe,_e){_e===void 0&&(_e={}),yn();let Ue=Z4(I,U);if(ye({navigation:Ue},{flushSync:_e.flushSync===!0}),xe){let Oe=await kf(te,I.pathname,R.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){let{boundaryId:De,error:Et}=ll(I.pathname,Oe);return{matches:Oe.partialMatches,pendingActionResult:[De,{type:_t.error,error:Et}]}}else if(Oe.matches)te=Oe.matches;else{let{notFoundMatches:De,error:Et,route:Ct}=eu(I.pathname);return{matches:De,pendingActionResult:[Ct.id,{type:_t.error,error:Et}]}}}let pe,Qe=Ru(te,I);if(!Qe.route.action&&!Qe.route.lazy)pe={type:_t.error,error:Kn(405,{method:R.method,pathname:I.pathname,routeId:Qe.route.id})};else if(pe=(await rt("action",R,[Qe],te))[0],R.signal.aborted)return{shortCircuited:!0};if(ui(pe)){let Oe;return _e&&_e.replace!=null?Oe=_e.replace:Oe=CC(pe.response.headers.get("Location"),new URL(R.url),u)===C.location.pathname+C.location.search,await Ne(R,pe,{submission:U,replace:Oe}),{shortCircuited:!0}}if(ci(pe))throw Kn(400,{type:"defer-action"});if(xr(pe)){let Oe=Ll(te,Qe.route.id);return(_e&&_e.replace)!==!0&&(T=on.Push),{matches:te,pendingActionResult:[Oe.route.id,pe]}}return{matches:te,pendingActionResult:[Qe.route.id,pe]}}async function _(R,I,U,te,xe,_e,Ue,pe,Qe,Oe,De){let Et=xe||fv(I,_e),Ct=_e||Ue||RC(Et),jt=!Y&&(!p.v7_partialHydration||!Qe);if(te){if(jt){let Zt=F(De);ye(Kt({navigation:Et},Zt!==void 0?{actionData:Zt}:{}),{flushSync:Oe})}let Xe=await kf(U,I.pathname,R.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){let{boundaryId:Zt,error:hr}=ll(I.pathname,Xe);return{matches:Xe.partialMatches,loaderData:{},errors:{[Zt]:hr}}}else if(Xe.matches)U=Xe.matches;else{let{error:Zt,notFoundMatches:hr,route:zt}=eu(I.pathname);return{matches:hr,loaderData:{},errors:{[zt.id]:Zt}}}}let xt=c||a,[En,sn]=xC(e.history,C,U,Ct,I,p.v7_partialHydration&&Qe===!0,p.v7_skipActionErrorRevalidation,B,ee,K,Q,H,se,xt,u,De);if(Ts(Xe=>!(U&&U.some(Zt=>Zt.route.id===Xe))||En&&En.some(Zt=>Zt.route.id===Xe)),D=++A,En.length===0&&sn.length===0){let Xe=qe();return ot(I,Kt({matches:U,loaderData:{},errors:De&&xr(De[1])?{[De[0]]:De[1].error}:null},TC(De),Xe?{fetchers:new Map(C.fetchers)}:{}),{flushSync:Oe}),{shortCircuited:!0}}if(jt){let Xe={};if(!te){Xe.navigation=Et;let Zt=F(De);Zt!==void 0&&(Xe.actionData=Zt)}sn.length>0&&(Xe.fetchers=J(sn)),ye(Xe,{flushSync:Oe})}sn.forEach(Xe=>{V.has(Xe.key)&&Vn(Xe.key),Xe.controller&&V.set(Xe.key,Xe.controller)});let nu=()=>sn.forEach(Xe=>Vn(Xe.key));N&&N.signal.addEventListener("abort",nu);let{loaderResults:qo,fetcherResults:cl}=await Pt(C.matches,U,En,sn,R);if(R.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",nu),sn.forEach(Xe=>V.delete(Xe.key));let ul=_C([...qo,...cl]);if(ul){if(ul.idx>=En.length){let Xe=sn[ul.idx-En.length].key;se.add(Xe)}return await Ne(R,ul.result,{replace:pe}),{shortCircuited:!0}}let{loaderData:dl,errors:Ns}=EC(C,U,En,qo,De,sn,cl,ne);ne.forEach((Xe,Zt)=>{Xe.subscribe(hr=>{(hr||Xe.done)&&ne.delete(Zt)})}),p.v7_partialHydration&&Qe&&C.errors&&Object.entries(C.errors).filter(Xe=>{let[Zt]=Xe;return!En.some(hr=>hr.route.id===Zt)}).forEach(Xe=>{let[Zt,hr]=Xe;Ns=Object.assign(Ns||{},{[Zt]:hr})});let Ef=qe(),jf=Nt(D),Tf=Ef||jf||sn.length>0;return Kt({matches:U,loaderData:dl,errors:Ns},Tf?{fetchers:new Map(C.fetchers)}:{})}function F(R){if(R&&!xr(R[1]))return{[R[0]]:R[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function J(R){return R.forEach(I=>{let U=C.fetchers.get(I.key),te=fu(void 0,U?U.data:void 0);C.fetchers.set(I.key,te)}),new Map(C.fetchers)}function me(R,I,U,te){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");V.has(R)&&Vn(R);let xe=(te&&te.unstable_flushSync)===!0,_e=c||a,Ue=mb(C.location,C.matches,u,p.v7_prependBasename,U,p.v7_relativeSplatPath,I,te==null?void 0:te.relative),pe=oi(_e,Ue,u),Qe=Dm(pe,_e,Ue);if(Qe.active&&Qe.matches&&(pe=Qe.matches),!pe){bn(R,I,Kn(404,{pathname:Ue}),{flushSync:xe});return}let{path:Oe,submission:De,error:Et}=bC(p.v7_normalizeFormMethod,!0,Ue,te);if(Et){bn(R,I,Et,{flushSync:xe});return}let Ct=Ru(pe,Oe);if(E=(te&&te.preventScrollReset)===!0,De&&os(De.formMethod)){ue(R,I,Oe,Ct,pe,Qe.active,xe,De);return}H.set(R,{routeId:I,path:Oe}),ce(R,I,Oe,Ct,pe,Qe.active,xe,De)}async function ue(R,I,U,te,xe,_e,Ue,pe){yn(),H.delete(R);function Qe(zt){if(!zt.route.action&&!zt.route.lazy){let ro=Kn(405,{method:pe.formMethod,pathname:U,routeId:I});return bn(R,I,ro,{flushSync:Ue}),!0}return!1}if(!_e&&Qe(te))return;let Oe=C.fetchers.get(R);kn(R,Y4(pe,Oe),{flushSync:Ue});let De=new AbortController,Et=pl(e.history,U,De.signal,pe);if(_e){let zt=await kf(xe,U,Et.signal);if(zt.type==="aborted")return;if(zt.type==="error"){let{error:ro}=ll(U,zt);bn(R,I,ro,{flushSync:Ue});return}else if(zt.matches){if(xe=zt.matches,te=Ru(xe,U),Qe(te))return}else{bn(R,I,Kn(404,{pathname:U}),{flushSync:Ue});return}}V.set(R,De);let Ct=A,xt=(await rt("action",Et,[te],xe))[0];if(Et.signal.aborted){V.get(R)===De&&V.delete(R);return}if(p.v7_fetcherPersist&&Q.has(R)){if(ui(xt)||xr(xt)){kn(R,Yo(void 0));return}}else{if(ui(xt))if(V.delete(R),D>Ct){kn(R,Yo(void 0));return}else return se.add(R),kn(R,fu(pe)),Ne(Et,xt,{fetcherSubmission:pe});if(xr(xt)){bn(R,I,xt.error);return}}if(ci(xt))throw Kn(400,{type:"defer-action"});let En=C.navigation.location||C.location,sn=pl(e.history,En,De.signal),nu=c||a,qo=C.navigation.state!=="idle"?oi(nu,C.navigation.location,u):C.matches;nt(qo,"Didn't find any matches after fetcher action");let cl=++A;X.set(R,cl);let ul=fu(pe,xt.data);C.fetchers.set(R,ul);let[dl,Ns]=xC(e.history,C,qo,pe,En,!1,p.v7_skipActionErrorRevalidation,B,ee,K,Q,H,se,nu,u,[te.route.id,xt]);Ns.filter(zt=>zt.key!==R).forEach(zt=>{let ro=zt.key,G0=C.fetchers.get(ro),AA=fu(void 0,G0?G0.data:void 0);C.fetchers.set(ro,AA),V.has(ro)&&Vn(ro),zt.controller&&V.set(ro,zt.controller)}),ye({fetchers:new Map(C.fetchers)});let Ef=()=>Ns.forEach(zt=>Vn(zt.key));De.signal.addEventListener("abort",Ef);let{loaderResults:jf,fetcherResults:Tf}=await Pt(C.matches,qo,dl,Ns,sn);if(De.signal.aborted)return;De.signal.removeEventListener("abort",Ef),X.delete(R),V.delete(R),Ns.forEach(zt=>V.delete(zt.key));let Xe=_C([...jf,...Tf]);if(Xe){if(Xe.idx>=dl.length){let zt=Ns[Xe.idx-dl.length].key;se.add(zt)}return Ne(sn,Xe.result)}let{loaderData:Zt,errors:hr}=EC(C,C.matches,dl,jf,void 0,Ns,Tf,ne);if(C.fetchers.has(R)){let zt=Yo(xt.data);C.fetchers.set(R,zt)}Nt(cl),C.navigation.state==="loading"&&cl>D?(nt(T,"Expected pending action"),N&&N.abort(),ot(C.navigation.location,{matches:qo,loaderData:Zt,errors:hr,fetchers:new Map(C.fetchers)})):(ye({errors:hr,loaderData:jC(C.loaderData,Zt,qo,hr),fetchers:new Map(C.fetchers)}),B=!1)}async function ce(R,I,U,te,xe,_e,Ue,pe){let Qe=C.fetchers.get(R);kn(R,fu(pe,Qe?Qe.data:void 0),{flushSync:Ue});let Oe=new AbortController,De=pl(e.history,U,Oe.signal);if(_e){let xt=await kf(xe,U,De.signal);if(xt.type==="aborted")return;if(xt.type==="error"){let{error:En}=ll(U,xt);bn(R,I,En,{flushSync:Ue});return}else if(xt.matches)xe=xt.matches,te=Ru(xe,U);else{bn(R,I,Kn(404,{pathname:U}),{flushSync:Ue});return}}V.set(R,Oe);let Et=A,jt=(await rt("loader",De,[te],xe))[0];if(ci(jt)&&(jt=await RN(jt,De.signal,!0)||jt),V.get(R)===Oe&&V.delete(R),!De.signal.aborted){if(Q.has(R)){kn(R,Yo(void 0));return}if(ui(jt))if(D>Et){kn(R,Yo(void 0));return}else{se.add(R),await Ne(De,jt);return}if(xr(jt)){bn(R,I,jt.error);return}nt(!ci(jt),"Unhandled fetcher deferred data"),kn(R,Yo(jt.data))}}async function Ne(R,I,U){let{submission:te,fetcherSubmission:xe,replace:_e}=U===void 0?{}:U;I.response.headers.has("X-Remix-Revalidate")&&(B=!0);let Ue=I.response.headers.get("Location");nt(Ue,"Expected a Location header on the redirect Response"),Ue=CC(Ue,new URL(R.url),u);let pe=Sd(C.location,Ue,{_isRedirect:!0});if(n){let jt=!1;if(I.response.headers.has("X-Remix-Reload-Document"))jt=!0;else if(vw.test(Ue)){const xt=e.history.createURL(Ue);jt=xt.origin!==t.location.origin||Fc(xt.pathname,u)==null}if(jt){_e?t.location.replace(Ue):t.location.assign(Ue);return}}N=null;let Qe=_e===!0?on.Replace:on.Push,{formMethod:Oe,formAction:De,formEncType:Et}=C.navigation;!te&&!xe&&Oe&&De&&Et&&(te=RC(C.navigation));let Ct=te||xe;if(P4.has(I.response.status)&&Ct&&os(Ct.formMethod))await tn(Qe,pe,{submission:Kt({},Ct,{formAction:Ue}),preventScrollReset:E});else{let jt=fv(pe,te);await tn(Qe,pe,{overrideNavigation:jt,fetcherSubmission:xe,preventScrollReset:E})}}async function rt(R,I,U,te){try{let xe=await z4(l,R,I,U,te,o,s);return await Promise.all(xe.map((_e,Ue)=>{if(G4(_e)){let pe=_e.result;return{type:_t.redirect,response:H4(pe,I,U[Ue].route.id,te,u,p.v7_relativeSplatPath)}}return V4(_e)}))}catch(xe){return U.map(()=>({type:_t.error,error:xe}))}}async function Pt(R,I,U,te,xe){let[_e,...Ue]=await Promise.all([U.length?rt("loader",xe,U,I):[],...te.map(pe=>{if(pe.matches&&pe.match&&pe.controller){let Qe=pl(e.history,pe.path,pe.controller.signal);return rt("loader",Qe,[pe.match],pe.matches).then(Oe=>Oe[0])}else return Promise.resolve({type:_t.error,error:Kn(404,{pathname:pe.path})})})]);return await Promise.all([MC(R,U,_e,_e.map(()=>xe.signal),!1,C.loaderData),MC(R,te.map(pe=>pe.match),Ue,te.map(pe=>pe.controller?pe.controller.signal:null),!0)]),{loaderResults:_e,fetcherResults:Ue}}function yn(){B=!0,ee.push(...Ts()),H.forEach((R,I)=>{V.has(I)&&(K.push(I),Vn(I))})}function kn(R,I,U){U===void 0&&(U={}),C.fetchers.set(R,I),ye({fetchers:new Map(C.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function bn(R,I,U,te){te===void 0&&(te={});let xe=Ll(C.matches,I);Es(R),ye({errors:{[xe.route.id]:U},fetchers:new Map(C.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Vo(R){return p.v7_fetcherPersist&&(oe.set(R,(oe.get(R)||0)+1),Q.has(R)&&Q.delete(R)),C.fetchers.get(R)||O4}function Es(R){let I=C.fetchers.get(R);V.has(R)&&!(I&&I.state==="loading"&&X.has(R))&&Vn(R),H.delete(R),X.delete(R),se.delete(R),Q.delete(R),C.fetchers.delete(R)}function Xa(R){if(p.v7_fetcherPersist){let I=(oe.get(R)||0)-1;I<=0?(oe.delete(R),Q.add(R)):oe.set(R,I)}else Es(R);ye({fetchers:new Map(C.fetchers)})}function Vn(R){let I=V.get(R);nt(I,"Expected fetch controller: "+R),I.abort(),V.delete(R)}function de(R){for(let I of R){let U=Vo(I),te=Yo(U.data);C.fetchers.set(I,te)}}function qe(){let R=[],I=!1;for(let U of se){let te=C.fetchers.get(U);nt(te,"Expected fetcher: "+U),te.state==="loading"&&(se.delete(U),R.push(U),I=!0)}return de(R),I}function Nt(R){let I=[];for(let[U,te]of X)if(te0}function bt(R,I){let U=C.blockers.get(R)||du;return re.get(R)!==I&&re.set(R,I),U}function In(R){C.blockers.delete(R),re.delete(R)}function js(R,I){let U=C.blockers.get(R)||du;nt(U.state==="unblocked"&&I.state==="blocked"||U.state==="blocked"&&I.state==="blocked"||U.state==="blocked"&&I.state==="proceeding"||U.state==="blocked"&&I.state==="unblocked"||U.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+I.state);let te=new Map(C.blockers);te.set(R,I),ye({blockers:te})}function Ho(R){let{currentLocation:I,nextLocation:U,historyAction:te}=R;if(re.size===0)return;re.size>1&&Sc(!1,"A router only supports one blocker at a time");let xe=Array.from(re.entries()),[_e,Ue]=xe[xe.length-1],pe=C.blockers.get(_e);if(!(pe&&pe.state==="proceeding")&&Ue({currentLocation:I,nextLocation:U,historyAction:te}))return _e}function eu(R){let I=Kn(404,{pathname:R}),U=c||a,{matches:te,route:xe}=NC(U);return Ts(),{notFoundMatches:te,route:xe,error:I}}function ll(R,I){return{boundaryId:Ll(I.partialMatches).route.id,error:Kn(400,{type:"route-discovery",pathname:R,message:I.error!=null&&"message"in I.error?I.error:String(I.error)})}}function Ts(R){let I=[];return ne.forEach((U,te)=>{(!R||R(te))&&(U.cancel(),I.push(te),ne.delete(te))}),I}function tu(R,I,U){if(g=R,x=I,m=U||null,!b&&C.navigation===dv){b=!0;let te=W0(C.location,C.matches);te!=null&&ye({restoreScrollPosition:te})}return()=>{g=null,x=null,m=null}}function K0(R,I){return m&&m(R,I.map(te=>u4(te,C.loaderData)))||R.key}function OA(R,I){if(g&&x){let U=K0(R,I);g[U]=x()}}function W0(R,I){if(g){let U=K0(R,I),te=g[U];if(typeof te=="number")return te}return null}function Dm(R,I,U){if(d)if(R){let te=R[R.length-1].route;if(te.path&&(te.path==="*"||te.path.endsWith("/*")))return{active:!0,matches:Rp(I,U,u,!0)}}else return{active:!0,matches:Rp(I,U,u,!0)||[]};return{active:!1,matches:null}}async function kf(R,I,U){let te=R,xe=te.length>0?te[te.length-1].route:null;for(;;){let _e=c==null,Ue=c||a;try{await $4(d,I,te,Ue,o,s,W,U)}catch(De){return{type:"error",error:De,partialMatches:te}}finally{_e&&(a=[...a])}if(U.aborted)return{type:"aborted"};let pe=oi(Ue,I,u),Qe=!1;if(pe){let De=pe[pe.length-1].route;if(De.index)return{type:"success",matches:pe};if(De.path&&De.path.length>0)if(De.path==="*")Qe=!0;else return{type:"success",matches:pe}}let Oe=Rp(Ue,I,u,!0);if(!Oe||te.map(De=>De.route.id).join("-")===Oe.map(De=>De.route.id).join("-"))return{type:"success",matches:Qe?pe:null};if(te=Oe,xe=te[te.length-1].route,xe.path==="*")return{type:"success",matches:te}}}function IA(R){o={},c=Cd(R,s,void 0,o)}function DA(R,I){let U=c==null;NN(R,I,c||a,o,s),U&&(a=[...a],ye({}))}return k={get basename(){return u},get future(){return p},get state(){return C},get routes(){return a},get window(){return t},initialize:je,subscribe:Ie,enableScrollRestoration:tu,navigate:Ht,fetch:me,revalidate:rn,createHref:R=>e.history.createHref(R),encodeLocation:R=>e.history.encodeLocation(R),getFetcher:Vo,deleteFetcher:Xa,dispose:Pe,getBlocker:bt,deleteBlocker:In,patchRoutes:DA,_internalFetchControllers:V,_internalActiveDeferreds:ne,_internalSetRoutes:IA},k}function A4(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function mb(e,t,n,r,s,o,a,c){let u,l;if(a){u=[];for(let p of t)if(u.push(p),p.route.id===a){l=p;break}}else u=t,l=t[t.length-1];let d=Eg(s||".",kg(u,o),Fc(e.pathname,n)||e.pathname,c==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&l&&l.route.index&&!yw(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:So([n,d.pathname])),$i(d)}function bC(e,t,n,r){if(!r||!A4(r))return{path:n};if(r.formMethod&&!Q4(r.formMethod))return{path:n,error:Kn(405,{method:r.formMethod})};let s=()=>({path:n,error:Kn(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),c=_N(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!os(a))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,g)=>{let[m,x]=g;return""+h+m+"="+x+` +`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!os(a))return s();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return s()}}}nt(typeof FormData=="function","FormData is not available in this environment");let u,l;if(r.formData)u=vb(r.formData),l=r.formData;else if(r.body instanceof FormData)u=vb(r.body),l=r.body;else if(r.body instanceof URLSearchParams)u=r.body,l=kC(u);else if(r.body==null)u=new URLSearchParams,l=new FormData;else try{u=new URLSearchParams(r.body),l=kC(u)}catch{return s()}let d={formMethod:a,formAction:c,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(os(d.formMethod))return{path:n,submission:d};let p=Va(n);return t&&p.search&&yw(p.search)&&u.append("index",""),p.search="?"+u,{path:$i(p),submission:d}}function F4(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function xC(e,t,n,r,s,o,a,c,u,l,d,p,f,h,g,m){let x=m?xr(m[1])?m[1].error:m[1].data:void 0,b=e.createURL(t.location),y=e.createURL(s),w=m&&xr(m[1])?m[0]:void 0,S=w?F4(n,w):n,k=m?m[1].statusCode:void 0,C=a&&k&&k>=400,T=S.filter((N,P)=>{let{route:q}=N;if(q.lazy)return!0;if(q.loader==null)return!1;if(o)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(L4(t.loaderData,t.matches[P],N)||u.some(B=>B===N.route.id))return!0;let O=t.matches[P],Y=N;return wC(N,Kt({currentUrl:b,currentParams:O.params,nextUrl:y,nextParams:Y.params},r,{actionResult:x,actionStatus:k,defaultShouldRevalidate:C?!1:c||b.pathname+b.search===y.pathname+y.search||b.search!==y.search||TN(O,Y)}))}),E=[];return p.forEach((N,P)=>{if(o||!n.some(ee=>ee.route.id===N.routeId)||d.has(P))return;let q=oi(h,N.path,g);if(!q){E.push({key:P,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(P),Y=Ru(q,N.path),B=!1;f.has(P)?B=!1:l.includes(P)?B=!0:O&&O.state!=="idle"&&O.data===void 0?B=c:B=wC(Y,Kt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:k,defaultShouldRevalidate:C?!1:c})),B&&E.push({key:P,routeId:N.routeId,path:N.path,matches:q,match:Y,controller:new AbortController})}),[T,E]}function L4(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function TN(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function wC(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function $4(e,t,n,r,s,o,a,c){let u=[t,...n.map(l=>l.route.id)].join("-");try{let l=a.get(u);l||(l=e({path:t,matches:n,patch:(d,p)=>{c.aborted||NN(d,p,r,s,o)}}),a.set(u,l)),l&&W4(l)&&await l}finally{a.delete(u)}}function NN(e,t,n,r,s){if(e){var o;let a=r[e];nt(a,"No route found to patch children into: routeId = "+e);let c=Cd(t,s,[e,"patch",String(((o=a.children)==null?void 0:o.length)||"0")],r);a.children?a.children.push(...c):a.children=c}else{let a=Cd(t,s,["patch",String(n.length||"0")],r);n.push(...a)}}async function SC(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];nt(s,"No route found in manifest");let o={};for(let a in r){let u=s[a]!==void 0&&a!=="hasErrorBoundary";Sc(!u,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!l4.has(a)&&(o[a]=r[a])}Object.assign(s,o),Object.assign(s,Kt({},t(s),{lazy:void 0}))}function B4(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function z4(e,t,n,r,s,o,a,c){let u=r.reduce((p,f)=>p.add(f.route.id),new Set),l=new Set,d=await e({matches:s.map(p=>{let f=u.has(p.route.id);return Kt({},p,{shouldLoad:f,resolve:g=>(l.add(p.route.id),f?U4(t,n,p,o,a,g,c):Promise.resolve({type:_t.data,result:void 0}))})}),request:n,params:s[0].params,context:c});return s.forEach(p=>nt(l.has(p.route.id),'`match.resolve()` was not called for route id "'+p.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((p,f)=>u.has(s[f].route.id))}async function U4(e,t,n,r,s,o,a){let c,u,l=d=>{let p,f=new Promise((m,x)=>p=x);u=()=>p(),t.signal.addEventListener("abort",u);let h=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:a},...m!==void 0?[m]:[]),g;return o?g=o(m=>h(m)):g=(async()=>{try{return{type:"data",result:await h()}}catch(m){return{type:"error",result:m}}})(),Promise.race([g,f])};try{let d=n.route[e];if(n.route.lazy)if(d){let p,[f]=await Promise.all([l(d).catch(h=>{p=h}),SC(n.route,s,r)]);if(p!==void 0)throw p;c=f}else if(await SC(n.route,s,r),d=n.route[e],d)c=await l(d);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Kn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:_t.data,result:void 0};else if(d)c=await l(d);else{let p=new URL(t.url),f=p.pathname+p.search;throw Kn(404,{pathname:f})}nt(c.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:_t.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function V4(e){let{result:t,type:n,status:r}=e;if(MN(t)){let a;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(c){return{type:_t.error,error:c}}return n===_t.error?{type:_t.error,error:new mw(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:_t.data,data:a,statusCode:t.status,headers:t.headers}}if(n===_t.error)return{type:_t.error,error:t,statusCode:jg(t)?t.status:r};if(J4(t)){var s,o;return{type:_t.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:_t.data,data:t,statusCode:r}}function H4(e,t,n,r,s,o){let a=e.headers.get("Location");if(nt(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!vw.test(a)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=mb(new URL(t.url),c,s,!0,a,o),e.headers.set("Location",a)}return e}function CC(e,t,n){if(vw.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Fc(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function pl(e,t,n,r){let s=e.createURL(_N(t)).toString(),o={signal:n};if(r&&os(r.formMethod)){let{formMethod:a,formEncType:c}=r;o.method=a.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=vb(r.formData):o.body=r.formData}return new Request(s,o)}function vb(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function kC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function q4(e,t,n,r,s,o){let a={},c=null,u,l=!1,d={},p=r&&xr(r[1])?r[1].error:void 0;return n.forEach((f,h)=>{let g=t[h].route.id;if(nt(!ui(f),"Cannot handle redirect results in processLoaderData"),xr(f)){let m=f.error;p!==void 0&&(m=p,p=void 0),c=c||{};{let x=Ll(e,g);c[x.route.id]==null&&(c[x.route.id]=m)}a[g]=void 0,l||(l=!0,u=jg(f.error)?f.error.status:500),f.headers&&(d[g]=f.headers)}else ci(f)?(s.set(g,f.deferredData),a[g]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(u=f.statusCode),f.headers&&(d[g]=f.headers)):(a[g]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(u=f.statusCode),f.headers&&(d[g]=f.headers))}),p!==void 0&&r&&(c={[r[0]]:p},a[r[0]]=void 0),{loaderData:a,errors:c,statusCode:u||200,loaderHeaders:d}}function EC(e,t,n,r,s,o,a,c){let{loaderData:u,errors:l}=q4(t,n,r,s,c);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function NC(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Kn(e,t){let{pathname:n,routeId:r,method:s,type:o,message:a}=t===void 0?{}:t,c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",o==="route-discovery"?u='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: +`+a):s&&n&&r?u="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(c="Not Found",u='No route matches URL "'+n+'"'):e===405&&(c="Method Not Allowed",s&&n&&r?u="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(u='Invalid request method "'+s.toUpperCase()+'"')),new mw(e||500,c,new Error(u),!0)}function _C(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ui(n))return{result:n,idx:t}}}function _N(e){let t=typeof e=="string"?Va(e):e;return $i(Kt({},t,{hash:""}))}function K4(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function W4(e){return typeof e=="object"&&e!=null&&"then"in e}function G4(e){return MN(e.result)&&R4.has(e.result.status)}function ci(e){return e.type===_t.deferred}function xr(e){return e.type===_t.error}function ui(e){return(e&&e.type)===_t.redirect}function J4(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function MN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Q4(e){return M4.has(e.toLowerCase())}function os(e){return N4.has(e.toLowerCase())}async function MC(e,t,n,r,s,o){for(let a=0;ap.route.id===u.route.id),d=l!=null&&!TN(l,u)&&(o&&o[u.route.id])!==void 0;if(ci(c)&&(s||d)){let p=r[a];nt(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await RN(c,p,s).then(f=>{f&&(n[a]=f||n[a])})}}}async function RN(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:_t.data,data:e.deferredData.unwrappedData}}catch(s){return{type:_t.error,error:s}}return{type:_t.data,data:e.deferredData.data}}}function yw(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ru(e,t){let n=typeof t=="string"?Va(t).search:t.search;if(e[e.length-1].route.index&&yw(n||""))return e[e.length-1];let r=kN(e);return r[r.length-1]}function RC(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:a}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function fv(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Z4(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function fu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Y4(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Yo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function X4(e,t){try{let n=e.sessionStorage.getItem(jN);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function e$(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(jN,JSON.stringify(n))}catch(r){Sc(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.25.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t{c.current=!0}),v.useCallback(function(l,d){if(d===void 0&&(d={}),!c.current)return;if(typeof l=="number"){r.go(l);return}let p=Eg(l,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:So([t,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[t,r,a,o,e])}function Zr(){let{matches:e}=v.useContext(Oo),t=e[e.length-1];return t?t.params:{}}function DN(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Ha),{matches:s}=v.useContext(Oo),{pathname:o}=Yi(),a=JSON.stringify(kg(s,r.v7_relativeSplatPath));return v.useMemo(()=>Eg(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function r$(e,t,n,r){Lc()||nt(!1);let{navigator:s}=v.useContext(Ha),{matches:o}=v.useContext(Oo),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let l=Yi(),d;d=l;let p=d.pathname||"/",f=p;if(u!=="/"){let m=u.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(m.length).join("/")}let h=oi(e,{pathname:f});return l$(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},c,m.params),pathname:So([u,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?u:So([u,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n,r)}function s$(){let e=f$(),t=jg(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:s},n):null,null)}const o$=v.createElement(s$,null);class a$ extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(Oo.Provider,{value:this.props.routeContext},v.createElement(ON.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function i$(e){let{routeContext:t,match:n,children:r}=e,s=v.useContext(Tg);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Oo.Provider,{value:t},r)}function l$(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let a=e,c=(s=n)==null?void 0:s.errors;if(c!=null){let d=a.findIndex(p=>p.route.id&&(c==null?void 0:c[p.route.id])!==void 0);d>=0||nt(!1),a=a.slice(0,Math.min(a.length,d+1))}let u=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,l+1):a=[a[0]];break}}}return a.reduceRight((d,p,f)=>{let h,g=!1,m=null,x=null;n&&(h=c&&p.route.id?c[p.route.id]:void 0,m=p.route.errorElement||o$,u&&(l<0&&f===0?(h$("route-fallback"),g=!0,x=null):l===f&&(g=!0,x=p.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,f+1)),y=()=>{let w;return h?w=m:g?w=x:p.route.Component?w=v.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=d,v.createElement(i$,{match:p,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||f===0)?v.createElement(a$,{location:n.location,revalidation:n.revalidation,component:m,error:h,children:y(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):y()},null)}var AN=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(AN||{}),kh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(kh||{});function c$(e){let t=v.useContext(Tg);return t||nt(!1),t}function u$(e){let t=v.useContext(PN);return t||nt(!1),t}function d$(e){let t=v.useContext(Oo);return t||nt(!1),t}function FN(e){let t=d$(),n=t.matches[t.matches.length-1];return n.route.id||nt(!1),n.route.id}function f$(){var e;let t=v.useContext(ON),n=u$(kh.UseRouteError),r=FN(kh.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function p$(){let{router:e}=c$(AN.UseNavigateStable),t=FN(kh.UseNavigateStable),n=v.useRef(!1);return IN(()=>{n.current=!0}),v.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ch({fromRouteId:t},o)))},[e,t])}const PC={};function h$(e,t,n){PC[e]||(PC[e]=!0)}function LN(e){let{to:t,replace:n,state:r,relative:s}=e;Lc()||nt(!1);let{future:o,static:a}=v.useContext(Ha),{matches:c}=v.useContext(Oo),{pathname:u}=Yi(),l=Qt(),d=Eg(t,kg(c,o.v7_relativeSplatPath),u,s==="path"),p=JSON.stringify(d);return v.useEffect(()=>l(JSON.parse(p),{replace:n,state:r,relative:s}),[l,p,s,n,r]),null}function g$(e){let{basename:t="/",children:n=null,location:r,navigationType:s=on.Pop,navigator:o,static:a=!1,future:c}=e;Lc()&&nt(!1);let u=t.replace(/^\/*/,"/"),l=v.useMemo(()=>({basename:u,navigator:o,static:a,future:Ch({v7_relativeSplatPath:!1},c)}),[u,c,o,a]);typeof r=="string"&&(r=Va(r));let{pathname:d="/",search:p="",hash:f="",state:h=null,key:g="default"}=r,m=v.useMemo(()=>{let x=Fc(d,u);return x==null?null:{location:{pathname:x,search:p,hash:f,state:h,key:g},navigationType:s}},[u,d,p,f,h,g,s]);return m==null?null:v.createElement(Ha.Provider,{value:l},v.createElement(bw.Provider,{children:n,value:m}))}new Promise(()=>{});function m$(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.25.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function kd(){return kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function y$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function b$(e,t){return e.button===0&&(!t||t==="_self")&&!y$(e)}function yb(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function x$(e,t){let n=yb(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const w$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],S$="6";try{window.__reactRouterVersion=S$}catch{}function C$(e,t){return D4({basename:void 0,future:kd({},void 0,{v7_prependBasename:!0}),history:o4({window:void 0}),hydrationData:k$(),routes:e,mapRouteProperties:m$,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function k$(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=kd({},t,{errors:E$(t.errors)})),t}function E$(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new mw(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let a=new o(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}const j$=v.createContext({isTransitioning:!1}),T$=v.createContext(new Map),N$="startTransition",OC=lg[N$],_$="flushSync",IC=UL[_$];function M$(e){OC?OC(e):e()}function pu(e){IC?IC(e):e()}class R${constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function P$(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=v.useState(n.state),[a,c]=v.useState(),[u,l]=v.useState({isTransitioning:!1}),[d,p]=v.useState(),[f,h]=v.useState(),[g,m]=v.useState(),x=v.useRef(new Map),{v7_startTransition:b}=r||{},y=v.useCallback(E=>{b?M$(E):E()},[b]),w=v.useCallback((E,N)=>{let{deletedFetchers:P,unstable_flushSync:q,unstable_viewTransitionOpts:O}=N;P.forEach(B=>x.current.delete(B)),E.fetchers.forEach((B,ee)=>{B.data!==void 0&&x.current.set(ee,B.data)});let Y=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!O||Y){q?pu(()=>o(E)):y(()=>o(E));return}if(q){pu(()=>{f&&(d&&d.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let B=n.window.document.startViewTransition(()=>{pu(()=>o(E))});B.finished.finally(()=>{pu(()=>{p(void 0),h(void 0),c(void 0),l({isTransitioning:!1})})}),pu(()=>h(B));return}f?(d&&d.resolve(),f.skipTransition(),m({state:E,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(c(E),l({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[n.window,f,d,x,y]);v.useLayoutEffect(()=>n.subscribe(w),[n,w]),v.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new R$)},[u]),v.useEffect(()=>{if(d&&a&&n.window){let E=a,N=d.promise,P=n.window.document.startViewTransition(async()=>{y(()=>o(E)),await N});P.finished.finally(()=>{p(void 0),h(void 0),c(void 0),l({isTransitioning:!1})}),h(P)}},[y,a,d,n.window]),v.useEffect(()=>{d&&a&&s.location.key===a.location.key&&d.resolve()},[d,f,s.location,a]),v.useEffect(()=>{!u.isTransitioning&&g&&(c(g.state),l({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),m(void 0))},[u.isTransitioning,g]),v.useEffect(()=>{},[]);let S=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,N,P)=>n.navigate(E,{state:N,preventScrollReset:P==null?void 0:P.preventScrollReset}),replace:(E,N,P)=>n.navigate(E,{replace:!0,state:N,preventScrollReset:P==null?void 0:P.preventScrollReset})}),[n]),k=n.basename||"/",C=v.useMemo(()=>({router:n,navigator:S,static:!1,basename:k}),[n,S,k]),T=v.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return v.createElement(v.Fragment,null,v.createElement(Tg.Provider,{value:C},v.createElement(PN.Provider,{value:s},v.createElement(T$.Provider,{value:x.current},v.createElement(j$.Provider,{value:u},v.createElement(g$,{basename:k,location:s.location,navigationType:s.historyAction,navigator:S,future:T},s.initialized||n.future.v7_partialHydration?v.createElement(O$,{routes:n.routes,future:n.future,state:s}):t))))),null)}const O$=v.memo(I$);function I$(e){let{routes:t,future:n,state:r}=e;return r$(t,void 0,r,n)}const D$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",A$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ed=v.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:a,state:c,target:u,to:l,preventScrollReset:d,unstable_viewTransition:p}=t,f=v$(t,w$),{basename:h}=v.useContext(Ha),g,m=!1;if(typeof l=="string"&&A$.test(l)&&(g=l,D$))try{let w=new URL(window.location.href),S=l.startsWith("//")?new URL(w.protocol+l):new URL(l),k=Fc(S.pathname,h);S.origin===w.origin&&k!=null?l=k+S.search+S.hash:m=!0}catch{}let x=t$(l,{relative:s}),b=F$(l,{replace:a,state:c,target:u,preventScrollReset:d,relative:s,unstable_viewTransition:p});function y(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",kd({},f,{href:g||x,onClick:m||o?r:y,ref:n,target:u}))});var DC;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(DC||(DC={}));var AC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(AC||(AC={}));function F$(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:a,unstable_viewTransition:c}=t===void 0?{}:t,u=Qt(),l=Yi(),d=DN(e,{relative:a});return v.useCallback(p=>{if(b$(p,n)){p.preventDefault();let f=r!==void 0?r:$i(l)===$i(d);u(e,{replace:f,state:s,preventScrollReset:o,relative:a,unstable_viewTransition:c})}},[l,u,d,r,s,n,e,o,a,c])}function uf(e){let t=v.useRef(yb(e)),n=v.useRef(!1),r=Yi(),s=v.useMemo(()=>x$(r.search,n.current?null:t.current),[r.search]),o=Qt(),a=v.useCallback((c,u)=>{const l=yb(typeof c=="function"?c(s):c);n.current=!0,o("?"+l,u)},[o,s]);return[s,a]}function $N(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),Ti=e=>typeof e=="string",Cr=e=>typeof e=="function",Pp=e=>Ti(e)||Cr(e)?e:null,bb=e=>v.isValidElement(e)||Ti(e)||Cr(e)||jd(e);function L$(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function Ng(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(a){let{children:c,position:u,preventExitTransition:l,done:d,nodeRef:p,isIn:f,playToast:h}=a;const g=r?`${t}--${u}`:t,m=r?`${n}--${u}`:n,x=v.useRef(0);return v.useLayoutEffect(()=>{const b=p.current,y=g.split(" "),w=S=>{S.target===p.current&&(h(),b.removeEventListener("animationend",w),b.removeEventListener("animationcancel",w),x.current===0&&S.type!=="animationcancel"&&b.classList.remove(...y))};b.classList.add(...y),b.addEventListener("animationend",w),b.addEventListener("animationcancel",w)},[]),v.useEffect(()=>{const b=p.current,y=()=>{b.removeEventListener("animationend",y),s?L$(b,d,o):d()};f||(l?y():(x.current=1,b.className+=` ${m}`,b.addEventListener("animationend",y)))},[f]),Te.createElement(Te.Fragment,null,c)}}function FC(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Jn=new Map;let Td=[];const xb=new Set,$$=e=>xb.forEach(t=>t(e)),BN=()=>Jn.size>0;function zN(e,t){var n;if(t)return!((n=Jn.get(t))==null||!n.isToastActive(e));let r=!1;return Jn.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function UN(e,t){bb(e)&&(BN()||Td.push({content:e,options:t}),Jn.forEach(n=>{n.buildToast(e,t)}))}function LC(e,t){Jn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function B$(e){const{subscribe:t,getSnapshot:n,setProps:r}=v.useRef(function(o){const a=o.containerId||1;return{subscribe(c){const u=function(d,p,f){let h=1,g=0,m=[],x=[],b=[],y=p;const w=new Map,S=new Set,k=()=>{b=Array.from(w.values()),S.forEach(E=>E())},C=E=>{x=E==null?[]:x.filter(N=>N!==E),k()},T=E=>{const{toastId:N,onOpen:P,updateId:q,children:O}=E.props,Y=q==null;E.staleId&&w.delete(E.staleId),w.set(N,E),x=[...x,E.props.toastId].filter(B=>B!==E.staleId),k(),f(FC(E,Y?"added":"updated")),Y&&Cr(P)&&P(v.isValidElement(O)&&O.props)};return{id:d,props:y,observe:E=>(S.add(E),()=>S.delete(E)),toggle:(E,N)=>{w.forEach(P=>{N!=null&&N!==P.props.toastId||Cr(P.toggle)&&P.toggle(E)})},removeToast:C,toasts:w,clearQueue:()=>{g-=m.length,m=[]},buildToast:(E,N)=>{if((H=>{let{containerId:oe,toastId:Q,updateId:ne}=H;const re=oe?oe!==d:d!==1,W=w.has(Q)&&ne==null;return re||W})(N))return;const{toastId:P,updateId:q,data:O,staleId:Y,delay:B}=N,ee=()=>{C(P)},K=q==null;K&&g++;const V={...y,style:y.toastStyle,key:h++,...Object.fromEntries(Object.entries(N).filter(H=>{let[oe,Q]=H;return Q!=null})),toastId:P,updateId:q,data:O,closeToast:ee,isIn:!1,className:Pp(N.className||y.toastClassName),bodyClassName:Pp(N.bodyClassName||y.bodyClassName),progressClassName:Pp(N.progressClassName||y.progressClassName),autoClose:!N.isLoading&&(A=N.autoClose,D=y.autoClose,A===!1||jd(A)&&A>0?A:D),deleteToast(){const H=w.get(P),{onClose:oe,children:Q}=H.props;Cr(oe)&&oe(v.isValidElement(Q)&&Q.props),f(FC(H,"removed")),w.delete(P),g--,g<0&&(g=0),m.length>0?T(m.shift()):k()}};var A,D;V.closeButton=y.closeButton,N.closeButton===!1||bb(N.closeButton)?V.closeButton=N.closeButton:N.closeButton===!0&&(V.closeButton=!bb(y.closeButton)||y.closeButton);let X=E;v.isValidElement(E)&&!Ti(E.type)?X=v.cloneElement(E,{closeToast:ee,toastProps:V,data:O}):Cr(E)&&(X=E({closeToast:ee,toastProps:V,data:O}));const se={content:X,props:V,staleId:Y};y.limit&&y.limit>0&&g>y.limit&&K?m.push(se):jd(B)?setTimeout(()=>{T(se)},B):T(se)},setProps(E){y=E},setToggle:(E,N)=>{w.get(E).toggle=N},isToastActive:E=>x.some(N=>N===E),getSnapshot:()=>y.newestOnTop?b.reverse():b}}(a,o,$$);Jn.set(a,u);const l=u.observe(c);return Td.forEach(d=>UN(d.content,d.options)),Td=[],()=>{l(),Jn.delete(a)}},setProps(c){var u;(u=Jn.get(a))==null||u.setProps(c)},getSnapshot(){var c;return(c=Jn.get(a))==null?void 0:c.getSnapshot()}}}(e)).current;r(e);const s=v.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!s)return[];const a=new Map;return s.forEach(c=>{const{position:u}=c.props;a.has(u)||a.set(u,[]),a.get(u).push(c)}),Array.from(a,c=>o(c[0],c[1]))},isToastActive:zN,count:s==null?void 0:s.length}}function z$(e){const[t,n]=v.useState(!1),[r,s]=v.useState(!1),o=v.useRef(null),a=v.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:u,closeToast:l,onClick:d,closeOnClick:p}=e;var f,h;function g(){n(!0)}function m(){n(!1)}function x(w){const S=o.current;a.canDrag&&S&&(a.didMove=!0,t&&m(),a.delta=e.draggableDirection==="x"?w.clientX-a.start:w.clientY-a.start,a.start!==w.clientX&&(a.canCloseOnClick=!1),S.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,S.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",b);const w=o.current;if(a.canDrag&&a.didMove&&w){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();w.style.transition="transform 0.2s, opacity 0.2s",w.style.removeProperty("transform"),w.style.removeProperty("opacity")}}(h=Jn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||h.setToggle(f.id,f.fn),v.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",g),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const y={onPointerDown:function(w){if(e.draggable===!0||e.draggable===w.pointerType){a.didMove=!1,document.addEventListener("pointermove",x),document.addEventListener("pointerup",b);const S=o.current;a.canCloseOnClick=!0,a.canDrag=!0,S.style.transition="none",e.draggableDirection==="x"?(a.start=w.clientX,a.removalDistance=S.offsetWidth*(e.draggablePercent/100)):(a.start=w.clientY,a.removalDistance=S.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(w){const{top:S,bottom:k,left:C,right:T}=o.current.getBoundingClientRect();w.nativeEvent.type!=="touchend"&&e.pauseOnHover&&w.clientX>=C&&w.clientX<=T&&w.clientY>=S&&w.clientY<=k?m():g()}};return c&&u&&(y.onMouseEnter=m,e.stacked||(y.onMouseLeave=g)),p&&(y.onClick=w=>{d&&d(w),a.canCloseOnClick&&l()}),{playToast:g,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:y}}function U$(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:o,className:a,style:c,controlledProgress:u,progress:l,rtl:d,isIn:p,theme:f}=e;const h=o||u&&l===0,g={...c,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};u&&(g.transform=`scaleX(${l})`);const m=yo("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":d}),x=Cr(a)?a({rtl:d,type:s,defaultClassName:m}):yo(m,a),b={[u&&l>=1?"onTransitionEnd":"onAnimationEnd"]:u&&l<1?null:()=>{p&&r()}};return Te.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":h},Te.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${s}`}),Te.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:x,style:g,...b}))}let V$=1;const VN=()=>""+V$++;function H$(e){return e&&(Ti(e.toastId)||jd(e.toastId))?e.toastId:VN()}function Ju(e,t){return UN(e,t),t.toastId}function Eh(e,t){return{...t,type:t&&t.type||e,toastId:H$(t)}}function Wf(e){return(t,n)=>Ju(t,Eh(e,n))}function Z(e,t){return Ju(e,Eh("default",t))}Z.loading=(e,t)=>Ju(e,Eh("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Z.promise=function(e,t,n){let r,{pending:s,error:o,success:a}=t;s&&(r=Ti(s)?Z.loading(s,n):Z.loading(s.render,{...n,...s}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(d,p,f)=>{if(p==null)return void Z.dismiss(r);const h={type:d,...c,...n,data:f},g=Ti(p)?{render:p}:p;return r?Z.update(r,{...h,...g}):Z(g.render,{...h,...g}),f},l=Cr(e)?e():e;return l.then(d=>u("success",a,d)).catch(d=>u("error",o,d)),l},Z.success=Wf("success"),Z.info=Wf("info"),Z.error=Wf("error"),Z.warning=Wf("warning"),Z.warn=Z.warning,Z.dark=(e,t)=>Ju(e,Eh("default",{theme:"dark",...t})),Z.dismiss=function(e){(function(t){var n;if(BN()){if(t==null||Ti(n=t)||jd(n))Jn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Jn.get(t.containerId);r?r.removeToast(t.id):Jn.forEach(s=>{s.removeToast(t.id)})}}else Td=Td.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Z.clearWaitingQueue=function(e){e===void 0&&(e={}),Jn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Z.isActive=zN,Z.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var o;let{containerId:a}=s;return(o=Jn.get(a||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:VN()};o.toastId!==e&&(o.staleId=e);const a=o.render||s;delete o.render,Ju(a,o)}},Z.done=e=>{Z.update(e,{progress:1})},Z.onChange=function(e){return xb.add(e),()=>{xb.delete(e)}},Z.play=e=>LC(!0,e),Z.pause=e=>LC(!1,e);const q$=typeof window<"u"?v.useLayoutEffect:v.useEffect,Gf=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return Te.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},pv={info:function(e){return Te.createElement(Gf,{...e},Te.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return Te.createElement(Gf,{...e},Te.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return Te.createElement(Gf,{...e},Te.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return Te.createElement(Gf,{...e},Te.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Te.createElement("div",{className:"Toastify__spinner"})}},K$=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:o}=z$(e),{closeButton:a,children:c,autoClose:u,onClick:l,type:d,hideProgressBar:p,closeToast:f,transition:h,position:g,className:m,style:x,bodyClassName:b,bodyStyle:y,progressClassName:w,progressStyle:S,updateId:k,role:C,progress:T,rtl:E,toastId:N,deleteToast:P,isIn:q,isLoading:O,closeOnClick:Y,theme:B}=e,ee=yo("Toastify__toast",`Toastify__toast-theme--${B}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":E},{"Toastify__toast--close-on-click":Y}),K=Cr(m)?m({rtl:E,position:g,type:d,defaultClassName:ee}):yo(ee,m),V=function(se){let{theme:H,type:oe,isLoading:Q,icon:ne}=se,re=null;const W={theme:H,type:oe};return ne===!1||(Cr(ne)?re=ne({...W,isLoading:Q}):v.isValidElement(ne)?re=v.cloneElement(ne,W):Q?re=pv.spinner():(ge=>ge in pv)(oe)&&(re=pv[oe](W))),re}(e),A=!!T||!u,D={closeToast:f,type:d,theme:B};let X=null;return a===!1||(X=Cr(a)?a(D):v.isValidElement(a)?v.cloneElement(a,D):function(se){let{closeToast:H,theme:oe,ariaLabel:Q="close"}=se;return Te.createElement("button",{className:`Toastify__close-button Toastify__close-button--${oe}`,type:"button",onClick:ne=>{ne.stopPropagation(),H(ne)},"aria-label":Q},Te.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Te.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(D)),Te.createElement(h,{isIn:q,done:P,position:g,preventExitTransition:n,nodeRef:r,playToast:o},Te.createElement("div",{id:N,onClick:l,"data-in":q,className:K,...s,style:x,ref:r},Te.createElement("div",{...q&&{role:C},className:Cr(b)?b({type:d}):yo("Toastify__toast-body",b),style:y},V!=null&&Te.createElement("div",{className:yo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!O})},V),Te.createElement("div",null,c)),X,Te.createElement(U$,{...k&&!A?{key:`pb-${k}`}:{},rtl:E,theme:B,delay:u,isRunning:t,isIn:q,closeToast:f,hide:p,type:d,style:S,className:w,controlledProgress:A,progress:T||0})))},_g=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},W$=Ng(_g("bounce",!0));Ng(_g("slide",!0));Ng(_g("zoom"));Ng(_g("flip"));const G$={position:"top-right",transition:W$,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function J$(e){let t={...G$,...e};const n=e.stacked,[r,s]=v.useState(!0),o=v.useRef(null),{getToastToRender:a,isToastActive:c,count:u}=B$(t),{className:l,style:d,rtl:p,containerId:f}=t;function h(m){const x=yo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":p});return Cr(l)?l({position:m,rtl:p,defaultClassName:x}):yo(x,Pp(l))}function g(){n&&(s(!0),Z.play())}return q$(()=>{if(n){var m;const x=o.current.querySelectorAll('[data-in="true"]'),b=12,y=(m=t.position)==null?void 0:m.includes("top");let w=0,S=0;Array.from(x).reverse().forEach((k,C)=>{const T=k;T.classList.add("Toastify__toast--stacked"),C>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=y?"top":"bot");const E=w*(r?.2:1)+(r?0:b*C);T.style.setProperty("--y",`${y?E:-1*E}px`),T.style.setProperty("--g",`${b}`),T.style.setProperty("--s",""+(1-(r?S:0))),w+=T.offsetHeight,S+=.025})}},[r,u,n]),Te.createElement("div",{ref:o,className:"Toastify",id:f,onMouseEnter:()=>{n&&(s(!1),Z.pause())},onMouseLeave:g},a((m,x)=>{const b=x.length?{...d}:{...d,pointerEvents:"none"};return Te.createElement("div",{className:h(m),style:b,key:`container-${m}`},x.map(y=>{let{content:w,props:S}=y;return Te.createElement(K$,{...S,stacked:n,collapseAll:g,isIn:c(S.toastId,S.containerId),style:S.style,key:`toast-${S.key}`},w)}))}))}const Q$={theme:"system",setTheme:()=>null},HN=v.createContext(Q$);function Z$({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,o]=v.useState(()=>localStorage.getItem(n)||t);v.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),s==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(s)},[s]);const a={theme:s,setTheme:c=>{localStorage.setItem(n,c),o(c)}};return i.jsx(HN.Provider,{...r,value:a,children:e})}const Mg=()=>{const e=v.useContext(HN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};let hv=!1;const qN=new xF({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e){return e>=3?(hv===!1&&(hv=!0,Z.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{hv=!1}})),!1):!0}}}});var wn=(e=>(e.API_URL="apiUrl",e.TOKEN="token",e.INSTANCE_ID="instanceId",e.INSTANCE_NAME="instanceName",e.INSTANCE_TOKEN="instanceToken",e.VERSION="version",e.FACEBOOK_APP_ID="facebookAppId",e.FACEBOOK_CONFIG_ID="facebookConfigId",e.FACEBOOK_USER_TOKEN="facebookUserToken",e.CLIENT_NAME="clientName",e))(wn||{});const KN=async e=>{if(e.url){const t=e.url.endsWith("/")?e.url.slice(0,-1):e.url;localStorage.setItem("apiUrl",t)}e.token&&localStorage.setItem("token",e.token),e.version&&localStorage.setItem("version",e.version),e.facebookAppId&&localStorage.setItem("facebookAppId",e.facebookAppId),e.facebookConfigId&&localStorage.setItem("facebookConfigId",e.facebookConfigId),e.facebookUserToken&&localStorage.setItem("facebookUserToken",e.facebookUserToken),e.clientName&&localStorage.setItem("clientName",e.clientName)},WN=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName")},Kr=e=>localStorage.getItem(e),Ot=({children:e})=>{const t=Kr(wn.API_URL),n=Kr(wn.TOKEN),r=Kr(wn.VERSION);return!t||!n||!r?i.jsx(LN,{to:"/manager/login"}):e},Y$=({children:e})=>{const t=Kr(wn.API_URL),n=Kr(wn.TOKEN),r=Kr(wn.VERSION);return t&&n&&r?i.jsx(LN,{to:"/"}):e};function GN(e,t){return function(){return e.apply(t,arguments)}}const{toString:X$}=Object.prototype,{getPrototypeOf:xw}=Object,Rg=(e=>t=>{const n=X$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cs=e=>(e=e.toLowerCase(),t=>Rg(t)===e),Pg=e=>t=>typeof t===e,{isArray:$c}=Array,Nd=Pg("undefined");function eB(e){return e!==null&&!Nd(e)&&e.constructor!==null&&!Nd(e.constructor)&&Wr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const JN=Cs("ArrayBuffer");function tB(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&JN(e.buffer),t}const nB=Pg("string"),Wr=Pg("function"),QN=Pg("number"),Og=e=>e!==null&&typeof e=="object",rB=e=>e===!0||e===!1,Op=e=>{if(Rg(e)!=="object")return!1;const t=xw(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},sB=Cs("Date"),oB=Cs("File"),aB=Cs("Blob"),iB=Cs("FileList"),lB=e=>Og(e)&&Wr(e.pipe),cB=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Wr(e.append)&&((t=Rg(e))==="formdata"||t==="object"&&Wr(e.toString)&&e.toString()==="[object FormData]"))},uB=Cs("URLSearchParams"),[dB,fB,pB,hB]=["ReadableStream","Request","Response","Headers"].map(Cs),gB=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function df(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),$c(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const YN=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,XN=e=>!Nd(e)&&e!==YN;function wb(){const{caseless:e}=XN(this)&&this||{},t={},n=(r,s)=>{const o=e&&ZN(t,s)||s;Op(t[o])&&Op(r)?t[o]=wb(t[o],r):Op(r)?t[o]=wb({},r):$c(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(df(t,(s,o)=>{n&&Wr(s)?e[o]=GN(s,n):e[o]=s},{allOwnKeys:r}),e),vB=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yB=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},bB=(e,t,n,r)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&xw(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xB=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},wB=e=>{if(!e)return null;if($c(e))return e;let t=e.length;if(!QN(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},SB=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&xw(Uint8Array)),CB=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},kB=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},EB=Cs("HTMLFormElement"),jB=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),TB=Cs("RegExp"),e_=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};df(n,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(r[o]=a||s)}),Object.defineProperties(e,r)},NB=e=>{e_(e,(t,n)=>{if(Wr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Wr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},_B=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return $c(e)?r(e):r(String(e).split(t)),n},MB=()=>{},RB=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,gv="abcdefghijklmnopqrstuvwxyz",BC="0123456789",t_={DIGIT:BC,ALPHA:gv,ALPHA_DIGIT:gv+gv.toUpperCase()+BC},PB=(e=16,t=t_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function OB(e){return!!(e&&Wr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const IB=e=>{const t=new Array(10),n=(r,s)=>{if(Og(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=$c(r)?[]:{};return df(r,(a,c)=>{const u=n(a,s+1);!Nd(u)&&(o[c]=u)}),t[s]=void 0,o}}return r};return n(e,0)},DB=Cs("AsyncFunction"),AB=e=>e&&(Og(e)||Wr(e))&&Wr(e.then)&&Wr(e.catch),G={isArray:$c,isArrayBuffer:JN,isBuffer:eB,isFormData:cB,isArrayBufferView:tB,isString:nB,isNumber:QN,isBoolean:rB,isObject:Og,isPlainObject:Op,isReadableStream:dB,isRequest:fB,isResponse:pB,isHeaders:hB,isUndefined:Nd,isDate:sB,isFile:oB,isBlob:aB,isRegExp:TB,isFunction:Wr,isStream:lB,isURLSearchParams:uB,isTypedArray:SB,isFileList:iB,forEach:df,merge:wb,extend:mB,trim:gB,stripBOM:vB,inherits:yB,toFlatObject:bB,kindOf:Rg,kindOfTest:Cs,endsWith:xB,toArray:wB,forEachEntry:CB,matchAll:kB,isHTMLForm:EB,hasOwnProperty:$C,hasOwnProp:$C,reduceDescriptors:e_,freezeMethods:NB,toObjectSet:_B,toCamelCase:jB,noop:MB,toFiniteNumber:RB,findKey:ZN,global:YN,isContextDefined:XN,ALPHABET:t_,generateString:PB,isSpecCompliantForm:OB,toJSONObject:IB,isAsyncFn:DB,isThenable:AB};function Ge(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}G.inherits(Ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const n_=Ge.prototype,r_={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{r_[e]={value:e}});Object.defineProperties(Ge,r_);Object.defineProperty(n_,"isAxiosError",{value:!0});Ge.from=(e,t,n,r,s,o)=>{const a=Object.create(n_);return G.toFlatObject(e,a,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),Ge.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const FB=null;function Sb(e){return G.isPlainObject(e)||G.isArray(e)}function s_(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function zC(e,t,n){return e?e.concat(t).map(function(s,o){return s=s_(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function LB(e){return G.isArray(e)&&!e.some(Sb)}const $B=G.toFlatObject(G,{},null,function(t){return/^is[A-Z]/.test(t)});function Ig(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,x){return!G.isUndefined(x[m])});const r=n.metaTokens,s=n.visitor||d,o=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(s))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(G.isDate(g))return g.toISOString();if(!u&&G.isBlob(g))throw new Ge("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(g)||G.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,x){let b=g;if(g&&!x&&typeof g=="object"){if(G.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(G.isArray(g)&&LB(g)||(G.isFileList(g)||G.endsWith(m,"[]"))&&(b=G.toArray(g)))return m=s_(m),b.forEach(function(w,S){!(G.isUndefined(w)||w===null)&&t.append(a===!0?zC([m],S,o):a===null?m:m+"[]",l(w))}),!1}return Sb(g)?!0:(t.append(zC(x,m,o),l(g)),!1)}const p=[],f=Object.assign($B,{defaultVisitor:d,convertValue:l,isVisitable:Sb});function h(g,m){if(!G.isUndefined(g)){if(p.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(g),G.forEach(g,function(b,y){(!(G.isUndefined(b)||b===null)&&s.call(t,b,G.isString(y)?y.trim():y,m,f))===!0&&h(b,m?m.concat(y):[y])}),p.pop()}}if(!G.isObject(e))throw new TypeError("data must be an object");return h(e),t}function UC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ww(e,t){this._pairs=[],e&&Ig(e,this,t)}const o_=ww.prototype;o_.append=function(t,n){this._pairs.push([t,n])};o_.toString=function(t){const n=t?function(r){return t.call(this,r,UC)}:UC;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function BB(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function a_(e,t,n){if(!t)return e;const r=n&&n.encode||BB,s=n&&n.serialize;let o;if(s?o=s(t,n):o=G.isURLSearchParams(t)?t.toString():new ww(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class VC{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){G.forEach(this.handlers,function(r){r!==null&&t(r)})}}const i_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zB=typeof URLSearchParams<"u"?URLSearchParams:ww,UB=typeof FormData<"u"?FormData:null,VB=typeof Blob<"u"?Blob:null,HB={isBrowser:!0,classes:{URLSearchParams:zB,FormData:UB,Blob:VB},protocols:["http","https","file","blob","url","data"]},Sw=typeof window<"u"&&typeof document<"u",qB=(e=>Sw&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),KB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",WB=Sw&&window.location.href||"http://localhost",GB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Sw,hasStandardBrowserEnv:qB,hasStandardBrowserWebWorkerEnv:KB,origin:WB},Symbol.toStringTag,{value:"Module"})),hs={...GB,...HB};function JB(e,t){return Ig(e,new hs.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return hs.isNode&&G.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function QB(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ZB(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return a=!a&&G.isArray(s)?s.length:a,u?(G.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!G.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],o)&&G.isArray(s[a])&&(s[a]=ZB(s[a])),!c)}if(G.isFormData(e)&&G.isFunction(e.entries)){const n={};return G.forEachEntry(e,(r,s)=>{t(QB(r),s,n,0)}),n}return null}function YB(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ff={transitional:i_,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=G.isObject(t);if(o&&G.isHTMLForm(t)&&(t=new FormData(t)),G.isFormData(t))return s?JSON.stringify(l_(t)):t;if(G.isArrayBuffer(t)||G.isBuffer(t)||G.isStream(t)||G.isFile(t)||G.isBlob(t)||G.isReadableStream(t))return t;if(G.isArrayBufferView(t))return t.buffer;if(G.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return JB(t,this.formSerializer).toString();if((c=G.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ig(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),YB(t)):t}],transformResponse:[function(t){const n=this.transitional||ff.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(G.isResponse(t)||G.isReadableStream(t))return t;if(t&&G.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?Ge.from(c,Ge.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:hs.classes.FormData,Blob:hs.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{ff.headers[e]={}});const XB=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),e3=e=>{const t={};let n,r,s;return e&&e.split(` +`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&XB[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},HC=Symbol("internals");function hu(e){return e&&String(e).trim().toLowerCase()}function Ip(e){return e===!1||e==null?e:G.isArray(e)?e.map(Ip):String(e)}function t3(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const n3=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mv(e,t,n,r,s){if(G.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!G.isString(t)){if(G.isString(r))return t.indexOf(r)!==-1;if(G.isRegExp(r))return r.test(t)}}function r3(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function s3(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,a){return this[r].call(this,t,s,o,a)},configurable:!0})})}let dr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,u,l){const d=hu(u);if(!d)throw new Error("header name must be a non-empty string");const p=G.findKey(s,d);(!p||s[p]===void 0||l===!0||l===void 0&&s[p]!==!1)&&(s[p||u]=Ip(c))}const a=(c,u)=>G.forEach(c,(l,d)=>o(l,d,u));if(G.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(G.isString(t)&&(t=t.trim())&&!n3(t))a(e3(t),n);else if(G.isHeaders(t))for(const[c,u]of t.entries())o(u,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=hu(t),t){const r=G.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return t3(s);if(G.isFunction(n))return n.call(this,s,r);if(G.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=hu(t),t){const r=G.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||mv(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(a){if(a=hu(a),a){const c=G.findKey(r,a);c&&(!n||mv(r,r[c],c,n))&&(delete r[c],s=!0)}}return G.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||mv(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return G.forEach(this,(s,o)=>{const a=G.findKey(r,o);if(a){n[a]=Ip(s),delete n[o];return}const c=t?r3(o):String(o).trim();c!==o&&delete n[o],n[c]=Ip(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return G.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&G.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[HC]=this[HC]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=hu(a);r[c]||(s3(s,a),r[c]=!0)}return G.isArray(t)?t.forEach(o):o(t),this}};dr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.reduceDescriptors(dr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});G.freezeMethods(dr);function vv(e,t){const n=this||ff,r=t||n,s=dr.from(r.headers);let o=r.data;return G.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function c_(e){return!!(e&&e.__CANCEL__)}function Bc(e,t,n){Ge.call(this,e??"canceled",Ge.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(Bc,Ge,{__CANCEL__:!0});function u_(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ge("Request failed with status code "+n.status,[Ge.ERR_BAD_REQUEST,Ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function o3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function a3(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),d=r[o];a||(a=l),n[s]=u,r[s]=l;let p=o,f=0;for(;p!==s;)f+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-ar)return s&&(clearTimeout(s),s=null),n=c,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),r-(c-n)))}}const jh=(e,t,n=3)=>{let r=0;const s=a3(50,250);return i3(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,u=a-r,l=s(u),d=a<=c;r=a;const p={loaded:a,total:c,progress:c?a/c:void 0,bytes:u,rate:l||void 0,estimated:l&&c&&d?(c-a)/l:void 0,event:o,lengthComputable:c!=null};p[t?"download":"upload"]=!0,e(p)},n)},l3=hs.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const c=G.isString(a)?s(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),c3=hs.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const a=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),G.isString(r)&&a.push("path="+r),G.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function u3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function d3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function d_(e,t){return e&&!u3(t)?d3(e,t):t}const qC=e=>e instanceof dr?{...e}:e;function Bi(e,t){t=t||{};const n={};function r(l,d,p){return G.isPlainObject(l)&&G.isPlainObject(d)?G.merge.call({caseless:p},l,d):G.isPlainObject(d)?G.merge({},d):G.isArray(d)?d.slice():d}function s(l,d,p){if(G.isUndefined(d)){if(!G.isUndefined(l))return r(void 0,l,p)}else return r(l,d,p)}function o(l,d){if(!G.isUndefined(d))return r(void 0,d)}function a(l,d){if(G.isUndefined(d)){if(!G.isUndefined(l))return r(void 0,l)}else return r(void 0,d)}function c(l,d,p){if(p in t)return r(l,d);if(p in e)return r(void 0,l)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(l,d)=>s(qC(l),qC(d),!0)};return G.forEach(Object.keys(Object.assign({},e,t)),function(d){const p=u[d]||s,f=p(e[d],t[d],d);G.isUndefined(f)&&p!==c||(n[d]=f)}),n}const f_=e=>{const t=Bi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=dr.from(a),t.url=a_(d_(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(G.isFormData(n)){if(hs.hasStandardBrowserEnv||hs.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[l,...d]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([l||"multipart/form-data",...d].join("; "))}}if(hs.hasStandardBrowserEnv&&(r&&G.isFunction(r)&&(r=r(t)),r||r!==!1&&l3(t.url))){const l=s&&o&&c3.read(o);l&&a.set(s,l)}return t},f3=typeof XMLHttpRequest<"u",p3=f3&&function(e){return new Promise(function(n,r){const s=f_(e);let o=s.data;const a=dr.from(s.headers).normalize();let{responseType:c}=s,u;function l(){s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(s.method.toUpperCase(),s.url,!0),d.timeout=s.timeout;function p(){if(!d)return;const h=dr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),m={data:!c||c==="text"||c==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:h,config:e,request:d};u_(function(b){n(b),l()},function(b){r(b),l()},m),d=null}"onloadend"in d?d.onloadend=p:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(p)},d.onabort=function(){d&&(r(new Ge("Request aborted",Ge.ECONNABORTED,s,d)),d=null)},d.onerror=function(){r(new Ge("Network Error",Ge.ERR_NETWORK,s,d)),d=null},d.ontimeout=function(){let g=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const m=s.transitional||i_;s.timeoutErrorMessage&&(g=s.timeoutErrorMessage),r(new Ge(g,m.clarifyTimeoutError?Ge.ETIMEDOUT:Ge.ECONNABORTED,s,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&G.forEach(a.toJSON(),function(g,m){d.setRequestHeader(m,g)}),G.isUndefined(s.withCredentials)||(d.withCredentials=!!s.withCredentials),c&&c!=="json"&&(d.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&d.addEventListener("progress",jh(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",jh(s.onUploadProgress)),(s.cancelToken||s.signal)&&(u=h=>{d&&(r(!h||h.type?new Bc(null,e,d):h),d.abort(),d=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const f=o3(s.url);if(f&&hs.protocols.indexOf(f)===-1){r(new Ge("Unsupported protocol "+f+":",Ge.ERR_BAD_REQUEST,e));return}d.send(o||null)})},h3=(e,t)=>{let n=new AbortController,r;const s=function(u){if(!r){r=!0,a();const l=u instanceof Error?u:this.reason;n.abort(l instanceof Ge?l:new Bc(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{s(new Ge(`timeout ${t} of ms exceeded`,Ge.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u&&(u.removeEventListener?u.removeEventListener("abort",s):u.unsubscribe(s))}),e=null)};e.forEach(u=>u&&u.addEventListener&&u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{o&&clearTimeout(o),o=null}]},g3=function*(e,t){let n=e.byteLength;if(!t||n{const o=m3(e,t,s);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:u,value:l}=await o.next();if(u){c.close(),r();return}let d=l.byteLength;n&&n(a+=d),c.enqueue(new Uint8Array(l))},cancel(c){return r(c),o.return()}},{highWaterMark:2})},WC=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},Dg=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",p_=Dg&&typeof ReadableStream=="function",Cb=Dg&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),v3=p_&&(()=>{let e=!1;const t=new Request(hs.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),GC=64*1024,kb=p_&&!!(()=>{try{return G.isReadableStream(new Response("").body)}catch{}})(),Th={stream:kb&&(e=>e.body)};Dg&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Th[t]&&(Th[t]=G.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ge(`Response type '${t}' is not supported`,Ge.ERR_NOT_SUPPORT,r)})})})(new Response);const y3=async e=>{if(e==null)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(G.isArrayBufferView(e))return e.byteLength;if(G.isURLSearchParams(e)&&(e=e+""),G.isString(e))return(await Cb(e)).byteLength},b3=async(e,t)=>{const n=G.toFiniteNumber(e.getContentLength());return n??y3(t)},x3=Dg&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:u,responseType:l,headers:d,withCredentials:p="same-origin",fetchOptions:f}=f_(e);l=l?(l+"").toLowerCase():"text";let[h,g]=s||o||a?h3([s,o],a):[],m,x;const b=()=>{!m&&setTimeout(()=>{h&&h.unsubscribe()}),m=!0};let y;try{if(u&&v3&&n!=="get"&&n!=="head"&&(y=await b3(d,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),T;G.isFormData(r)&&(T=C.headers.get("content-type"))&&d.setContentType(T),C.body&&(r=KC(C.body,GC,WC(y,jh(u)),null,Cb))}G.isString(p)||(p=p?"cors":"omit"),x=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",withCredentials:p});let w=await fetch(x);const S=kb&&(l==="stream"||l==="response");if(kb&&(c||S)){const C={};["status","statusText","headers"].forEach(E=>{C[E]=w[E]});const T=G.toFiniteNumber(w.headers.get("content-length"));w=new Response(KC(w.body,GC,c&&WC(T,jh(c,!0)),S&&b,Cb),C)}l=l||"text";let k=await Th[G.findKey(Th,l)||"text"](w,e);return!S&&b(),g&&g(),await new Promise((C,T)=>{u_(C,T,{data:k,headers:dr.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:x})})}catch(w){throw b(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Ge("Network Error",Ge.ERR_NETWORK,e,x),{cause:w.cause||w}):Ge.from(w,w&&w.code,e,x)}}),Eb={http:FB,xhr:p3,fetch:x3};G.forEach(Eb,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const JC=e=>`- ${e}`,w3=e=>G.isFunction(e)||e===null||e===!1,h_={getAdapter:e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : +`+o.map(JC).join(` +`):" "+JC(o[0]):"as no adapter specified";throw new Ge("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Eb};function yv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bc(null,e)}function QC(e){return yv(e),e.headers=dr.from(e.headers),e.data=vv.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),h_.getAdapter(e.adapter||ff.adapter)(e).then(function(r){return yv(e),r.data=vv.call(e,e.transformResponse,r),r.headers=dr.from(r.headers),r},function(r){return c_(r)||(yv(e),r&&r.response&&(r.response.data=vv.call(e,e.transformResponse,r.response),r.response.headers=dr.from(r.response.headers))),Promise.reject(r)})}const g_="1.7.2",Cw={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Cw[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ZC={};Cw.transitional=function(t,n,r){function s(o,a){return"[Axios v"+g_+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(t===!1)throw new Ge(s(a," has been removed"+(n?" in "+n:"")),Ge.ERR_DEPRECATED);return n&&!ZC[a]&&(ZC[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function S3(e,t,n){if(typeof e!="object")throw new Ge("options must be an object",Ge.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],a=t[o];if(a){const c=e[o],u=c===void 0||a(c,o,e);if(u!==!0)throw new Ge("option "+o+" must be "+u,Ge.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ge("Unknown option "+o,Ge.ERR_BAD_OPTION)}}const jb={assertOptions:S3,validators:Cw},Wo=jb.validators;let Ni=class{constructor(t){this.defaults=t,this.interceptors={request:new VC,response:new VC}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Bi(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&jb.assertOptions(r,{silentJSONParsing:Wo.transitional(Wo.boolean),forcedJSONParsing:Wo.transitional(Wo.boolean),clarifyTimeoutError:Wo.transitional(Wo.boolean)},!1),s!=null&&(G.isFunction(s)?n.paramsSerializer={serialize:s}:jb.assertOptions(s,{encode:Wo.function,serialize:Wo.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&G.merge(o.common,o[n.method]);o&&G.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=dr.concat(a,o);const c=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let d,p=0,f;if(!u){const g=[QC.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,l),f=g.length,d=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,c){r.reason||(r.reason=new Bc(o,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new m_(function(s){t=s}),cancel:t}}};function k3(e){return function(n){return e.apply(null,n)}}function E3(e){return G.isObject(e)&&e.isAxiosError===!0}const Tb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tb).forEach(([e,t])=>{Tb[t]=e});function v_(e){const t=new Ni(e),n=GN(Ni.prototype.request,t);return G.extend(n,Ni.prototype,t,{allOwnKeys:!0}),G.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return v_(Bi(e,s))},n}const Lt=v_(ff);Lt.Axios=Ni;Lt.CanceledError=Bc;Lt.CancelToken=C3;Lt.isCancel=c_;Lt.VERSION=g_;Lt.toFormData=Ig;Lt.AxiosError=Ge;Lt.Cancel=Lt.CanceledError;Lt.all=function(t){return Promise.all(t)};Lt.spread=k3;Lt.isAxiosError=E3;Lt.mergeConfig=Bi;Lt.AxiosHeaders=dr;Lt.formToJSON=e=>l_(G.isHTMLForm(e)?new FormData(e):e);Lt.getAdapter=h_.getAdapter;Lt.HttpStatusCode=Tb;Lt.default=Lt;const{Axios:Hle,AxiosError:qle,CanceledError:Kle,isCancel:Wle,CancelToken:Gle,VERSION:Jle,all:Qle,Cancel:Zle,isAxiosError:y_,spread:Yle,toFormData:Xle,AxiosHeaders:ece,HttpStatusCode:tce,formToJSON:nce,getAdapter:rce,mergeConfig:sce}=Lt,j3=e=>["auth","verifyServer",JSON.stringify(e)],b_=async({url:e})=>(await Lt.get(`${e}/`)).data,T3=e=>{const{url:t,...n}=e;return We({...n,queryKey:j3({url:t}),queryFn:()=>b_({url:t}),enabled:!!t})};function N3(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ag(...e){return t=>e.forEach(n=>N3(n,t))}function ft(...e){return v.useCallback(Ag(...e),e)}var No=v.forwardRef((e,t)=>{const{children:n,...r}=e,s=v.Children.toArray(n),o=s.find(M3);if(o){const a=o.props.children,c=s.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return i.jsx(Nb,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,c):null})}return i.jsx(Nb,{...r,ref:t,children:n})});No.displayName="Slot";var Nb=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const s=P3(n);return v.cloneElement(n,{...R3(r,n.props),ref:t?Ag(t,s):s})}return v.Children.count(n)>1?v.Children.only(null):null});Nb.displayName="SlotClone";var _3=({children:e})=>i.jsx(i.Fragment,{children:e});function M3(e){return v.isValidElement(e)&&e.type===_3}function R3(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{o(...c),s(...c)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function P3(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function x_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,XC=O3,Fg=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return XC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(l=>{const d=n==null?void 0:n[l],p=o==null?void 0:o[l];if(d===null)return null;const f=YC(d)||YC(p);return s[l][f]}),c=n&&Object.entries(n).reduce((l,d)=>{let[p,f]=d;return f===void 0||(l[p]=f),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:p,className:f,...h}=d;return Object.entries(h).every(g=>{let[m,x]=g;return Array.isArray(x)?x.includes({...o,...c}[m]):{...o,...c}[m]===x})?[...l,p,f]:l},[]);return XC(e,a,u,n==null?void 0:n.class,n==null?void 0:n.className)},kw="-";function I3(e){const t=A3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(a){const c=a.split(kw);return c[0]===""&&c.length!==1&&c.shift(),w_(c,t)||D3(a)}function o(a,c){const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function w_(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?w_(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(kw);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId}const e1=/^\[(.+)\]$/;function D3(e){if(e1.test(e)){const t=e1.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function A3(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return L3(Object.entries(e.classGroups),n).forEach(([o,a])=>{_b(a,r,o,t)}),r}function _b(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:t1(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(F3(s)){_b(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{_b(a,t1(t,o),n,r)})})}function t1(e,t){let n=e;return t.split(kw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function F3(e){return e.isThemeGetter}function L3(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e}function $3(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,a){n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}}const S_="!";function B3(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length;function a(c){const u=[];let l=0,d=0,p;for(let x=0;xd?p-d:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}}return n?function(u){return n({className:u,parseClassName:a})}:a}function z3(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function U3(e){return{cache:$3(e.cacheSize),parseClassName:B3(e),...I3(e)}}const V3=/\s+/;function H3(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(V3).map(a=>{const{modifiers:c,hasImportantModifier:u,baseClassName:l,maybePostfixModifierPosition:d}=n(a);let p=!!d,f=r(p?l.substring(0,d):l);if(!f){if(!p)return{isTailwindClass:!1,originalClassName:a};if(f=r(l),!f)return{isTailwindClass:!1,originalClassName:a};p=!1}const h=z3(c).join(":");return{isTailwindClass:!0,modifierId:u?h+S_:h,classGroupId:f,originalClassName:a,hasPostfixModifier:p}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:c,classGroupId:u,hasPostfixModifier:l}=a,d=c+u;return o.has(d)?!1:(o.add(d),s(u,l).forEach(p=>o.add(c+p)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function q3(){let e=0,t,n,r="";for(;ep(d),e());return n=U3(l),r=n.cache.get,s=n.cache.set,o=c,c(u)}function c(u){const l=r(u);if(l)return l;const d=H3(u,n);return s(u,d),d}return function(){return o(q3.apply(null,arguments))}}function It(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const k_=/^\[(?:([a-z-]+):)?(.+)\]$/i,W3=/^\d+\/\d+$/,G3=new Set(["px","full","screen"]),J3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Y3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function so(e){return di(e)||G3.has(e)||W3.test(e)}function Go(e){return zc(e,"length",iz)}function di(e){return!!e&&!Number.isNaN(Number(e))}function Jf(e){return zc(e,"number",di)}function gu(e){return!!e&&Number.isInteger(Number(e))}function ez(e){return e.endsWith("%")&&di(e.slice(0,-1))}function Ze(e){return k_.test(e)}function Jo(e){return J3.test(e)}const tz=new Set(["length","size","percentage"]);function nz(e){return zc(e,tz,E_)}function rz(e){return zc(e,"position",E_)}const sz=new Set(["image","url"]);function oz(e){return zc(e,sz,cz)}function az(e){return zc(e,"",lz)}function mu(){return!0}function zc(e,t,n){const r=k_.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function iz(e){return Q3.test(e)&&!Z3.test(e)}function E_(){return!1}function lz(e){return Y3.test(e)}function cz(e){return X3.test(e)}function uz(){const e=It("colors"),t=It("spacing"),n=It("blur"),r=It("brightness"),s=It("borderColor"),o=It("borderRadius"),a=It("borderSpacing"),c=It("borderWidth"),u=It("contrast"),l=It("grayscale"),d=It("hueRotate"),p=It("invert"),f=It("gap"),h=It("gradientColorStops"),g=It("gradientColorStopPositions"),m=It("inset"),x=It("margin"),b=It("opacity"),y=It("padding"),w=It("saturate"),S=It("scale"),k=It("sepia"),C=It("skew"),T=It("space"),E=It("translate"),N=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Ze,t],O=()=>[Ze,t],Y=()=>["",so,Go],B=()=>["auto",di,Ze],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ze],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[di,Jf],H=()=>[di,Ze];return{cacheSize:500,separator:":",theme:{colors:[mu],spacing:[so,Go],blur:["none","",Jo,Ze],brightness:se(),borderColor:[e],borderRadius:["none","","full",Jo,Ze],borderSpacing:O(),borderWidth:Y(),contrast:se(),grayscale:D(),hueRotate:H(),invert:D(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[ez,Go],inset:q(),margin:q(),opacity:se(),padding:O(),saturate:se(),scale:se(),sepia:D(),skew:H(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Ze]}],container:["container"],columns:[{columns:[Jo]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ee(),Ze]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gu,Ze]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ze]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",gu,Ze]}],"grid-cols":[{"grid-cols":[mu]}],"col-start-end":[{col:["auto",{span:["full",gu,Ze]},Ze]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[mu]}],"row-start-end":[{row:["auto",{span:[gu,Ze]},Ze]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ze]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ze,t]}],"min-w":[{"min-w":[Ze,t,"min","max","fit"]}],"max-w":[{"max-w":[Ze,t,"none","full","min","max","fit","prose",{screen:[Jo]},Jo]}],h:[{h:[Ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jo,Go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jf]}],"font-family":[{font:[mu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ze]}],"line-clamp":[{"line-clamp":["none",di,Jf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",so,Ze]}],"list-image":[{"list-image":["none",Ze]}],"list-style-type":[{list:["none","disc","decimal",Ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",so,Go]}],"underline-offset":[{"underline-offset":["auto",so,Ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),rz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:K()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[so,Ze]}],"outline-w":[{outline:[so,Go]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[so,Go]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jo,az]}],"shadow-color":[{shadow:[mu]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Jo,Ze]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[w]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ze]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Ze]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[gu,Ze]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ze]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[so,Go,Jf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const dz=K3(uz);function ve(...e){return dz(yo(e))}const fz=Fg("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",warning:"bg-amber-600 shadow-sm hover:bg-amber-600/90 data-active:bg-amber-600/90 text-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const a=r?No:"button";return i.jsx(a,{className:ve(fz({variant:t,size:n,className:e})),ref:o,...s})});$.displayName="Button";function Ew(){const{t:e}=Ee(),t=Kr(wn.API_URL),{data:n}=T3({url:t}),r=v.useMemo(()=>n==null?void 0:n.clientName,[n]),s=v.useMemo(()=>n==null?void 0:n.version,[n]),o=[{name:"Discord",url:"https://evolution-api.com/discord"},{name:"Postman",url:"https://evolution-api.com/postman"},{name:"GitHub",url:"https://github.com/EvolutionAPI/evolution-api"},{name:"Docs",url:"https://doc.evolution-api.com"}];return i.jsxs("footer",{className:"flex w-full flex-col items-center justify-between p-6 text-xs text-secondary-foreground sm:flex-row",children:[i.jsxs("div",{className:"flex items-center space-x-3 divide-x",children:[r&&r!==""&&i.jsxs("span",{children:[e("footer.clientName"),": ",i.jsx("strong",{children:r})]}),s&&s!==""&&i.jsxs("span",{className:"pl-3",children:[e("footer.version"),": ",i.jsx("strong",{children:s})]})]}),i.jsx("div",{className:"flex gap-2",children:o.map(a=>i.jsx($,{variant:"link",asChild:!0,size:"sm",className:"text-xs",children:i.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",children:a.name})},a.url))})]})}/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j_=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var hz={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gz=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>v.createElement("svg",{ref:u,...hz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:j_("lucide",s),...c},[...a.map(([l,d])=>v.createElement(l,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Re=(e,t)=>{const n=v.forwardRef(({className:r,...s},o)=>v.createElement(gz,{ref:o,iconNode:t,className:j_(`lucide-${pz(e)}`,r),...s}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n1=Re("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jw=Re("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mz=Re("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vz=Re("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T_=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lg=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yz=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bz=Re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xz=Re("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wz=Re("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xi=Re("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N_=Re("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sz=Re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cz=Re("Club",[["path",{d:"M17.28 9.05a5.5 5.5 0 1 0-10.56 0A5.5 5.5 0 1 0 12 17.66a5.5 5.5 0 1 0 5.28-8.6Z",key:"27yuqz"}],["path",{d:"M12 17.66L12 22",key:"ogfahf"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Io=Re("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kz=Re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const el=Re("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ez=Re("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qa=Re("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jz=Re("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tz=Re("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nz=Re("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _z=Re("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tw=Re("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mz=Re("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rz=Re("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pz=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oz=Re("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Iz=Re("IterationCcw",[["path",{d:"M20 10c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8h8",key:"4znkd0"}],["polyline",{points:"16 14 20 18 16 22",key:"11njsm"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dz=Re("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Az=Re("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fz=Re("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lz=Re("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tl=Re("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $z=Re("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bz=Re("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cc=Re("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const __=Re("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zz=Re("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nl=Re("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rl=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yr=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nh=Re("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sl=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M_=Re("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uz=Re("Sparkle",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vz=Re("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hz=Re("Sticker",[["path",{d:"M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z",key:"1wis1t"}],["path",{d:"M14 3v4a2 2 0 0 0 2 2h4",key:"36rjfy"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qz=Re("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kz=Re("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _h=Re("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wz=Re("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gz=Re("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nw=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R_=Re("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),le=Lt.create({timeout:3e4});le.interceptors.request.use(async e=>{const t=Kr(wn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=Kr(wn.INSTANCE_TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const pf=Lt.create({timeout:3e4});pf.interceptors.request.use(async e=>{const t=Kr(wn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=Kr(wn.TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const Jz=e=>["instance","fetchInstance",JSON.stringify(e)],Qz=async({instanceId:e})=>{const t=await pf.get("/instance/fetchInstances",{params:{instanceId:e}});return Array.isArray(t.data)?t.data[0]:t.data},P_=e=>{const{instanceId:t,...n}=e;return We({...n,queryKey:Jz({instanceId:t}),queryFn:()=>Qz({instanceId:t}),enabled:!!t})};function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Zz(e,t){const n=v.createContext(t);function r(o){const{children:a,...c}=o,u=v.useMemo(()=>c,Object.values(c));return i.jsx(n.Provider,{value:u,children:a})}function s(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function Xr(e,t=[]){let n=[];function r(o,a){const c=v.createContext(a),u=n.length;n=[...n,a];function l(p){const{scope:f,children:h,...g}=p,m=(f==null?void 0:f[e][u])||c,x=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:x,children:h})}function d(p,f){const h=(f==null?void 0:f[e][u])||c,g=v.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,d]}const s=()=>{const o=n.map(a=>v.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,Yz(s,...t)]}function Yz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:l})=>{const p=u(o)[`__scope${l}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function ln(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function _a({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=Xz({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,c=ln(n),u=v.useCallback(l=>{if(o){const p=typeof l=="function"?l(e):l;p!==e&&c(p)}else s(l)},[o,e,s,c]);return[a,u]}function Xz({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,s=v.useRef(r),o=ln(t);return v.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var eU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fe=eU.reduce((e,t)=>{const n=v.forwardRef((r,s)=>{const{asChild:o,...a}=r,c=o?No:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function O_(e,t){e&&Ua.flushSync(()=>e.dispatchEvent(t))}function _w(e){const t=e+"CollectionProvider",[n,r]=Xr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:g,children:m}=h,x=Te.useRef(null),b=Te.useRef(new Map).current;return i.jsx(s,{scope:g,itemMap:b,collectionRef:x,children:m})};a.displayName=t;const c=e+"CollectionSlot",u=Te.forwardRef((h,g)=>{const{scope:m,children:x}=h,b=o(c,m),y=ft(g,b.collectionRef);return i.jsx(No,{ref:y,children:x})});u.displayName=c;const l=e+"CollectionItemSlot",d="data-radix-collection-item",p=Te.forwardRef((h,g)=>{const{scope:m,children:x,...b}=h,y=Te.useRef(null),w=ft(g,y),S=o(l,m);return Te.useEffect(()=>(S.itemMap.set(y,{ref:y,...b}),()=>void S.itemMap.delete(y))),i.jsx(No,{[d]:"",ref:w,children:x})});p.displayName=l;function f(h){const g=o(e+"CollectionConsumer",h);return Te.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,k)=>b.indexOf(S.ref.current)-b.indexOf(k.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},f,r]}var tU=v.createContext(void 0);function hf(e){const t=v.useContext(tU);return e||t||"ltr"}function nU(e,t=globalThis==null?void 0:globalThis.document){const n=ln(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rU="DismissableLayer",Mb="dismissableLayer.update",sU="dismissableLayer.pointerDownOutside",oU="dismissableLayer.focusOutside",r1,I_=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$g=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,l=v.useContext(I_),[d,p]=v.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=v.useState({}),g=ft(t,T=>p(T)),m=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),y=d?m.indexOf(d):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,S=y>=b,k=lU(T=>{const E=T.target,N=[...l.branches].some(P=>P.contains(E));!S||N||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},f),C=cU(T=>{const E=T.target;[...l.branches].some(P=>P.contains(E))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},f);return nU(T=>{y===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},f),v.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(r1=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),s1(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=r1)}},[d,f,n,l]),v.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),s1())},[d,l]),v.useEffect(()=>{const T=()=>h({});return document.addEventListener(Mb,T),()=>document.removeEventListener(Mb,T)},[]),i.jsx(Fe.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,k.onPointerDownCapture)})});$g.displayName=rU;var aU="DismissableLayerBranch",iU=v.forwardRef((e,t)=>{const n=v.useContext(I_),r=v.useRef(null),s=ft(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(Fe.div,{...e,ref:s})});iU.displayName=aU;function lU(e,t=globalThis==null?void 0:globalThis.document){const n=ln(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){D_(sU,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cU(e,t=globalThis==null?void 0:globalThis.document){const n=ln(e),r=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!r.current&&D_(oU,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function s1(){const e=new CustomEvent(Mb);document.dispatchEvent(e)}function D_(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?O_(s,o):s.dispatchEvent(o)}var bv=0;function Mw(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??o1()),document.body.insertAdjacentElement("beforeend",e[1]??o1()),bv++,()=>{bv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bv--}},[])}function o1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var xv="focusScope.autoFocusOnMount",wv="focusScope.autoFocusOnUnmount",a1={bubbles:!1,cancelable:!0},uU="FocusScope",Bg=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=v.useState(null),l=ln(s),d=ln(o),p=v.useRef(null),f=ft(t,m=>u(m)),h=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(h.paused||!c)return;const S=w.target;c.contains(S)?p.current=S:Xo(p.current,{select:!0})},x=function(w){if(h.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||Xo(p.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&Xo(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const y=new MutationObserver(b);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),y.disconnect()}}},[r,c,h.paused]),v.useEffect(()=>{if(c){l1.add(h);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(xv,a1);c.addEventListener(xv,l),c.dispatchEvent(b),b.defaultPrevented||(dU(mU(A_(c)),{select:!0}),document.activeElement===m&&Xo(c))}return()=>{c.removeEventListener(xv,l),setTimeout(()=>{const b=new CustomEvent(wv,a1);c.addEventListener(wv,d),c.dispatchEvent(b),b.defaultPrevented||Xo(m??document.body,{select:!0}),c.removeEventListener(wv,d),l1.remove(h)},0)}}},[c,l,d,h]);const g=v.useCallback(m=>{if(!n&&!r||h.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(x&&b){const y=m.currentTarget,[w,S]=fU(y);w&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&Xo(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&Xo(S,{select:!0})):b===y&&m.preventDefault()}},[n,r,h.paused]);return i.jsx(Fe.div,{tabIndex:-1,...a,ref:f,onKeyDown:g})});Bg.displayName=uU;function dU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xo(r,{select:t}),document.activeElement!==n)return}function fU(e){const t=A_(e),n=i1(t,e),r=i1(t.reverse(),e);return[n,r]}function A_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function i1(e,t){for(const n of e)if(!pU(n,{upTo:t}))return n}function pU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hU(e){return e instanceof HTMLInputElement&&"select"in e}function Xo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hU(e)&&t&&e.select()}}var l1=gU();function gU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=c1(e,t),e.unshift(t)},remove(t){var n;e=c1(e,t),(n=e[0])==null||n.resume()}}}function c1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mU(e){return e.filter(t=>t.tagName!=="A")}var mn=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},vU=lg.useId||(()=>{}),yU=0;function gs(e){const[t,n]=v.useState(vU());return mn(()=>{n(r=>r??String(yU++))},[e]),t?`radix-${t}`:""}const bU=["top","right","bottom","left"],zs=Math.min,wr=Math.max,Mh=Math.round,Qf=Math.floor,Ma=e=>({x:e,y:e}),xU={left:"right",right:"left",bottom:"top",top:"bottom"},wU={start:"end",end:"start"};function Rb(e,t,n){return wr(e,zs(t,n))}function _o(e,t){return typeof e=="function"?e(t):e}function Mo(e){return e.split("-")[0]}function Uc(e){return e.split("-")[1]}function Rw(e){return e==="x"?"y":"x"}function Pw(e){return e==="y"?"height":"width"}function Ra(e){return["top","bottom"].includes(Mo(e))?"y":"x"}function Ow(e){return Rw(Ra(e))}function SU(e,t,n){n===void 0&&(n=!1);const r=Uc(e),s=Ow(e),o=Pw(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Rh(a)),[a,Rh(a)]}function CU(e){const t=Rh(e);return[Pb(e),t,Pb(t)]}function Pb(e){return e.replace(/start|end/g,t=>wU[t])}function kU(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:a;default:return[]}}function EU(e,t,n,r){const s=Uc(e);let o=kU(Mo(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Pb)))),o}function Rh(e){return e.replace(/left|right|bottom|top/g,t=>xU[t])}function jU(e){return{top:0,right:0,bottom:0,left:0,...e}}function F_(e){return typeof e!="number"?jU(e):{top:e,right:e,bottom:e,left:e}}function Ph(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function u1(e,t,n){let{reference:r,floating:s}=e;const o=Ra(t),a=Ow(t),c=Pw(a),u=Mo(t),l=o==="y",d=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,f=r[c]/2-s[c]/2;let h;switch(u){case"top":h={x:d,y:r.y-s.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:p};break;case"left":h={x:r.x-s.width,y:p};break;default:h={x:r.x,y:r.y}}switch(Uc(t)){case"start":h[a]-=f*(n&&l?-1:1);break;case"end":h[a]+=f*(n&&l?-1:1);break}return h}const TU=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:p}=u1(l,r,u),f=r,h={},g=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:l,padding:d=0}=_o(e,t)||{};if(l==null)return{};const p=F_(d),f={x:n,y:r},h=Ow(s),g=Pw(h),m=await a.getDimensions(l),x=h==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=o.reference[g]+o.reference[h]-f[h]-o.floating[g],k=f[h]-o.reference[h],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let T=C?C[w]:0;(!T||!await(a.isElement==null?void 0:a.isElement(C)))&&(T=c.floating[w]||o.floating[g]);const E=S/2-k/2,N=T/2-m[g]/2-1,P=zs(p[b],N),q=zs(p[y],N),O=P,Y=T-m[g]-q,B=T/2-m[g]/2+E,ee=Rb(O,B,Y),K=!u.arrow&&Uc(s)!=null&&B!==ee&&o.reference[g]/2-(BB<=0)){var q,O;const B=(((q=o.flip)==null?void 0:q.index)||0)+1,ee=T[B];if(ee)return{data:{index:B,overflows:P},reset:{placement:ee}};let K=(O=P.filter(V=>V.overflows[0]<=0).sort((V,A)=>V.overflows[1]-A.overflows[1])[0])==null?void 0:O.placement;if(!K)switch(h){case"bestFit":{var Y;const V=(Y=P.filter(A=>{if(C){const D=Ra(A.placement);return D===y||D==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(D=>D>0).reduce((D,X)=>D+X,0)]).sort((A,D)=>A[1]-D[1])[0])==null?void 0:Y[0];V&&(K=V);break}case"initialPlacement":K=c;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function d1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function f1(e){return bU.some(t=>e[t]>=0)}const MU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=_o(e,t);switch(r){case"referenceHidden":{const o=await _d(t,{...s,elementContext:"reference"}),a=d1(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:f1(a)}}}case"escaped":{const o=await _d(t,{...s,altBoundary:!0}),a=d1(o,n.floating);return{data:{escapedOffsets:a,escaped:f1(a)}}}default:return{}}}}};async function RU(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Mo(n),c=Uc(n),u=Ra(n)==="y",l=["left","top"].includes(a)?-1:1,d=o&&u?-1:1,p=_o(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),u?{x:h*d,y:f*l}:{x:f*l,y:h*d}}const PU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await RU(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},OU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...u}=_o(e,t),l={x:n,y:r},d=await _d(t,u),p=Ra(Mo(s)),f=Rw(p);let h=l[f],g=l[p];if(o){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=h+d[x],w=h-d[b];h=Rb(y,h,w)}if(a){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=g+d[x],w=g-d[b];g=Rb(y,g,w)}const m=c.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},IU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=_o(e,t),d={x:n,y:r},p=Ra(s),f=Rw(p);let h=d[f],g=d[p];const m=_o(c,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const w=f==="y"?"height":"width",S=o.reference[f]-o.floating[w]+x.mainAxis,k=o.reference[f]+o.reference[w]-x.mainAxis;hk&&(h=k)}if(l){var b,y;const w=f==="y"?"width":"height",S=["top","left"].includes(Mo(s)),k=o.reference[p]-o.floating[w]+(S&&((b=a.offset)==null?void 0:b[p])||0)+(S?0:x.crossAxis),C=o.reference[p]+o.reference[w]+(S?0:((y=a.offset)==null?void 0:y[p])||0)-(S?x.crossAxis:0);gC&&(g=C)}return{[f]:h,[p]:g}}}},DU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:a=()=>{},...c}=_o(e,t),u=await _d(t,c),l=Mo(n),d=Uc(n),p=Ra(n)==="y",{width:f,height:h}=r.floating;let g,m;l==="top"||l==="bottom"?(g=l,m=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(m=l,g=d==="end"?"top":"bottom");const x=h-u.top-u.bottom,b=f-u.left-u.right,y=zs(h-u[g],x),w=zs(f-u[m],b),S=!t.middlewareData.shift;let k=y,C=w;if(p?C=d||S?zs(w,b):b:k=d||S?zs(y,x):x,S&&!d){const E=wr(u.left,0),N=wr(u.right,0),P=wr(u.top,0),q=wr(u.bottom,0);p?C=f-2*(E!==0||N!==0?E+N:wr(u.left,u.right)):k=h-2*(P!==0||q!==0?P+q:wr(u.top,u.bottom))}await a({...t,availableWidth:C,availableHeight:k});const T=await s.getDimensions(o.floating);return f!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Vc(e){return L_(e)?(e.nodeName||"").toLowerCase():"#document"}function Er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Do(e){var t;return(t=(L_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function L_(e){return e instanceof Node||e instanceof Er(e).Node}function Gs(e){return e instanceof Element||e instanceof Er(e).Element}function Js(e){return e instanceof HTMLElement||e instanceof Er(e).HTMLElement}function p1(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Er(e).ShadowRoot}function gf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=xs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function AU(e){return["table","td","th"].includes(Vc(e))}function zg(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Iw(e){const t=Dw(),n=xs(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function FU(e){let t=Pa(e);for(;Js(t)&&!kc(t);){if(zg(t))return null;if(Iw(t))return t;t=Pa(t)}return null}function Dw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function kc(e){return["html","body","#document"].includes(Vc(e))}function xs(e){return Er(e).getComputedStyle(e)}function Ug(e){return Gs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pa(e){if(Vc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||p1(e)&&e.host||Do(e);return p1(t)?t.host:t}function $_(e){const t=Pa(e);return kc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Js(t)&&gf(t)?t:$_(t)}function Md(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=$_(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=Er(s);return o?t.concat(a,a.visualViewport||[],gf(s)?s:[],a.frameElement&&n?Md(a.frameElement):[]):t.concat(s,Md(s,[],n))}function B_(e){const t=xs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Js(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=Mh(n)!==o||Mh(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function Aw(e){return Gs(e)?e:e.contextElement}function Jl(e){const t=Aw(e);if(!Js(t))return Ma(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=B_(t);let a=(o?Mh(n.width):n.width)/r,c=(o?Mh(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const LU=Ma(0);function z_(e){const t=Er(e);return!Dw()||!t.visualViewport?LU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $U(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Er(e)?!1:t}function zi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Aw(e);let a=Ma(1);t&&(r?Gs(r)&&(a=Jl(r)):a=Jl(e));const c=$U(o,n,r)?z_(o):Ma(0);let u=(s.left+c.x)/a.x,l=(s.top+c.y)/a.y,d=s.width/a.x,p=s.height/a.y;if(o){const f=Er(o),h=r&&Gs(r)?Er(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const x=Jl(m),b=m.getBoundingClientRect(),y=xs(m),w=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,S=b.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;u*=x.x,l*=x.y,d*=x.x,p*=x.y,u+=w,l+=S,g=Er(m),m=g.frameElement}}return Ph({width:d,height:p,x:u,y:l})}function BU(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=Do(r),c=t?zg(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},l=Ma(1);const d=Ma(0),p=Js(r);if((p||!p&&!o)&&((Vc(r)!=="body"||gf(a))&&(u=Ug(r)),Js(r))){const f=zi(r);l=Jl(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+d.x,y:n.y*l.y-u.scrollTop*l.y+d.y}}function zU(e){return Array.from(e.getClientRects())}function U_(e){return zi(Do(e)).left+Ug(e).scrollLeft}function UU(e){const t=Do(e),n=Ug(e),r=e.ownerDocument.body,s=wr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=wr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+U_(e);const c=-n.scrollTop;return xs(r).direction==="rtl"&&(a+=wr(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}function VU(e,t){const n=Er(e),r=Do(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const l=Dw();(!l||l&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:c,y:u}}function HU(e,t){const n=zi(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Js(e)?Jl(e):Ma(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,l=r*o.y;return{width:a,height:c,x:u,y:l}}function h1(e,t,n){let r;if(t==="viewport")r=VU(e,n);else if(t==="document")r=UU(Do(e));else if(Gs(t))r=HU(t,n);else{const s=z_(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return Ph(r)}function V_(e,t){const n=Pa(e);return n===t||!Gs(n)||kc(n)?!1:xs(n).position==="fixed"||V_(n,t)}function qU(e,t){const n=t.get(e);if(n)return n;let r=Md(e,[],!1).filter(c=>Gs(c)&&Vc(c)!=="body"),s=null;const o=xs(e).position==="fixed";let a=o?Pa(e):e;for(;Gs(a)&&!kc(a);){const c=xs(a),u=Iw(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||gf(a)&&!u&&V_(e,a))?r=r.filter(d=>d!==a):s=c,a=Pa(a)}return t.set(e,r),r}function KU(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?zg(t)?[]:qU(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((l,d)=>{const p=h1(t,d,s);return l.top=wr(p.top,l.top),l.right=zs(p.right,l.right),l.bottom=zs(p.bottom,l.bottom),l.left=wr(p.left,l.left),l},h1(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function WU(e){const{width:t,height:n}=B_(e);return{width:t,height:n}}function GU(e,t,n){const r=Js(t),s=Do(t),o=n==="fixed",a=zi(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=Ma(0);if(r||!r&&!o)if((Vc(t)!=="body"||gf(s))&&(c=Ug(t)),r){const p=zi(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else s&&(u.x=U_(s));const l=a.left+c.scrollLeft-u.x,d=a.top+c.scrollTop-u.y;return{x:l,y:d,width:a.width,height:a.height}}function Sv(e){return xs(e).position==="static"}function g1(e,t){return!Js(e)||xs(e).position==="fixed"?null:t?t(e):e.offsetParent}function H_(e,t){const n=Er(e);if(zg(e))return n;if(!Js(e)){let s=Pa(e);for(;s&&!kc(s);){if(Gs(s)&&!Sv(s))return s;s=Pa(s)}return n}let r=g1(e,t);for(;r&&AU(r)&&Sv(r);)r=g1(r,t);return r&&kc(r)&&Sv(r)&&!Iw(r)?n:r||FU(e)||n}const JU=async function(e){const t=this.getOffsetParent||H_,n=this.getDimensions,r=await n(e.floating);return{reference:GU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QU(e){return xs(e).direction==="rtl"}const ZU={convertOffsetParentRelativeRectToViewportRelativeRect:BU,getDocumentElement:Do,getClippingRect:KU,getOffsetParent:H_,getElementRects:JU,getClientRects:zU,getDimensions:WU,getScale:Jl,isElement:Gs,isRTL:QU};function YU(e,t){let n=null,r;const s=Do(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const{left:l,top:d,width:p,height:f}=e.getBoundingClientRect();if(c||t(),!p||!f)return;const h=Qf(d),g=Qf(s.clientWidth-(l+p)),m=Qf(s.clientHeight-(d+f)),x=Qf(l),y={rootMargin:-h+"px "+-g+"px "+-m+"px "+-x+"px",threshold:wr(0,zs(1,u))||1};let w=!0;function S(k){const C=k[0].intersectionRatio;if(C!==u){if(!w)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(e)}return a(!0),o}function XU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Aw(e),d=s||o?[...l?Md(l):[],...Md(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const p=l&&c?YU(l,n):null;let f=-1,h=null;a&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let g,m=u?zi(e):null;u&&x();function x(){const b=zi(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(x)}return n(),()=>{var b;d.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),p==null||p(),(b=h)==null||b.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const e5=PU,t5=OU,n5=_U,r5=DU,s5=MU,m1=NU,o5=IU,a5=(e,t,n)=>{const r=new Map,s={platform:ZU,...n},o={...s.platform,_c:r};return TU(e,t,{...s,platform:o})};var Dp=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Oh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Oh(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Oh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function q_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function v1(e,t){const n=q_(e);return Math.round(t*n)/n}function y1(e){const t=v.useRef(e);return Dp(()=>{t.current=e}),t}function i5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[d,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=v.useState(r);Oh(f,r)||h(r);const[g,m]=v.useState(null),[x,b]=v.useState(null),y=v.useCallback(V=>{V!==C.current&&(C.current=V,m(V))},[]),w=v.useCallback(V=>{V!==T.current&&(T.current=V,b(V))},[]),S=o||g,k=a||x,C=v.useRef(null),T=v.useRef(null),E=v.useRef(d),N=u!=null,P=y1(u),q=y1(s),O=v.useCallback(()=>{if(!C.current||!T.current)return;const V={placement:t,strategy:n,middleware:f};q.current&&(V.platform=q.current),a5(C.current,T.current,V).then(A=>{const D={...A,isPositioned:!0};Y.current&&!Oh(E.current,D)&&(E.current=D,Ua.flushSync(()=>{p(D)}))})},[f,t,n,q]);Dp(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[l]);const Y=v.useRef(!1);Dp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Dp(()=>{if(S&&(C.current=S),k&&(T.current=k),S&&k){if(P.current)return P.current(S,k,O);O()}},[S,k,O,P,N]);const B=v.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:w}),[y,w]),ee=v.useMemo(()=>({reference:S,floating:k}),[S,k]),K=v.useMemo(()=>{const V={position:n,left:0,top:0};if(!ee.floating)return V;const A=v1(ee.floating,d.x),D=v1(ee.floating,d.y);return c?{...V,transform:"translate("+A+"px, "+D+"px)",...q_(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:D}},[n,c,ee.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:O,refs:B,elements:ee,floatingStyles:K}),[d,O,B,ee,K])}const l5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?m1({element:r.current,padding:s}).fn(n):{}:r?m1({element:r,padding:s}).fn(n):{}}}},c5=(e,t)=>({...e5(e),options:[e,t]}),u5=(e,t)=>({...t5(e),options:[e,t]}),d5=(e,t)=>({...o5(e),options:[e,t]}),f5=(e,t)=>({...n5(e),options:[e,t]}),p5=(e,t)=>({...r5(e),options:[e,t]}),h5=(e,t)=>({...s5(e),options:[e,t]}),g5=(e,t)=>({...l5(e),options:[e,t]});var m5="Arrow",K_=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return i.jsx(Fe.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});K_.displayName=m5;var v5=K_;function W_(e){const[t,n]=v.useState(void 0);return mn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fw="Popper",[G_,Vg]=Xr(Fw),[y5,J_]=G_(Fw),Q_=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return i.jsx(y5,{scope:t,anchor:r,onAnchorChange:s,children:n})};Q_.displayName=Fw;var Z_="PopperAnchor",Y_=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=J_(Z_,n),a=v.useRef(null),c=ft(t,a);return v.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:i.jsx(Fe.div,{...s,ref:c})});Y_.displayName=Z_;var Lw="PopperContent",[b5,x5]=G_(Lw),X_=v.forwardRef((e,t)=>{var W,ge,je,Pe,Ie,ye;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:g,...m}=e,x=J_(Lw,n),[b,y]=v.useState(null),w=ft(t,ot=>y(ot)),[S,k]=v.useState(null),C=W_(S),T=(C==null?void 0:C.width)??0,E=(C==null?void 0:C.height)??0,N=r+(o!=="center"?"-"+o:""),P=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(l)?l:[l],O=q.length>0,Y={padding:P,boundary:q.filter(S5),altBoundary:O},{refs:B,floatingStyles:ee,placement:K,isPositioned:V,middlewareData:A}=i5({strategy:"fixed",placement:N,whileElementsMounted:(...ot)=>XU(...ot,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[c5({mainAxis:s+E,alignmentAxis:a}),u&&u5({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?d5():void 0,...Y}),u&&f5({...Y}),p5({...Y,apply:({elements:ot,rects:Ht,availableWidth:rn,availableHeight:tn})=>{const{width:dn,height:_}=Ht.reference,F=ot.floating.style;F.setProperty("--radix-popper-available-width",`${rn}px`),F.setProperty("--radix-popper-available-height",`${tn}px`),F.setProperty("--radix-popper-anchor-width",`${dn}px`),F.setProperty("--radix-popper-anchor-height",`${_}px`)}}),S&&g5({element:S,padding:c}),C5({arrowWidth:T,arrowHeight:E}),f&&h5({strategy:"referenceHidden",...Y})]}),[D,X]=nM(K),se=ln(g);mn(()=>{V&&(se==null||se())},[V,se]);const H=(W=A.arrow)==null?void 0:W.x,oe=(ge=A.arrow)==null?void 0:ge.y,Q=((je=A.arrow)==null?void 0:je.centerOffset)!==0,[ne,re]=v.useState();return mn(()=>{b&&re(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:V?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Pe=A.transformOrigin)==null?void 0:Pe.x,(Ie=A.transformOrigin)==null?void 0:Ie.y].join(" "),...((ye=A.hide)==null?void 0:ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(b5,{scope:n,placedSide:D,onArrowChange:k,arrowX:H,arrowY:oe,shouldHideArrow:Q,children:i.jsx(Fe.div,{"data-side":D,"data-align":X,...m,ref:w,style:{...m.style,animation:V?void 0:"none"}})})})});X_.displayName=Lw;var eM="PopperArrow",w5={top:"bottom",right:"left",bottom:"top",left:"right"},tM=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=x5(eM,r),a=w5[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(v5,{...s,ref:n,style:{...s.style,display:"block"}})})});tM.displayName=eM;function S5(e){return e!==null}var C5=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:n,rects:r,middlewareData:s}=t,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,d]=nM(n),p={start:"0%",center:"50%",end:"100%"}[d],f=(((b=s.arrow)==null?void 0:b.x)??0)+c/2,h=(((y=s.arrow)==null?void 0:y.y)??0)+u/2;let g="",m="";return l==="bottom"?(g=a?p:`${f}px`,m=`${-u}px`):l==="top"?(g=a?p:`${f}px`,m=`${r.floating.height+u}px`):l==="right"?(g=`${-u}px`,m=a?p:`${h}px`):l==="left"&&(g=`${r.floating.width+u}px`,m=a?p:`${h}px`),{data:{x:g,y:m}}}});function nM(e){const[t,n="center"]=e.split("-");return[t,n]}var rM=Q_,sM=Y_,oM=X_,aM=tM,k5="Portal",Hg=v.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=v.useState(!1);mn(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?vN.createPortal(i.jsx(Fe.div,{...r,ref:t}),a):null});Hg.displayName=k5;function E5(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var pr=e=>{const{present:t,children:n}=e,r=j5(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=ft(r.ref,T5(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:o}):null};pr.displayName="Presence";function j5(e){const[t,n]=v.useState(),r=v.useRef({}),s=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[c,u]=E5(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Zf(r.current);o.current=c==="mounted"?l:"none"},[c]),mn(()=>{const l=r.current,d=s.current;if(d!==e){const f=o.current,h=Zf(l);e?u("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),mn(()=>{if(t){const l=p=>{const h=Zf(r.current).includes(p.animationName);p.target===t&&h&&Ua.flushSync(()=>u("ANIMATION_END"))},d=p=>{p.target===t&&(o.current=Zf(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Zf(e){return(e==null?void 0:e.animationName)||"none"}function T5(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Cv="rovingFocusGroup.onEntryFocus",N5={bubbles:!1,cancelable:!0},qg="RovingFocusGroup",[Ob,iM,_5]=_w(qg),[M5,Kg]=Xr(qg,[_5]),[R5,P5]=M5(qg),lM=v.forwardRef((e,t)=>i.jsx(Ob.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Ob.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(O5,{...e,ref:t})})}));lM.displayName=qg;var O5=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...p}=e,f=v.useRef(null),h=ft(t,f),g=hf(o),[m=null,x]=_a({prop:a,defaultProp:c,onChange:u}),[b,y]=v.useState(!1),w=ln(l),S=iM(n),k=v.useRef(!1),[C,T]=v.useState(0);return v.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Cv,w),()=>E.removeEventListener(Cv,w)},[w]),i.jsx(R5,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(E=>x(E),[x]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>T(E=>E+1),[]),onFocusableItemRemove:v.useCallback(()=>T(E=>E-1),[]),children:i.jsx(Fe.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{k.current=!0}),onFocus:ke(e.onFocus,E=>{const N=!k.current;if(E.target===E.currentTarget&&N&&!b){const P=new CustomEvent(Cv,N5);if(E.currentTarget.dispatchEvent(P),!P.defaultPrevented){const q=S().filter(K=>K.focusable),O=q.find(K=>K.active),Y=q.find(K=>K.id===m),ee=[O,Y,...q].filter(Boolean).map(K=>K.ref.current);dM(ee,d)}}k.current=!1}),onBlur:ke(e.onBlur,()=>y(!1))})})}),cM="RovingFocusGroupItem",uM=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...a}=e,c=gs(),u=o||c,l=P5(cM,n),d=l.currentTabStopId===u,p=iM(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=l;return v.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),i.jsx(Ob.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(Fe.span,{tabIndex:d?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:ke(e.onMouseDown,g=>{r?l.onItemFocus(u):g.preventDefault()}),onFocus:ke(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:ke(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){l.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=A5(g,l.orientation,l.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=p().filter(y=>y.focusable).map(y=>y.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const y=b.indexOf(g.currentTarget);b=l.loop?F5(b,y+1):b.slice(y+1)}setTimeout(()=>dM(b))}})})})});uM.displayName=cM;var I5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function D5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function A5(e,t,n){const r=D5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return I5[r]}function dM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function F5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fM=lM,pM=uM,L5=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hl=new WeakMap,Yf=new WeakMap,Xf={},kv=0,hM=function(e){return e&&(e.host||hM(e.parentNode))},$5=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hM(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},B5=function(e,t,n,r){var s=$5(t,Array.isArray(e)?e:[e]);Xf[n]||(Xf[n]=new WeakMap);var o=Xf[n],a=[],c=new Set,u=new Set(s),l=function(p){!p||c.has(p)||(c.add(p),l(p.parentNode))};s.forEach(l);var d=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(f){if(c.has(f))d(f);else try{var h=f.getAttribute(r),g=h!==null&&h!=="false",m=(hl.get(f)||0)+1,x=(o.get(f)||0)+1;hl.set(f,m),o.set(f,x),a.push(f),m===1&&g&&Yf.set(f,!0),x===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),c.clear(),kv++,function(){a.forEach(function(p){var f=hl.get(p)-1,h=o.get(p)-1;hl.set(p,f),o.set(p,h),f||(Yf.has(p)||p.removeAttribute(r),Yf.delete(p)),h||p.removeAttribute(n)}),kv--,kv||(hl=new WeakMap,hl=new WeakMap,Yf=new WeakMap,Xf={})}},$w=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=L5(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),B5(r,s,n,"aria-hidden")):function(){return null}},Fs=function(){return Fs=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return r6;var t=s6(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},a6=yM(),Ql="data-scroll-locked",i6=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),` + .`.concat(U5,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(c,"px ").concat(r,`; + } + body[`).concat(Ql,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(s,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(c,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Ap,` { + right: `).concat(c,"px ").concat(r,`; + } + + .`).concat(Fp,` { + margin-right: `).concat(c,"px ").concat(r,`; + } + + .`).concat(Ap," .").concat(Ap,` { + right: 0 `).concat(r,`; + } + + .`).concat(Fp," .").concat(Fp,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Ql,`] { + `).concat(V5,": ").concat(c,`px; + } +`)},x1=function(){var e=parseInt(document.body.getAttribute(Ql)||"0",10);return isFinite(e)?e:0},l6=function(){v.useEffect(function(){return document.body.setAttribute(Ql,(x1()+1).toString()),function(){var e=x1()-1;e<=0?document.body.removeAttribute(Ql):document.body.setAttribute(Ql,e.toString())}},[])},c6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;l6();var o=v.useMemo(function(){return o6(s)},[s]);return v.createElement(a6,{styles:i6(o,!t,s,n?"":"!important")})},Ib=!1;if(typeof window<"u")try{var ep=Object.defineProperty({},"passive",{get:function(){return Ib=!0,!0}});window.addEventListener("test",ep,ep),window.removeEventListener("test",ep,ep)}catch{Ib=!1}var gl=Ib?{passive:!1}:!1,u6=function(e){return e.tagName==="TEXTAREA"},bM=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!u6(e)&&n[t]==="visible")},d6=function(e){return bM(e,"overflowY")},f6=function(e){return bM(e,"overflowX")},w1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=xM(e,r);if(s){var o=wM(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},p6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},h6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xM=function(e,t){return e==="v"?d6(t):f6(t)},wM=function(e,t){return e==="v"?p6(t):h6(t)},g6=function(e,t){return e==="h"&&t==="rtl"?-1:1},m6=function(e,t,n,r,s){var o=g6(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),l=!1,d=a>0,p=0,f=0;do{var h=wM(e,c),g=h[0],m=h[1],x=h[2],b=m-x-o*g;(g||b)&&xM(e,c)&&(p+=b,f+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(d&&(Math.abs(p)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(l=!0),l},tp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},S1=function(e){return[e.deltaX,e.deltaY]},C1=function(e){return e&&"current"in e?e.current:e},v6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},y6=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},b6=0,ml=[];function x6(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(b6++)[0],o=v.useState(yM)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=z5([e.lockRef.current],(e.shards||[]).map(C1),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=tp(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-b[0],S="deltaY"in m?m.deltaY:y[1]-b[1],k,C=m.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&T==="h"&&C.type==="range")return!1;var E=w1(T,C);if(!E)return!0;if(E?k=T:(k=T==="v"?"h":"v",E=w1(T,C)),!E)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=k),!k)return!0;var N=r.current||k;return m6(N,x,m,N==="h"?w:S,!0)},[]),u=v.useCallback(function(m){var x=m;if(!(!ml.length||ml[ml.length-1]!==o)){var b="deltaY"in x?S1(x):tp(x),y=t.current.filter(function(k){return k.name===x.type&&(k.target===x.target||x.target===k.shadowParent)&&v6(k.delta,b)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(C1).filter(Boolean).filter(function(k){return k.contains(x.target)}),S=w.length>0?c(x,w[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),l=v.useCallback(function(m,x,b,y){var w={name:m,delta:x,target:b,should:y,shadowParent:w6(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(m){n.current=tp(m),r.current=void 0},[]),p=v.useCallback(function(m){l(m.type,S1(m),m.target,c(m,e.lockRef.current))},[]),f=v.useCallback(function(m){l(m.type,tp(m),m.target,c(m,e.lockRef.current))},[]);v.useEffect(function(){return ml.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",u,gl),document.addEventListener("touchmove",u,gl),document.addEventListener("touchstart",d,gl),function(){ml=ml.filter(function(m){return m!==o}),document.removeEventListener("wheel",u,gl),document.removeEventListener("touchmove",u,gl),document.removeEventListener("touchstart",d,gl)}},[]);var h=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(o,{styles:y6(s)}):null,h?v.createElement(c6,{gapMode:e.gapMode}):null)}function w6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const S6=Q5(vM,x6);var Gg=v.forwardRef(function(e,t){return v.createElement(Wg,Fs({},e,{ref:t,sideCar:S6}))});Gg.classNames=Wg.classNames;var Db=["Enter"," "],C6=["ArrowDown","PageUp","Home"],SM=["ArrowUp","PageDown","End"],k6=[...C6,...SM],E6={ltr:[...Db,"ArrowRight"],rtl:[...Db,"ArrowLeft"]},j6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mf="Menu",[Rd,T6,N6]=_w(mf),[ol,CM]=Xr(mf,[N6,Vg,Kg]),Jg=Vg(),kM=Kg(),[_6,al]=ol(mf),[M6,vf]=ol(mf),EM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=Jg(t),[u,l]=v.useState(null),d=v.useRef(!1),p=ln(o),f=hf(s);return v.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(rM,{...c,children:i.jsx(_6,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:l,children:i.jsx(M6,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};EM.displayName=mf;var R6="MenuAnchor",Bw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Jg(n);return i.jsx(sM,{...s,...r,ref:t})});Bw.displayName=R6;var zw="MenuPortal",[P6,jM]=ol(zw,{forceMount:void 0}),TM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=al(zw,t);return i.jsx(P6,{scope:t,forceMount:n,children:i.jsx(pr,{present:n||o.open,children:i.jsx(Hg,{asChild:!0,container:s,children:r})})})};TM.displayName=zw;var Gr="MenuContent",[O6,Uw]=ol(Gr),NM=v.forwardRef((e,t)=>{const n=jM(Gr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=al(Gr,e.__scopeMenu),a=vf(Gr,e.__scopeMenu);return i.jsx(Rd.Provider,{scope:e.__scopeMenu,children:i.jsx(pr,{present:r||o.open,children:i.jsx(Rd.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(I6,{...s,ref:t}):i.jsx(D6,{...s,ref:t})})})})}),I6=v.forwardRef((e,t)=>{const n=al(Gr,e.__scopeMenu),r=v.useRef(null),s=ft(t,r);return v.useEffect(()=>{const o=r.current;if(o)return $w(o)},[]),i.jsx(Vw,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ke(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),D6=v.forwardRef((e,t)=>{const n=al(Gr,e.__scopeMenu);return i.jsx(Vw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Vw=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,...m}=e,x=al(Gr,n),b=vf(Gr,n),y=Jg(n),w=kM(n),S=T6(n),[k,C]=v.useState(null),T=v.useRef(null),E=ft(t,T,x.onContentChange),N=v.useRef(0),P=v.useRef(""),q=v.useRef(0),O=v.useRef(null),Y=v.useRef("right"),B=v.useRef(0),ee=g?Gg:v.Fragment,K=g?{as:No,allowPinchZoom:!0}:void 0,V=D=>{var W,ge;const X=P.current+D,se=S().filter(je=>!je.disabled),H=document.activeElement,oe=(W=se.find(je=>je.ref.current===H))==null?void 0:W.textValue,Q=se.map(je=>je.textValue),ne=W6(Q,X,oe),re=(ge=se.find(je=>je.textValue===ne))==null?void 0:ge.ref.current;(function je(Pe){P.current=Pe,window.clearTimeout(N.current),Pe!==""&&(N.current=window.setTimeout(()=>je(""),1e3))})(X),re&&setTimeout(()=>re.focus())};v.useEffect(()=>()=>window.clearTimeout(N.current),[]),Mw();const A=v.useCallback(D=>{var se,H;return Y.current===((se=O.current)==null?void 0:se.side)&&J6(D,(H=O.current)==null?void 0:H.area)},[]);return i.jsx(O6,{scope:n,searchRef:P,onItemEnter:v.useCallback(D=>{A(D)&&D.preventDefault()},[A]),onItemLeave:v.useCallback(D=>{var X;A(D)||((X=T.current)==null||X.focus(),C(null))},[A]),onTriggerLeave:v.useCallback(D=>{A(D)&&D.preventDefault()},[A]),pointerGraceTimerRef:q,onPointerGraceIntentChange:v.useCallback(D=>{O.current=D},[]),children:i.jsx(ee,{...K,children:i.jsx(Bg,{asChild:!0,trapped:s,onMountAutoFocus:ke(o,D=>{var X;D.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx($g,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,children:i.jsx(fM,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:ke(u,D=>{b.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(oM,{role:"menu","aria-orientation":"vertical","data-state":HM(x.open),"data-radix-menu-content":"",dir:b.dir,...y,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:ke(m.onKeyDown,D=>{const se=D.target.closest("[data-radix-menu-content]")===D.currentTarget,H=D.ctrlKey||D.altKey||D.metaKey,oe=D.key.length===1;se&&(D.key==="Tab"&&D.preventDefault(),!H&&oe&&V(D.key));const Q=T.current;if(D.target!==Q||!k6.includes(D.key))return;D.preventDefault();const re=S().filter(W=>!W.disabled).map(W=>W.ref.current);SM.includes(D.key)&&re.reverse(),q6(re)}),onBlur:ke(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(N.current),P.current="")}),onPointerMove:ke(e.onPointerMove,Pd(D=>{const X=D.target,se=B.current!==D.clientX;if(D.currentTarget.contains(X)&&se){const H=D.clientX>B.current?"right":"left";Y.current=H,B.current=D.clientX}}))})})})})})})});NM.displayName=Gr;var A6="MenuGroup",Hw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Fe.div,{role:"group",...r,ref:t})});Hw.displayName=A6;var F6="MenuLabel",_M=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Fe.div,{...r,ref:t})});_M.displayName=F6;var Ih="MenuItem",k1="menu.itemSelect",Qg=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),a=vf(Ih,e.__scopeMenu),c=Uw(Ih,e.__scopeMenu),u=ft(t,o),l=v.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const f=new CustomEvent(k1,{bubbles:!0,cancelable:!0});p.addEventListener(k1,h=>r==null?void 0:r(h),{once:!0}),O_(p,f),f.defaultPrevented?l.current=!1:a.onClose()}};return i.jsx(MM,{...s,ref:u,disabled:n,onClick:ke(e.onClick,d),onPointerDown:p=>{var f;(f=e.onPointerDown)==null||f.call(e,p),l.current=!0},onPointerUp:ke(e.onPointerUp,p=>{var f;l.current||(f=p.currentTarget)==null||f.click()}),onKeyDown:ke(e.onKeyDown,p=>{const f=c.searchRef.current!=="";n||f&&p.key===" "||Db.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Qg.displayName=Ih;var MM=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=Uw(Ih,n),c=kM(n),u=v.useRef(null),l=ft(t,u),[d,p]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const g=u.current;g&&h((g.textContent??"").trim())},[o.children]),i.jsx(Rd.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:i.jsx(pM,{asChild:!0,...c,focusable:!r,children:i.jsx(Fe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:ke(e.onPointerMove,Pd(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ke(e.onPointerLeave,Pd(g=>a.onItemLeave(g))),onFocus:ke(e.onFocus,()=>p(!0)),onBlur:ke(e.onBlur,()=>p(!1))})})})}),L6="MenuCheckboxItem",RM=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(AM,{scope:e.__scopeMenu,checked:n,children:i.jsx(Qg,{role:"menuitemcheckbox","aria-checked":Dh(n)?"mixed":n,...s,ref:t,"data-state":Kw(n),onSelect:ke(s.onSelect,()=>r==null?void 0:r(Dh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RM.displayName=L6;var PM="MenuRadioGroup",[$6,B6]=ol(PM,{value:void 0,onValueChange:()=>{}}),OM=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=ln(r);return i.jsx($6,{scope:e.__scopeMenu,value:n,onValueChange:o,children:i.jsx(Hw,{...s,ref:t})})});OM.displayName=PM;var IM="MenuRadioItem",DM=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=B6(IM,e.__scopeMenu),o=n===s.value;return i.jsx(AM,{scope:e.__scopeMenu,checked:o,children:i.jsx(Qg,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Kw(o),onSelect:ke(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});DM.displayName=IM;var qw="MenuItemIndicator",[AM,z6]=ol(qw,{checked:!1}),FM=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=z6(qw,n);return i.jsx(pr,{present:r||Dh(o.checked)||o.checked===!0,children:i.jsx(Fe.span,{...s,ref:t,"data-state":Kw(o.checked)})})});FM.displayName=qw;var U6="MenuSeparator",LM=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});LM.displayName=U6;var V6="MenuArrow",$M=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Jg(n);return i.jsx(aM,{...s,...r,ref:t})});$M.displayName=V6;var H6="MenuSub",[oce,BM]=ol(H6),Pu="MenuSubTrigger",zM=v.forwardRef((e,t)=>{const n=al(Pu,e.__scopeMenu),r=vf(Pu,e.__scopeMenu),s=BM(Pu,e.__scopeMenu),o=Uw(Pu,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,l={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),i.jsx(Bw,{asChild:!0,...l,children:i.jsx(MM,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":HM(n.open),...e,ref:Ag(t,s.onTriggerChange),onClick:p=>{var f;(f=e.onClick)==null||f.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ke(e.onPointerMove,Pd(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ke(e.onPointerLeave,Pd(p=>{var h,g;d();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(g=n.content)==null?void 0:g.dataset.side,x=m==="right",b=x?-5:5,y=f[x?"left":"right"],w=f[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:y,y:f.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ke(e.onKeyDown,p=>{var h;const f=o.searchRef.current!=="";e.disabled||f&&p.key===" "||E6[r.dir].includes(p.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),p.preventDefault())})})})});zM.displayName=Pu;var UM="MenuSubContent",VM=v.forwardRef((e,t)=>{const n=jM(Gr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=al(Gr,e.__scopeMenu),a=vf(Gr,e.__scopeMenu),c=BM(UM,e.__scopeMenu),u=v.useRef(null),l=ft(t,u);return i.jsx(Rd.Provider,{scope:e.__scopeMenu,children:i.jsx(pr,{present:r||o.open,children:i.jsx(Rd.Slot,{scope:e.__scopeMenu,children:i.jsx(Vw,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ke(e.onFocusOutside,d=>{d.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ke(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:ke(e.onKeyDown,d=>{var h;const p=d.currentTarget.contains(d.target),f=j6[a.dir].includes(d.key);p&&f&&(o.onOpenChange(!1),(h=c.trigger)==null||h.focus(),d.preventDefault())})})})})})});VM.displayName=UM;function HM(e){return e?"open":"closed"}function Dh(e){return e==="indeterminate"}function Kw(e){return Dh(e)?"indeterminate":e?"checked":"unchecked"}function q6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function K6(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function W6(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=K6(e,Math.max(o,0));s.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function G6(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(l-c)*(r-u)/(d-u)+c&&(s=!s)}return s}function J6(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return G6(n,t)}function Pd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q6=EM,Z6=Bw,Y6=TM,X6=NM,eV=Hw,tV=_M,nV=Qg,rV=RM,sV=OM,oV=DM,aV=FM,iV=LM,lV=$M,cV=zM,uV=VM,Ww="DropdownMenu",[dV,ace]=Xr(Ww,[CM]),er=CM(),[fV,qM]=dV(Ww),Gw=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,u=er(t),l=v.useRef(null),[d=!1,p]=_a({prop:s,defaultProp:o,onChange:a});return i.jsx(fV,{scope:t,triggerId:gs(),triggerRef:l,contentId:gs(),open:d,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(f=>!f),[p]),modal:c,children:i.jsx(Q6,{...u,open:d,onOpenChange:p,dir:r,modal:c,children:n})})};Gw.displayName=Ww;var KM="DropdownMenuTrigger",Jw=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=qM(KM,n),a=er(n);return i.jsx(Z6,{asChild:!0,...a,children:i.jsx(Fe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Ag(t,o.triggerRef),onPointerDown:ke(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:ke(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Jw.displayName=KM;var pV="DropdownMenuPortal",WM=e=>{const{__scopeDropdownMenu:t,...n}=e,r=er(t);return i.jsx(Y6,{...r,...n})};WM.displayName=pV;var GM="DropdownMenuContent",JM=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=qM(GM,n),o=er(n),a=v.useRef(!1);return i.jsx(X6,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:ke(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:ke(e.onInteractOutside,c=>{const u=c.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,d=u.button===2||l;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JM.displayName=GM;var hV="DropdownMenuGroup",gV=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(eV,{...s,...r,ref:t})});gV.displayName=hV;var mV="DropdownMenuLabel",QM=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(tV,{...s,...r,ref:t})});QM.displayName=mV;var vV="DropdownMenuItem",ZM=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(nV,{...s,...r,ref:t})});ZM.displayName=vV;var yV="DropdownMenuCheckboxItem",YM=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(rV,{...s,...r,ref:t})});YM.displayName=yV;var bV="DropdownMenuRadioGroup",xV=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(sV,{...s,...r,ref:t})});xV.displayName=bV;var wV="DropdownMenuRadioItem",XM=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(oV,{...s,...r,ref:t})});XM.displayName=wV;var SV="DropdownMenuItemIndicator",eR=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(aV,{...s,...r,ref:t})});eR.displayName=SV;var CV="DropdownMenuSeparator",tR=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(iV,{...s,...r,ref:t})});tR.displayName=CV;var kV="DropdownMenuArrow",EV=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(lV,{...s,...r,ref:t})});EV.displayName=kV;var jV="DropdownMenuSubTrigger",nR=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(cV,{...s,...r,ref:t})});nR.displayName=jV;var TV="DropdownMenuSubContent",rR=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=er(n);return i.jsx(uV,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rR.displayName=TV;var NV=Gw,_V=Jw,MV=WM,sR=JM,oR=QM,aR=ZM,iR=YM,lR=XM,cR=eR,Ka=tR,uR=nR,dR=rR;const Rr=NV,Pr=_V,RV=v.forwardRef(({className:e,inset:t,children:n,...r},s)=>i.jsxs(uR,{ref:s,className:ve("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,i.jsx(yz,{className:"ml-auto h-4 w-4"})]}));RV.displayName=uR.displayName;const PV=v.forwardRef(({className:e,...t},n)=>i.jsx(dR,{ref:n,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));PV.displayName=dR.displayName;const tr=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(MV,{children:i.jsx(sR,{ref:r,sideOffset:t,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));tr.displayName=sR.displayName;const Ye=v.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(aR,{ref:r,className:ve("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ye.displayName=aR.displayName;const fR=v.forwardRef(({className:e,children:t,checked:n,...r},s)=>i.jsxs(iR,{ref:s,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(cR,{children:i.jsx(T_,{className:"h-4 w-4"})})}),t]}));fR.displayName=iR.displayName;const OV=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(lR,{ref:r,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(cR,{children:i.jsx(Sz,{className:"h-2 w-2 fill-current"})})}),t]}));OV.displayName=lR.displayName;const Ao=v.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(oR,{ref:r,className:ve("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ao.displayName=oR.displayName;const Xs=v.forwardRef(({className:e,...t},n)=>i.jsx(Ka,{ref:n,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));Xs.displayName=Ka.displayName;function IV(){const{t:e,i18n:t}=Ee(),n=r=>{t.changeLanguage(r),localStorage.setItem("i18nextLng",r),window.location.reload()};return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"outline",size:"icon",children:[i.jsx(Dz,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"}),i.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ye,{className:t.language==="pt-BR"?"font-bold":"",onClick:()=>n("pt-BR"),children:e("header.language.portuguese")}),i.jsx(Ye,{className:t.language==="en-US"?"font-bold":"",onClick:()=>n("en-US"),children:e("header.language.english")}),i.jsx(Ye,{className:t.language==="es-ES"?"font-bold":"",onClick:()=>n("es-ES"),children:e("header.language.spanish")}),i.jsx(Ye,{className:t.language==="fr-FR"?"font-bold":"",onClick:()=>n("fr-FR"),children:e("header.language.french")})]})]})}function DV(){const{t:e}=Ee(),{setTheme:t}=Mg();return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"outline",size:"icon",children:[i.jsx(qz,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),i.jsx(zz,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),i.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ye,{onClick:()=>t("light"),children:e("header.theme.light")}),i.jsx(Ye,{onClick:()=>t("dark"),children:e("header.theme.dark")}),i.jsx(Ye,{onClick:()=>t("system"),children:e("header.theme.system")})]})]})}var Qw="Avatar",[AV,ice]=Xr(Qw),[FV,pR]=AV(Qw),hR=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,o]=v.useState("idle");return i.jsx(FV,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:i.jsx(Fe.span,{...r,ref:t})})});hR.displayName=Qw;var gR="AvatarImage",mR=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=e,a=pR(gR,n),c=LV(r),u=ln(l=>{s(l),a.onImageLoadingStatusChange(l)});return mn(()=>{c!=="idle"&&u(c)},[c,u]),c==="loaded"?i.jsx(Fe.img,{...o,ref:t,src:r}):null});mR.displayName=gR;var vR="AvatarFallback",yR=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,o=pR(vR,n),[a,c]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?i.jsx(Fe.span,{...s,ref:t}):null});yR.displayName=vR;function LV(e){const[t,n]=v.useState("idle");return mn(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,()=>{r=!1}},[e]),t}var bR=hR,xR=mR,wR=yR;const Ui=v.forwardRef(({className:e,...t},n)=>i.jsx(bR,{ref:n,className:ve("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ui.displayName=bR.displayName;const Vi=v.forwardRef(({className:e,...t},n)=>i.jsx(xR,{ref:n,className:ve("aspect-square h-full w-full",e),...t}));Vi.displayName=xR.displayName;const Ah=v.forwardRef(({className:e,...t},n)=>i.jsx(wR,{ref:n,className:ve("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ah.displayName=wR.displayName;var Zw="Dialog",[SR,lce]=Xr(Zw),[$V,ks]=SR(Zw),CR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=v.useRef(null),u=v.useRef(null),[l=!1,d]=_a({prop:r,defaultProp:s,onChange:o});return i.jsx($V,{scope:t,triggerRef:c,contentRef:u,contentId:gs(),titleId:gs(),descriptionId:gs(),open:l,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(p=>!p),[d]),modal:a,children:n})};CR.displayName=Zw;var kR="DialogTrigger",ER=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ks(kR,n),o=ft(t,s.triggerRef);return i.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":e0(s.open),...r,ref:o,onClick:ke(e.onClick,s.onOpenToggle)})});ER.displayName=kR;var Yw="DialogPortal",[BV,jR]=SR(Yw,{forceMount:void 0}),TR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=ks(Yw,t);return i.jsx(BV,{scope:t,forceMount:n,children:v.Children.map(r,a=>i.jsx(pr,{present:n||o.open,children:i.jsx(Hg,{asChild:!0,container:s,children:a})}))})};TR.displayName=Yw;var Fh="DialogOverlay",NR=v.forwardRef((e,t)=>{const n=jR(Fh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ks(Fh,e.__scopeDialog);return o.modal?i.jsx(pr,{present:r||o.open,children:i.jsx(zV,{...s,ref:t})}):null});NR.displayName=Fh;var zV=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ks(Fh,n);return i.jsx(Gg,{as:No,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(Fe.div,{"data-state":e0(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Hi="DialogContent",_R=v.forwardRef((e,t)=>{const n=jR(Hi,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ks(Hi,e.__scopeDialog);return i.jsx(pr,{present:r||o.open,children:o.modal?i.jsx(UV,{...s,ref:t}):i.jsx(VV,{...s,ref:t})})});_R.displayName=Hi;var UV=v.forwardRef((e,t)=>{const n=ks(Hi,e.__scopeDialog),r=v.useRef(null),s=ft(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return $w(o)},[]),i.jsx(MR,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,o=>o.preventDefault())})}),VV=v.forwardRef((e,t)=>{const n=ks(Hi,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return i.jsx(MR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((l=n.triggerRef.current)==null?void 0:l.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),MR=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=ks(Hi,n),u=v.useRef(null),l=ft(t,u);return Mw(),i.jsxs(i.Fragment,{children:[i.jsx(Bg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx($g,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":e0(c.open),...a,ref:l,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(HV,{titleId:c.titleId}),i.jsx(KV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Xw="DialogTitle",RR=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ks(Xw,n);return i.jsx(Fe.h2,{id:s.titleId,...r,ref:t})});RR.displayName=Xw;var PR="DialogDescription",OR=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ks(PR,n);return i.jsx(Fe.p,{id:s.descriptionId,...r,ref:t})});OR.displayName=PR;var IR="DialogClose",DR=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ks(IR,n);return i.jsx(Fe.button,{type:"button",...r,ref:t,onClick:ke(e.onClick,()=>s.onOpenChange(!1))})});DR.displayName=IR;function e0(e){return e?"open":"closed"}var AR="DialogTitleWarning",[cce,FR]=Zz(AR,{contentName:Hi,titleName:Xw,docsSlug:"dialog"}),HV=({titleId:e})=>{const t=FR(AR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},qV="DialogDescriptionWarning",KV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${FR(qV).contentName}}.`;return v.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},WV=CR,GV=ER,JV=TR,LR=NR,$R=_R,BR=RR,zR=OR,UR=DR;const pt=WV,vt=GV,QV=JV,VR=UR,HR=v.forwardRef(({className:e,...t},n)=>i.jsx(LR,{ref:n,className:ve("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));HR.displayName=LR.displayName;const lt=v.forwardRef(({className:e,children:t,closeBtn:n=!0,...r},s)=>i.jsx(QV,{children:i.jsx(HR,{className:"fixed inset-0 grid place-items-center overflow-y-auto",children:i.jsxs($R,{ref:s,className:ve("relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:m-4 sm:rounded-lg md:w-full",e),...r,children:[t,n&&i.jsxs(UR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(Nw,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})})}));lt.displayName=$R.displayName;const ct=({className:e,...t})=>i.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ct.displayName="DialogHeader";const Rt=({className:e,...t})=>i.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rt.displayName="DialogFooter";const yt=v.forwardRef(({className:e,...t},n)=>i.jsx(BR,{ref:n,className:ve("text-lg font-semibold leading-none tracking-tight",e),...t}));yt.displayName=BR.displayName;const eo=v.forwardRef(({className:e,...t},n)=>i.jsx(zR,{ref:n,className:ve("text-sm text-muted-foreground",e),...t}));eo.displayName=zR.displayName;function qR({instanceId:e}){const[t,n]=v.useState(!1),r=Qt(),{theme:s}=Mg(),o=()=>{WN(),r("/manager/login")},a=()=>{r("/manager/")},{data:c}=P_({instanceId:e});return i.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[i.jsx(Ed,{to:"/manager",onClick:a,className:"flex h-8 items-center gap-4",children:i.jsx("img",{src:s==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"Logo",className:"h-full"})}),i.jsxs("div",{className:"flex items-center gap-4",children:[e&&i.jsx(Ui,{className:"h-8 w-8",children:i.jsx(Vi,{src:(c==null?void 0:c.profilePicUrl)||"/assets/images/evolution-logo.png",alt:c==null?void 0:c.name})}),i.jsx(IV,{}),i.jsx(DV,{}),i.jsx($,{onClick:()=>n(!0),variant:"destructive",size:"icon",children:i.jsx(Ez,{size:"18"})})]}),t&&i.jsx(pt,{onOpenChange:n,open:t,children:i.jsxs(lt,{children:[i.jsx(VR,{}),i.jsx(ct,{children:"Deseja realmente sair?"}),i.jsx(Rt,{children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx($,{onClick:()=>n(!1),size:"sm",variant:"outline",children:"Cancelar"}),i.jsx($,{onClick:o,variant:"destructive",children:"Sair"})]})})]})})]})}const KR=v.createContext(null),He=()=>{const e=v.useContext(KR);if(!e)throw new Error("useInstance must be used within an InstanceProvider");return e},WR=({children:e})=>{const t=Zr(),[n,r]=v.useState(null),{data:s,refetch:o}=P_({instanceId:n});return v.useEffect(()=>{t.instanceId?r(t.instanceId):r(null)},[t]),i.jsx(KR.Provider,{value:{instance:s??null,reloadInstance:async()=>{await o()}},children:e})};var t0="Collapsible",[ZV,uce]=Xr(t0),[YV,n0]=ZV(t0),GR=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:a,...c}=e,[u=!1,l]=_a({prop:r,defaultProp:s,onChange:a});return i.jsx(YV,{scope:n,disabled:o,contentId:gs(),open:u,onOpenToggle:v.useCallback(()=>l(d=>!d),[l]),children:i.jsx(Fe.div,{"data-state":s0(u),"data-disabled":o?"":void 0,...c,ref:t})})});GR.displayName=t0;var JR="CollapsibleTrigger",QR=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=n0(JR,n);return i.jsx(Fe.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":s0(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:ke(e.onClick,s.onOpenToggle)})});QR.displayName=JR;var r0="CollapsibleContent",ZR=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=n0(r0,e.__scopeCollapsible);return i.jsx(pr,{present:n||s.open,children:({present:o})=>i.jsx(XV,{...r,ref:t,present:o})})});ZR.displayName=r0;var XV=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,a=n0(r0,n),[c,u]=v.useState(r),l=v.useRef(null),d=ft(t,l),p=v.useRef(0),f=p.current,h=v.useRef(0),g=h.current,m=a.open||c,x=v.useRef(m),b=v.useRef();return v.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),mn(()=>{const y=l.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,h.current=w.width,x.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),u(r)}},[a.open,r]),i.jsx(Fe.div,{"data-state":s0(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...o,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&s})});function s0(e){return e?"open":"closed"}var e8=GR;const t8=e8,n8=QR,r8=ZR;function s8(){const{t:e}=Ee(),t=v.useMemo(()=>[{id:"dashboard",title:e("sidebar.dashboard"),icon:Az,path:"dashboard"},{id:"chat",title:e("sidebar.chat"),icon:Cc,path:"chat"},{navLabel:!0,title:e("sidebar.configurations"),icon:Io,children:[{id:"settings",title:e("sidebar.settings"),path:"settings"},{id:"proxy",title:e("sidebar.proxy"),path:"proxy"}]},{title:e("sidebar.events"),icon:Iz,children:[{id:"webhook",title:e("sidebar.webhook"),path:"webhook"},{id:"websocket",title:e("sidebar.websocket"),path:"websocket"},{id:"rabbitmq",title:e("sidebar.rabbitmq"),path:"rabbitmq"},{id:"sqs",title:e("sidebar.sqs"),path:"sqs"}]},{title:e("sidebar.integrations"),icon:R_,children:[{id:"evoai",title:e("sidebar.evoai"),path:"evoai"},{id:"n8n",title:e("sidebar.n8n"),path:"n8n"},{id:"evolutionBot",title:e("sidebar.evolutionBot"),path:"evolutionBot"},{id:"chatwoot",title:e("sidebar.chatwoot"),path:"chatwoot"},{id:"typebot",title:e("sidebar.typebot"),path:"typebot"},{id:"openai",title:e("sidebar.openai"),path:"openai"},{id:"dify",title:e("sidebar.dify"),path:"dify"},{id:"flowise",title:e("sidebar.flowise"),path:"flowise"}]},{id:"documentation",title:e("sidebar.documentation"),icon:_z,link:"https://doc.evolution-api.com",divider:!0},{id:"postman",title:e("sidebar.postman"),icon:wz,link:"https://evolution-api.com/postman"},{id:"discord",title:e("sidebar.discord"),icon:Cc,link:"https://evolution-api.com/discord"},{id:"support-premium",title:e("sidebar.supportPremium"),icon:Fz,link:"https://evolution-api.com/suporte-pro"}],[e]),n=Qt(),{pathname:r}=Yi(),{instance:s}=He(),o=c=>{!c||!s||(c.path&&n(`/manager/instance/${s.id}/${c.path}`),c.link&&window.open(c.link,"_blank"))},a=v.useMemo(()=>t.map(c=>{var u;return{...c,children:"children"in c?(u=c.children)==null?void 0:u.map(l=>({...l,isActive:"path"in l?r.includes(l.path):!1})):void 0,isActive:"path"in c&&c.path?r.includes(c.path):!1}}).map(c=>{var u;return{...c,isActive:c.isActive||"children"in c&&((u=c.children)==null?void 0:u.some(l=>l.isActive))}}),[t,r]);return i.jsx("ul",{className:"flex h-full w-full flex-col gap-2 border-r border-border px-2",children:a.map(c=>i.jsx("li",{className:"divider"in c?"mt-auto":void 0,children:c.children?i.jsxs(t8,{defaultOpen:c.isActive,children:[i.jsx(n8,{asChild:!0,children:i.jsxs($,{className:ve("flex w-full items-center justify-start gap-2"),variant:c.isActive?"secondary":"link",children:[c.icon&&i.jsx(c.icon,{size:"15"}),i.jsx("span",{children:c.title}),i.jsx(Lg,{size:"15",className:"ml-auto"})]})}),i.jsx(r8,{children:i.jsx("ul",{className:"my-4 ml-6 flex flex-col gap-2 text-sm",children:c.children.map(u=>i.jsx("li",{children:i.jsx("button",{onClick:()=>o(u),className:ve(u.isActive?"text-foreground":"text-muted-foreground"),children:i.jsx("span",{className:"nav-label",children:u.title})})},u.id))})})]}):i.jsxs($,{className:ve("relative flex w-full items-center justify-start gap-2",c.isActive&&"pointer-events-none"),variant:c.isActive?"secondary":"link",children:["link"in c&&i.jsx("a",{href:c.link,target:"_blank",rel:"noreferrer",className:"absolute inset-0 h-full w-full"}),"path"in c&&i.jsx(Ed,{to:`/manager/instance/${s==null?void 0:s.id}/${c.path}`,className:"absolute inset-0 h-full w-full"}),c.icon&&i.jsx(c.icon,{size:"15"}),i.jsx("span",{children:c.title})]})},c.title))})}function Ab(e,[t,n]){return Math.min(n,Math.max(t,e))}function o8(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var o0="ScrollArea",[YR,dce]=Xr(o0),[a8,es]=YR(o0),XR=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[c,u]=v.useState(null),[l,d]=v.useState(null),[p,f]=v.useState(null),[h,g]=v.useState(null),[m,x]=v.useState(null),[b,y]=v.useState(0),[w,S]=v.useState(0),[k,C]=v.useState(!1),[T,E]=v.useState(!1),N=ft(t,q=>u(q)),P=hf(s);return i.jsx(a8,{scope:n,type:r,dir:P,scrollHideDelay:o,scrollArea:c,viewport:l,onViewportChange:d,content:p,onContentChange:f,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:T,onScrollbarYEnabledChange:E,onCornerWidthChange:y,onCornerHeightChange:S,children:i.jsx(Fe.div,{dir:P,...a,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});XR.displayName=o0;var eP="ScrollAreaViewport",tP=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=es(eP,n),c=v.useRef(null),u=ft(t,c,a.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(Fe.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});tP.displayName=eP;var to="ScrollAreaScrollbar",a0=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=es(to,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,c=e.orientation==="horizontal";return v.useEffect(()=>(c?o(!0):a(!0),()=>{c?o(!1):a(!1)}),[c,o,a]),s.type==="hover"?i.jsx(i8,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(l8,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(nP,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(i0,{...r,ref:t}):null});a0.displayName=to;var i8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=es(to,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const c=s.scrollArea;let u=0;if(c){const l=()=>{window.clearTimeout(u),a(!0)},d=()=>{u=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",l),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",l),c.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(pr,{present:n||o,children:i.jsx(nP,{"data-state":o?"visible":"hidden",...r,ref:t})})}),l8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=es(to,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Yg(()=>u("SCROLL_END"),100),[c,u]=o8("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(c==="idle"){const l=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(l)}},[c,s.scrollHideDelay,u]),v.useEffect(()=>{const l=s.viewport,d=o?"scrollLeft":"scrollTop";if(l){let p=l[d];const f=()=>{const h=l[d];p!==h&&(u("SCROLL"),a()),p=h};return l.addEventListener("scroll",f),()=>l.removeEventListener("scroll",f)}},[s.viewport,o,u,a]),i.jsx(pr,{present:n||c!=="hidden",children:i.jsx(i0,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),nP=v.forwardRef((e,t)=>{const n=es(to,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=v.useState(!1),c=e.orientation==="horizontal",u=Yg(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=es(to,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[c,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=iP(c.viewport,c.content),d={...r,sizes:c,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function p(f,h){return h8(f,a.current,c,h)}return n==="horizontal"?i.jsx(c8,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,h=E1(f,c,s.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=p(f,s.dir))}}):n==="vertical"?i.jsx(u8,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,h=E1(f,c);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=p(f))}}):null}),c8=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=es(to,e.__scopeScrollArea),[a,c]=v.useState(),u=v.useRef(null),l=ft(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),i.jsx(sP,{"data-orientation":"horizontal",...s,ref:l,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Zg(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const f=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),cP(f,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:$h(a.paddingLeft),paddingEnd:$h(a.paddingRight)}})}})}),u8=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=es(to,e.__scopeScrollArea),[a,c]=v.useState(),u=v.useRef(null),l=ft(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),i.jsx(sP,{"data-orientation":"vertical",...s,ref:l,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Zg(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const f=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),cP(f,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:$h(a.paddingTop),paddingEnd:$h(a.paddingBottom)}})}})}),[d8,rP]=YR(to),sP=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:d,onResize:p,...f}=e,h=es(to,n),[g,m]=v.useState(null),x=ft(t,N=>m(N)),b=v.useRef(null),y=v.useRef(""),w=h.viewport,S=r.content-r.viewport,k=ln(d),C=ln(u),T=Yg(p,10);function E(N){if(b.current){const P=N.clientX-b.current.left,q=N.clientY-b.current.top;l({x:P,y:q})}}return v.useEffect(()=>{const N=P=>{const q=P.target;(g==null?void 0:g.contains(q))&&k(P,S)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[w,g,S,k]),v.useEffect(C,[r,C]),Ec(g,T),Ec(h.content,T),i.jsx(d8,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:ln(o),onThumbPointerUp:ln(a),onThumbPositionChange:C,onThumbPointerDown:ln(c),children:i.jsx(Fe.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:ke(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),b.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),E(N))}),onPointerMove:ke(e.onPointerMove,E),onPointerUp:ke(e.onPointerUp,N=>{const P=N.target;P.hasPointerCapture(N.pointerId)&&P.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),b.current=null})})})}),Lh="ScrollAreaThumb",oP=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=rP(Lh,e.__scopeScrollArea);return i.jsx(pr,{present:n||s.hasThumb,children:i.jsx(f8,{ref:t,...r})})}),f8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=es(Lh,n),a=rP(Lh,n),{onThumbPositionChange:c}=a,u=ft(t,p=>a.onThumbChange(p)),l=v.useRef(),d=Yg(()=>{l.current&&(l.current(),l.current=void 0)},100);return v.useEffect(()=>{const p=o.viewport;if(p){const f=()=>{if(d(),!l.current){const h=g8(p,c);l.current=h,c()}};return c(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[o.viewport,d,c]),i.jsx(Fe.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(e.onPointerDownCapture,p=>{const h=p.target.getBoundingClientRect(),g=p.clientX-h.left,m=p.clientY-h.top;a.onThumbPointerDown({x:g,y:m})}),onPointerUp:ke(e.onPointerUp,a.onThumbPointerUp)})});oP.displayName=Lh;var l0="ScrollAreaCorner",aP=v.forwardRef((e,t)=>{const n=es(l0,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(p8,{...e,ref:t}):null});aP.displayName=l0;var p8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=es(l0,n),[o,a]=v.useState(0),[c,u]=v.useState(0),l=!!(o&&c);return Ec(s.scrollbarX,()=>{var p;const d=((p=s.scrollbarX)==null?void 0:p.offsetHeight)||0;s.onCornerHeightChange(d),u(d)}),Ec(s.scrollbarY,()=>{var p;const d=((p=s.scrollbarY)==null?void 0:p.offsetWidth)||0;s.onCornerWidthChange(d),a(d)}),l?i.jsx(Fe.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function $h(e){return e?parseInt(e,10):0}function iP(e,t){const n=e/t;return isNaN(n)?0:n}function Zg(e){const t=iP(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function h8(e,t,n,r="ltr"){const s=Zg(n),o=s/2,a=t||o,c=s-a,u=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,p=r==="ltr"?[0,d]:[d*-1,0];return lP([u,l],p)(e)}function E1(e,t,n="ltr"){const r=Zg(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,c=o-r,u=n==="ltr"?[0,a]:[a*-1,0],l=Ab(e,u);return lP([0,a],[0,c])(l)}function lP(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cP(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,c=n.top!==o.top;(a||c)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Yg(e,t){const n=ln(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ec(e,t){const n=ln(t);mn(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var uP=XR,m8=tP,v8=aP;const Fb=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(uP,{ref:r,className:ve("relative overflow-hidden",e),...n,children:[i.jsx(m8,{className:"h-full w-full rounded-[inherit] [&>div[style]]:!block [&>div[style]]:h-full",children:t}),i.jsx(dP,{}),i.jsx(v8,{})]}));Fb.displayName=uP.displayName;const dP=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(a0,{ref:r,orientation:t,className:ve("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(oP,{className:ve("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));dP.displayName=a0.displayName;function Ut({children:e}){const{instanceId:t}=Zr();return i.jsx(WR,{children:i.jsxs("div",{className:"flex h-screen flex-col",children:[i.jsx(qR,{instanceId:t}),i.jsxs("div",{className:"flex min-h-[calc(100vh_-_56px)] flex-1 flex-col md:flex-row",children:[i.jsx(Fb,{className:"mr-2 py-6 md:w-64",children:i.jsx("div",{className:"flex h-full",children:i.jsx(s8,{})})}),i.jsx(Fb,{className:"w-full",children:i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"my-2 flex flex-1 flex-col gap-2 pl-2 pr-4",children:e}),i.jsx(Ew,{})]})})]})]})})}function y8({children:e}){return i.jsxs("div",{className:"flex h-full min-h-screen flex-col",children:[i.jsx(qR,{}),i.jsx("main",{className:"flex-1",children:e}),i.jsx(Ew,{})]})}const b8=Fg("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",warning:"border-transparent bg-amber-600 text-amber-100 hover:bg-amber-600/80"}},defaultVariants:{variant:"default"}});function np({className:e,variant:t,...n}){return i.jsx("div",{className:ve(b8({variant:t}),e),...n})}function fP({status:e}){const{t}=Ee();return e?e==="open"?i.jsx(np,{children:t("status.open")}):e==="connecting"?i.jsx(np,{variant:"warning",children:t("status.connecting")}):e==="close"||e==="closed"?i.jsx(np,{variant:"destructive",children:t("status.closed")}):i.jsx(np,{variant:"secondary",children:e}):null}const x8=e=>{navigator.clipboard.writeText(e),Z.success("Copiado para a área de transferência")};function pP({token:e,className:t}){const[n,r]=v.useState(!1);return i.jsxs("div",{className:ve("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",t),children:[i.jsx("pre",{className:"block truncate text-xs",children:n?e:e==null?void 0:e.replace(/\w/g,"*")}),i.jsx($,{variant:"ghost",size:"icon",onClick:()=>{x8(e)},children:i.jsx(kz,{size:"15"})}),i.jsx($,{variant:"ghost",size:"icon",onClick:()=>{r(s=>!s)},children:n?i.jsx(jz,{size:"15"}):i.jsx(Tz,{size:"15"})})]})}const fi=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ve("flex flex-col rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));fi.displayName="Card";const pi=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ve("flex flex-col space-y-1.5 p-6",e),...t}));pi.displayName="CardHeader";const Qu=v.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:ve("text-2xl font-semibold leading-none tracking-tight",e),...t}));Qu.displayName="CardTitle";const hP=v.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:ve("text-sm text-muted-foreground",e),...t}));hP.displayName="CardDescription";const hi=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ve("p-6 pt-0",e),...t}));hi.displayName="CardContent";const Xg=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ve("flex items-center p-6 pt-0",e),...t}));Xg.displayName="CardFooter";const gP="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",L=v.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:ve(gP,e),ref:r,...n}));L.displayName="Input";const w8=["instance","fetchInstances"],S8=async()=>(await pf.get("/instance/fetchInstances")).data,C8=e=>We({...e,queryKey:w8,queryFn:()=>S8()});function Ae(e,t){const n=Ex(),r=FF({mutationFn:e});return(s,o)=>r.mutateAsync(s,{onSuccess:async(a,c,u)=>{var l;t!=null&&t.invalidateKeys&&await Promise.all(t.invalidateKeys.map(d=>n.invalidateQueries({queryKey:d}))),(l=o==null?void 0:o.onSuccess)==null||l.call(o,a,c,u)},onError(a,c,u){var l;(l=o==null?void 0:o.onError)==null||l.call(o,a,c,u)},onSettled(a,c,u,l){var d;(d=o==null?void 0:o.onSettled)==null||d.call(o,a,c,u,l)}})}const k8=async e=>(await pf.post("/instance/create",e)).data,E8=async e=>(await le.post(`/instance/restart/${e}`)).data,j8=async e=>(await le.delete(`/instance/logout/${e}`)).data,T8=async e=>(await pf.delete(`/instance/delete/${e}`)).data,N8=async({instanceName:e,token:t,number:n})=>(await le.get(`/instance/connect/${e}`,{headers:{apikey:t},params:{number:n}})).data,_8=async({instanceName:e,token:t,data:n})=>(await le.post(`/settings/set/${e}`,n,{headers:{apikey:t}})).data;function em(){const e=Ae(N8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),t=Ae(_8,{invalidateKeys:[["instance","fetchSettings"]]}),n=Ae(T8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),r=Ae(j8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),s=Ae(E8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),o=Ae(k8,{invalidateKeys:[["instance","fetchInstances"]]});return{connect:e,updateSettings:t,deleteInstance:n,logout:r,restart:s,createInstance:o}}var yf=e=>e.type==="checkbox",$l=e=>e instanceof Date,Gn=e=>e==null;const mP=e=>typeof e=="object";var vn=e=>!Gn(e)&&!Array.isArray(e)&&mP(e)&&!$l(e),vP=e=>vn(e)&&e.target?yf(e.target)?e.target.checked:e.target.value:e,M8=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,yP=(e,t)=>e.has(M8(t)),R8=e=>{const t=e.constructor&&e.constructor.prototype;return vn(t)&&t.hasOwnProperty("isPrototypeOf")},c0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function nr(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(c0&&(e instanceof Blob||e instanceof FileList))&&(n||vn(e)))if(t=n?[]:{},!n&&!R8(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=nr(e[r]));else return e;return t}var tm=e=>Array.isArray(e)?e.filter(Boolean):[],en=e=>e===void 0,fe=(e,t,n)=>{if(!t||!vn(e))return n;const r=tm(t.split(/[,[\].]+?/)).reduce((s,o)=>Gn(s)?s:s[o],e);return en(r)||r===e?en(e[t])?n:e[t]:r},Ls=e=>typeof e=="boolean",u0=e=>/^\w*$/.test(e),bP=e=>tm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),wt=(e,t,n)=>{let r=-1;const s=u0(t)?[t]:bP(t),o=s.length,a=o-1;for(;++rTe.useContext(xP),Pn=e=>{const{children:t,...n}=e;return Te.createElement(xP.Provider,{value:n},t)};var wP=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==cs.all&&(t._proxyFormState[a]=!r||cs.all),n&&(n[a]=!0),e[a]}});return s},vr=e=>vn(e)&&!Object.keys(e).length,SP=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return vr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||cs.all))},Zu=e=>Array.isArray(e)?e:[e],CP=(e,t,n)=>!e||!t||e===t||Zu(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function d0(e){const t=Te.useRef(e);t.current=e,Te.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function P8(e){const t=nm(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[a,c]=Te.useState(n._formState),u=Te.useRef(!0),l=Te.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Te.useRef(s);return d.current=s,d0({disabled:r,next:p=>u.current&&CP(d.current,p.name,o)&&SP(p,l.current,n._updateFormState)&&c({...n._formState,...p}),subject:n._subjects.state}),Te.useEffect(()=>(u.current=!0,l.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),wP(a,n,l.current,!1)}var Us=e=>typeof e=="string",kP=(e,t,n,r,s)=>Us(e)?(r&&t.watch.add(e),fe(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),fe(n,o))):(r&&(t.watchAll=!0),n);function O8(e){const t=nm(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:a}=e||{},c=Te.useRef(r);c.current=r,d0({disabled:o,subject:n._subjects.values,next:d=>{CP(c.current,d.name,a)&&l(nr(kP(c.current,n._names,d.values||n._formValues,!1,s)))}});const[u,l]=Te.useState(n._getWatch(r,s));return Te.useEffect(()=>n._removeUnmounted()),u}function I8(e){const t=nm(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,a=yP(s._names.array,n),c=O8({control:s,name:n,defaultValue:fe(s._formValues,n,fe(s._defaultValues,n,e.defaultValue)),exact:!0}),u=P8({control:s,name:n}),l=Te.useRef(s.register(n,{...e.rules,value:c,...Ls(e.disabled)?{disabled:e.disabled}:{}}));return Te.useEffect(()=>{const d=s._options.shouldUnregister||o,p=(f,h)=>{const g=fe(s._fields,f);g&&g._f&&(g._f.mount=h)};if(p(n,!0),d){const f=nr(fe(s._options.defaultValues,n));wt(s._defaultValues,n,f),en(fe(s._formValues,n))&&wt(s._formValues,n,f)}return()=>{(a?d&&!s._state.action:d)?s.unregister(n):p(n,!1)}},[n,s,a,o]),Te.useEffect(()=>{fe(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:fe(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:c,...Ls(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:Te.useCallback(d=>l.current.onChange({target:{value:vP(d),name:n},type:Bh.CHANGE}),[n]),onBlur:Te.useCallback(()=>l.current.onBlur({target:{value:fe(s._formValues,n),name:n},type:Bh.BLUR}),[n,s]),ref:d=>{const p=fe(s._fields,n);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:f=>d.setCustomValidity(f),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!fe(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!fe(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!fe(u.validatingFields,n)},error:{enumerable:!0,get:()=>fe(u.errors,n)}})}}const D8=e=>e.render(I8(e));var EP=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},j1=e=>({isOnSubmit:!e||e===cs.onSubmit,isOnBlur:e===cs.onBlur,isOnChange:e===cs.onChange,isOnAll:e===cs.all,isOnTouch:e===cs.onTouched}),T1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Yu=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=fe(e,s);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!r)break;if(a.ref&&t(a.ref,a.name)&&!r)break;Yu(c,t)}else vn(c)&&Yu(c,t)}}};var A8=(e,t,n)=>{const r=Zu(fe(e,n));return wt(r,"root",t[n]),wt(e,n,r),e},f0=e=>e.type==="file",ma=e=>typeof e=="function",zh=e=>{if(!c0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Lp=e=>Us(e),p0=e=>e.type==="radio",Uh=e=>e instanceof RegExp;const N1={value:!1,isValid:!1},_1={value:!0,isValid:!0};var jP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!en(e[0].attributes.value)?en(e[0].value)||e[0].value===""?_1:{value:e[0].value,isValid:!0}:_1:N1}return N1};const M1={isValid:!1,value:null};var TP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,M1):M1;function R1(e,t,n="validate"){if(Lp(e)||Array.isArray(e)&&e.every(Lp)||Ls(e)&&!e)return{type:n,message:Lp(e)?e:"",ref:t}}var vl=e=>vn(e)&&!Uh(e)?e:{value:e,message:""},P1=async(e,t,n,r,s)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:l,min:d,max:p,pattern:f,validate:h,name:g,valueAsNumber:m,mount:x,disabled:b}=e._f,y=fe(t,g);if(!x||b)return{};const w=a?a[0]:o,S=O=>{r&&w.reportValidity&&(w.setCustomValidity(Ls(O)?"":O||""),w.reportValidity())},k={},C=p0(o),T=yf(o),E=C||T,N=(m||f0(o))&&en(o.value)&&en(y)||zh(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,P=EP.bind(null,g,n,k),q=(O,Y,B,ee=oo.maxLength,K=oo.minLength)=>{const V=O?Y:B;k[g]={type:O?ee:K,message:V,ref:o,...P(O?ee:K,V)}};if(s?!Array.isArray(y)||!y.length:c&&(!E&&(N||Gn(y))||Ls(y)&&!y||T&&!jP(a).isValid||C&&!TP(a).isValid)){const{value:O,message:Y}=Lp(c)?{value:!!c,message:c}:vl(c);if(O&&(k[g]={type:oo.required,message:Y,ref:w,...P(oo.required,Y)},!n))return S(Y),k}if(!N&&(!Gn(d)||!Gn(p))){let O,Y;const B=vl(p),ee=vl(d);if(!Gn(y)&&!isNaN(y)){const K=o.valueAsNumber||y&&+y;Gn(B.value)||(O=K>B.value),Gn(ee.value)||(Y=Knew Date(new Date().toDateString()+" "+X),A=o.type=="time",D=o.type=="week";Us(B.value)&&y&&(O=A?V(y)>V(B.value):D?y>B.value:K>new Date(B.value)),Us(ee.value)&&y&&(Y=A?V(y)+O.value,ee=!Gn(Y.value)&&y.length<+Y.value;if((B||ee)&&(q(B,O.message,Y.message),!n))return S(k[g].message),k}if(f&&!N&&Us(y)){const{value:O,message:Y}=vl(f);if(Uh(O)&&!y.match(O)&&(k[g]={type:oo.pattern,message:Y,ref:o,...P(oo.pattern,Y)},!n))return S(Y),k}if(h){if(ma(h)){const O=await h(y,t),Y=R1(O,w);if(Y&&(k[g]={...Y,...P(oo.validate,Y.message)},!n))return S(Y.message),k}else if(vn(h)){let O={};for(const Y in h){if(!vr(O)&&!n)break;const B=R1(await h[Y](y,t),w,Y);B&&(O={...B,...P(Y,B.message)},S(B.message),n&&(k[g]=O))}if(!vr(O)&&(k[g]={ref:w,...O},!n))return k}}return S(!0),k};function F8(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},Vh=e=>Gn(e)||!mP(e);function gi(e,t){if(Vh(e)||Vh(t))return e===t;if($l(e)&&$l(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const a=t[s];if($l(o)&&$l(a)||vn(o)&&vn(a)||Array.isArray(o)&&Array.isArray(a)?!gi(o,a):o!==a)return!1}}return!0}var NP=e=>e.type==="select-multiple",$8=e=>p0(e)||yf(e),_v=e=>zh(e)&&e.isConnected,_P=e=>{for(const t in e)if(ma(e[t]))return!0;return!1};function Hh(e,t={}){const n=Array.isArray(e);if(vn(e)||n)for(const r in e)Array.isArray(e[r])||vn(e[r])&&!_P(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Hh(e[r],t[r])):Gn(e[r])||(t[r]=!0);return t}function MP(e,t,n){const r=Array.isArray(e);if(vn(e)||r)for(const s in e)Array.isArray(e[s])||vn(e[s])&&!_P(e[s])?en(t)||Vh(n[s])?n[s]=Array.isArray(e[s])?Hh(e[s],[]):{...Hh(e[s])}:MP(e[s],Gn(t)?{}:t[s],n[s]):n[s]=!gi(e[s],t[s]);return n}var rp=(e,t)=>MP(e,t,Hh(t)),RP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>en(e)?e:t?e===""?NaN:e&&+e:n&&Us(e)?new Date(e):r?r(e):e;function Mv(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return f0(t)?t.files:p0(t)?TP(e.refs).value:NP(t)?[...t.selectedOptions].map(({value:n})=>n):yf(t)?jP(e.refs).value:RP(en(t.value)?e.ref.value:t.value,e)}var B8=(e,t,n,r)=>{const s={};for(const o of e){const a=fe(t,o);a&&wt(s,o,a._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},vu=e=>en(e)?e:Uh(e)?e.source:vn(e)?Uh(e.value)?e.value.source:e.value:e,z8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function O1(e,t,n){const r=fe(e,n);if(r||u0(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),a=fe(t,o),c=fe(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};s.pop()}return{name:n}}var U8=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,V8=(e,t)=>!tm(fe(e,t)).length&&fn(e,t);const H8={mode:cs.onSubmit,reValidateMode:cs.onChange,shouldFocusError:!0};function q8(e={}){let t={...H8,...e},n={submitCount:0,isDirty:!1,isLoading:ma(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=vn(t.defaultValues)||vn(t.values)?nr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:nr(s),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:Nv(),array:Nv(),state:Nv()},f=j1(t.mode),h=j1(t.reValidateMode),g=t.criteriaMode===cs.all,m=_=>F=>{clearTimeout(l),l=setTimeout(_,F)},x=async _=>{if(d.isValid||_){const F=t.resolver?vr((await E()).errors):await P(r,!0);F!==n.isValid&&p.state.next({isValid:F})}},b=(_,F)=>{(d.isValidating||d.validatingFields)&&((_||Array.from(c.mount)).forEach(J=>{J&&(F?wt(n.validatingFields,J,F):fn(n.validatingFields,J))}),p.state.next({validatingFields:n.validatingFields,isValidating:!vr(n.validatingFields)}))},y=(_,F=[],J,me,ue=!0,ce=!0)=>{if(me&&J){if(a.action=!0,ce&&Array.isArray(fe(r,_))){const Ne=J(fe(r,_),me.argA,me.argB);ue&&wt(r,_,Ne)}if(ce&&Array.isArray(fe(n.errors,_))){const Ne=J(fe(n.errors,_),me.argA,me.argB);ue&&wt(n.errors,_,Ne),V8(n.errors,_)}if(d.touchedFields&&ce&&Array.isArray(fe(n.touchedFields,_))){const Ne=J(fe(n.touchedFields,_),me.argA,me.argB);ue&&wt(n.touchedFields,_,Ne)}d.dirtyFields&&(n.dirtyFields=rp(s,o)),p.state.next({name:_,isDirty:O(_,F),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else wt(o,_,F)},w=(_,F)=>{wt(n.errors,_,F),p.state.next({errors:n.errors})},S=_=>{n.errors=_,p.state.next({errors:n.errors,isValid:!1})},k=(_,F,J,me)=>{const ue=fe(r,_);if(ue){const ce=fe(o,_,en(J)?fe(s,_):J);en(ce)||me&&me.defaultChecked||F?wt(o,_,F?ce:Mv(ue._f)):ee(_,ce),a.mount&&x()}},C=(_,F,J,me,ue)=>{let ce=!1,Ne=!1;const rt={name:_},Pt=!!(fe(r,_)&&fe(r,_)._f&&fe(r,_)._f.disabled);if(!J||me){d.isDirty&&(Ne=n.isDirty,n.isDirty=rt.isDirty=O(),ce=Ne!==rt.isDirty);const yn=Pt||gi(fe(s,_),F);Ne=!!(!Pt&&fe(n.dirtyFields,_)),yn||Pt?fn(n.dirtyFields,_):wt(n.dirtyFields,_,!0),rt.dirtyFields=n.dirtyFields,ce=ce||d.dirtyFields&&Ne!==!yn}if(J){const yn=fe(n.touchedFields,_);yn||(wt(n.touchedFields,_,J),rt.touchedFields=n.touchedFields,ce=ce||d.touchedFields&&yn!==J)}return ce&&ue&&p.state.next(rt),ce?rt:{}},T=(_,F,J,me)=>{const ue=fe(n.errors,_),ce=d.isValid&&Ls(F)&&n.isValid!==F;if(e.delayError&&J?(u=m(()=>w(_,J)),u(e.delayError)):(clearTimeout(l),u=null,J?wt(n.errors,_,J):fn(n.errors,_)),(J?!gi(ue,J):ue)||!vr(me)||ce){const Ne={...me,...ce&&Ls(F)?{isValid:F}:{},errors:n.errors,name:_};n={...n,...Ne},p.state.next(Ne)}},E=async _=>{b(_,!0);const F=await t.resolver(o,t.context,B8(_||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(_),F},N=async _=>{const{errors:F}=await E(_);if(_)for(const J of _){const me=fe(F,J);me?wt(n.errors,J,me):fn(n.errors,J)}else n.errors=F;return F},P=async(_,F,J={valid:!0})=>{for(const me in _){const ue=_[me];if(ue){const{_f:ce,...Ne}=ue;if(ce){const rt=c.array.has(ce.name);b([me],!0);const Pt=await P1(ue,o,g,t.shouldUseNativeValidation&&!F,rt);if(b([me]),Pt[ce.name]&&(J.valid=!1,F))break;!F&&(fe(Pt,ce.name)?rt?A8(n.errors,Pt,ce.name):wt(n.errors,ce.name,Pt[ce.name]):fn(n.errors,ce.name))}Ne&&await P(Ne,F,J)}}return J.valid},q=()=>{for(const _ of c.unMount){const F=fe(r,_);F&&(F._f.refs?F._f.refs.every(J=>!_v(J)):!_v(F._f.ref))&&re(_)}c.unMount=new Set},O=(_,F)=>(_&&F&&wt(o,_,F),!gi(se(),s)),Y=(_,F,J)=>kP(_,c,{...a.mount?o:en(F)?s:Us(_)?{[_]:F}:F},J,F),B=_=>tm(fe(a.mount?o:s,_,e.shouldUnregister?fe(s,_,[]):[])),ee=(_,F,J={})=>{const me=fe(r,_);let ue=F;if(me){const ce=me._f;ce&&(!ce.disabled&&wt(o,_,RP(F,ce)),ue=zh(ce.ref)&&Gn(F)?"":F,NP(ce.ref)?[...ce.ref.options].forEach(Ne=>Ne.selected=ue.includes(Ne.value)):ce.refs?yf(ce.ref)?ce.refs.length>1?ce.refs.forEach(Ne=>(!Ne.defaultChecked||!Ne.disabled)&&(Ne.checked=Array.isArray(ue)?!!ue.find(rt=>rt===Ne.value):ue===Ne.value)):ce.refs[0]&&(ce.refs[0].checked=!!ue):ce.refs.forEach(Ne=>Ne.checked=Ne.value===ue):f0(ce.ref)?ce.ref.value="":(ce.ref.value=ue,ce.ref.type||p.values.next({name:_,values:{...o}})))}(J.shouldDirty||J.shouldTouch)&&C(_,ue,J.shouldTouch,J.shouldDirty,!0),J.shouldValidate&&X(_)},K=(_,F,J)=>{for(const me in F){const ue=F[me],ce=`${_}.${me}`,Ne=fe(r,ce);(c.array.has(_)||!Vh(ue)||Ne&&!Ne._f)&&!$l(ue)?K(ce,ue,J):ee(ce,ue,J)}},V=(_,F,J={})=>{const me=fe(r,_),ue=c.array.has(_),ce=nr(F);wt(o,_,ce),ue?(p.array.next({name:_,values:{...o}}),(d.isDirty||d.dirtyFields)&&J.shouldDirty&&p.state.next({name:_,dirtyFields:rp(s,o),isDirty:O(_,ce)})):me&&!me._f&&!Gn(ce)?K(_,ce,J):ee(_,ce,J),T1(_,c)&&p.state.next({...n}),p.values.next({name:a.mount?_:void 0,values:{...o}})},A=async _=>{a.mount=!0;const F=_.target;let J=F.name,me=!0;const ue=fe(r,J),ce=()=>F.type?Mv(ue._f):vP(_),Ne=rt=>{me=Number.isNaN(rt)||rt===fe(o,J,rt)};if(ue){let rt,Pt;const yn=ce(),kn=_.type===Bh.BLUR||_.type===Bh.FOCUS_OUT,bn=!z8(ue._f)&&!t.resolver&&!fe(n.errors,J)&&!ue._f.deps||U8(kn,fe(n.touchedFields,J),n.isSubmitted,h,f),Vo=T1(J,c,kn);wt(o,J,yn),kn?(ue._f.onBlur&&ue._f.onBlur(_),u&&u(0)):ue._f.onChange&&ue._f.onChange(_);const Es=C(J,yn,kn,!1),Xa=!vr(Es)||Vo;if(!kn&&p.values.next({name:J,type:_.type,values:{...o}}),bn)return d.isValid&&x(),Xa&&p.state.next({name:J,...Vo?{}:Es});if(!kn&&Vo&&p.state.next({...n}),t.resolver){const{errors:Vn}=await E([J]);if(Ne(yn),me){const de=O1(n.errors,r,J),qe=O1(Vn,r,de.name||J);rt=qe.error,J=qe.name,Pt=vr(Vn)}}else b([J],!0),rt=(await P1(ue,o,g,t.shouldUseNativeValidation))[J],b([J]),Ne(yn),me&&(rt?Pt=!1:d.isValid&&(Pt=await P(r,!0)));me&&(ue._f.deps&&X(ue._f.deps),T(J,Pt,rt,Es))}},D=(_,F)=>{if(fe(n.errors,F)&&_.focus)return _.focus(),1},X=async(_,F={})=>{let J,me;const ue=Zu(_);if(t.resolver){const ce=await N(en(_)?_:ue);J=vr(ce),me=_?!ue.some(Ne=>fe(ce,Ne)):J}else _?(me=(await Promise.all(ue.map(async ce=>{const Ne=fe(r,ce);return await P(Ne&&Ne._f?{[ce]:Ne}:Ne)}))).every(Boolean),!(!me&&!n.isValid)&&x()):me=J=await P(r);return p.state.next({...!Us(_)||d.isValid&&J!==n.isValid?{}:{name:_},...t.resolver||!_?{isValid:J}:{},errors:n.errors}),F.shouldFocus&&!me&&Yu(r,D,_?ue:c.mount),me},se=_=>{const F={...a.mount?o:s};return en(_)?F:Us(_)?fe(F,_):_.map(J=>fe(F,J))},H=(_,F)=>({invalid:!!fe((F||n).errors,_),isDirty:!!fe((F||n).dirtyFields,_),error:fe((F||n).errors,_),isValidating:!!fe(n.validatingFields,_),isTouched:!!fe((F||n).touchedFields,_)}),oe=_=>{_&&Zu(_).forEach(F=>fn(n.errors,F)),p.state.next({errors:_?n.errors:{}})},Q=(_,F,J)=>{const me=(fe(r,_,{_f:{}})._f||{}).ref,ue=fe(n.errors,_)||{},{ref:ce,message:Ne,type:rt,...Pt}=ue;wt(n.errors,_,{...Pt,...F,ref:me}),p.state.next({name:_,errors:n.errors,isValid:!1}),J&&J.shouldFocus&&me&&me.focus&&me.focus()},ne=(_,F)=>ma(_)?p.values.subscribe({next:J=>_(Y(void 0,F),J)}):Y(_,F,!0),re=(_,F={})=>{for(const J of _?Zu(_):c.mount)c.mount.delete(J),c.array.delete(J),F.keepValue||(fn(r,J),fn(o,J)),!F.keepError&&fn(n.errors,J),!F.keepDirty&&fn(n.dirtyFields,J),!F.keepTouched&&fn(n.touchedFields,J),!F.keepIsValidating&&fn(n.validatingFields,J),!t.shouldUnregister&&!F.keepDefaultValue&&fn(s,J);p.values.next({values:{...o}}),p.state.next({...n,...F.keepDirty?{isDirty:O()}:{}}),!F.keepIsValid&&x()},W=({disabled:_,name:F,field:J,fields:me,value:ue})=>{if(Ls(_)&&a.mount||_){const ce=_?void 0:en(ue)?Mv(J?J._f:fe(me,F)._f):ue;wt(o,F,ce),C(F,ce,!1,!1,!0)}},ge=(_,F={})=>{let J=fe(r,_);const me=Ls(F.disabled);return wt(r,_,{...J||{},_f:{...J&&J._f?J._f:{ref:{name:_}},name:_,mount:!0,...F}}),c.mount.add(_),J?W({field:J,disabled:F.disabled,name:_,value:F.value}):k(_,!0,F.value),{...me?{disabled:F.disabled}:{},...t.progressive?{required:!!F.required,min:vu(F.min),max:vu(F.max),minLength:vu(F.minLength),maxLength:vu(F.maxLength),pattern:vu(F.pattern)}:{},name:_,onChange:A,onBlur:A,ref:ue=>{if(ue){ge(_,F),J=fe(r,_);const ce=en(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,Ne=$8(ce),rt=J._f.refs||[];if(Ne?rt.find(Pt=>Pt===ce):ce===J._f.ref)return;wt(r,_,{_f:{...J._f,...Ne?{refs:[...rt.filter(_v),ce,...Array.isArray(fe(s,_))?[{}]:[]],ref:{type:ce.type,name:_}}:{ref:ce}}}),k(_,!1,void 0,ce)}else J=fe(r,_,{}),J._f&&(J._f.mount=!1),(t.shouldUnregister||F.shouldUnregister)&&!(yP(c.array,_)&&a.action)&&c.unMount.add(_)}}},je=()=>t.shouldFocusError&&Yu(r,D,c.mount),Pe=_=>{Ls(_)&&(p.state.next({disabled:_}),Yu(r,(F,J)=>{const me=fe(r,J);me&&(F.disabled=me._f.disabled||_,Array.isArray(me._f.refs)&&me._f.refs.forEach(ue=>{ue.disabled=me._f.disabled||_}))},0,!1))},Ie=(_,F)=>async J=>{let me;J&&(J.preventDefault&&J.preventDefault(),J.persist&&J.persist());let ue=nr(o);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:ce,values:Ne}=await E();n.errors=ce,ue=Ne}else await P(r);if(fn(n.errors,"root"),vr(n.errors)){p.state.next({errors:{}});try{await _(ue,J)}catch(ce){me=ce}}else F&&await F({...n.errors},J),je(),setTimeout(je);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:vr(n.errors)&&!me,submitCount:n.submitCount+1,errors:n.errors}),me)throw me},ye=(_,F={})=>{fe(r,_)&&(en(F.defaultValue)?V(_,nr(fe(s,_))):(V(_,F.defaultValue),wt(s,_,nr(F.defaultValue))),F.keepTouched||fn(n.touchedFields,_),F.keepDirty||(fn(n.dirtyFields,_),n.isDirty=F.defaultValue?O(_,nr(fe(s,_))):O()),F.keepError||(fn(n.errors,_),d.isValid&&x()),p.state.next({...n}))},ot=(_,F={})=>{const J=_?nr(_):s,me=nr(J),ue=vr(_),ce=ue?s:me;if(F.keepDefaultValues||(s=J),!F.keepValues){if(F.keepDirtyValues)for(const Ne of c.mount)fe(n.dirtyFields,Ne)?wt(ce,Ne,fe(o,Ne)):V(Ne,fe(ce,Ne));else{if(c0&&en(_))for(const Ne of c.mount){const rt=fe(r,Ne);if(rt&&rt._f){const Pt=Array.isArray(rt._f.refs)?rt._f.refs[0]:rt._f.ref;if(zh(Pt)){const yn=Pt.closest("form");if(yn){yn.reset();break}}}}r={}}o=e.shouldUnregister?F.keepDefaultValues?nr(s):{}:nr(ce),p.array.next({values:{...ce}}),p.values.next({values:{...ce}})}c={mount:F.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!F.keepIsValid||!!F.keepDirtyValues,a.watch=!!e.shouldUnregister,p.state.next({submitCount:F.keepSubmitCount?n.submitCount:0,isDirty:ue?!1:F.keepDirty?n.isDirty:!!(F.keepDefaultValues&&!gi(_,s)),isSubmitted:F.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ue?{}:F.keepDirtyValues?F.keepDefaultValues&&o?rp(s,o):n.dirtyFields:F.keepDefaultValues&&_?rp(s,_):F.keepDirty?n.dirtyFields:{},touchedFields:F.keepTouched?n.touchedFields:{},errors:F.keepErrors?n.errors:{},isSubmitSuccessful:F.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ht=(_,F)=>ot(ma(_)?_(o):_,F);return{control:{register:ge,unregister:re,getFieldState:H,handleSubmit:Ie,setError:Q,_executeSchema:E,_getWatch:Y,_getDirty:O,_updateValid:x,_removeUnmounted:q,_updateFieldArray:y,_updateDisabledField:W,_getFieldArray:B,_reset:ot,_resetDefaultValues:()=>ma(t.defaultValues)&&t.defaultValues().then(_=>{Ht(_,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:_=>{n={...n,..._}},_disableForm:Pe,_subjects:p,_proxyFormState:d,_setErrors:S,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(_){a=_},get _defaultValues(){return s},get _names(){return c},set _names(_){c=_},get _formState(){return n},set _formState(_){n=_},get _options(){return t},set _options(_){t={...t,..._}}},trigger:X,register:ge,handleSubmit:Ie,watch:ne,setValue:V,getValues:se,reset:Ht,resetField:ye,clearErrors:oe,unregister:re,setError:Q,setFocus:(_,F={})=>{const J=fe(r,_),me=J&&J._f;if(me){const ue=me.refs?me.refs[0]:me.ref;ue.focus&&(ue.focus(),F.shouldSelect&&ue.select())}},getFieldState:H}}function $t(e={}){const t=Te.useRef(),n=Te.useRef(),[r,s]=Te.useState({isDirty:!1,isValidating:!1,isLoading:ma(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ma(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...q8(e),formState:r});const o=t.current.control;return o._options=e,d0({subject:o._subjects.state,next:a=>{SP(a,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),Te.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Te.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),Te.useEffect(()=>{e.values&&!gi(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),Te.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Te.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Te.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=wP(r,o),t.current}const I1=(e,t,n)=>{if(e&&"reportValidity"in e){const r=fe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},PP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?I1(r.ref,n,e):r.refs&&r.refs.forEach(s=>I1(s,n,e))}},K8=(e,t)=>{t.shouldUseNativeValidation&&PP(e,t);const n={};for(const r in e){const s=fe(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(W8(t.names||Object.keys(e),r)){const a=Object.assign({},fe(n,r));wt(a,"root",o),wt(n,r,a)}else wt(n,r,o)}return n},W8=(e,t)=>e.some(n=>n.startsWith(t+"."));var G8=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.code}}else n[a]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(p){return e.push(p)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=EP(a,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n},Bt=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(a,c){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&PP({},o),{errors:{},values:n.raw?r:l}})}catch(l){return c(l)}return u&&u.then?u.then(void 0,c):u}(0,function(a){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(a))return{values:{},errors:K8(G8(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},jn=[];for(var Rv=0;Rv<256;++Rv)jn.push((Rv+256).toString(16).slice(1));function J8(e,t=0){return(jn[e[t+0]]+jn[e[t+1]]+jn[e[t+2]]+jn[e[t+3]]+"-"+jn[e[t+4]]+jn[e[t+5]]+"-"+jn[e[t+6]]+jn[e[t+7]]+"-"+jn[e[t+8]]+jn[e[t+9]]+"-"+jn[e[t+10]]+jn[e[t+11]]+jn[e[t+12]]+jn[e[t+13]]+jn[e[t+14]]+jn[e[t+15]]).toLowerCase()}var sp,Q8=new Uint8Array(16);function Z8(){if(!sp&&(sp=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!sp))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return sp(Q8)}var Y8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const D1={randomUUID:Y8};function A1(e,t,n){if(D1.randomUUID&&!t&&!e)return D1.randomUUID();e=e||{};var r=e.random||(e.rng||Z8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,J8(r)}var ht;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(ht||(ht={}));var Lb;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Lb||(Lb={}));const we=ht.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sa=e=>{switch(typeof e){case"undefined":return we.undefined;case"string":return we.string;case"number":return isNaN(e)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(e)?we.array:e===null?we.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?we.promise:typeof Map<"u"&&e instanceof Map?we.map:typeof Set<"u"&&e instanceof Set?we.set:typeof Date<"u"&&e instanceof Date?we.date:we.object;default:return we.unknown}},ie=ht.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),X8=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class jr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,u=0;for(;un.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}jr.create=e=>new jr(e);const jc=(e,t)=>{let n;switch(e.code){case ie.invalid_type:e.received===we.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ht.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${ht.joinValues(e.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ht.joinValues(e.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${ht.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ht.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ie.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ie.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=t.defaultError,ht.assertNever(e)}return{message:n}};let OP=jc;function eH(e){OP=e}function qh(){return OP}const Kh=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let c="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)c=l(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}},tH=[];function be(e,t){const n=qh(),r=Kh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===jc?void 0:jc].filter(s=>!!s)});e.common.issues.push(r)}class Un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return Ve;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return Un.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ve;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Ve=Object.freeze({status:"aborted"}),Bl=e=>({status:"dirty",value:e}),Zn=e=>({status:"valid",value:e}),$b=e=>e.status==="aborted",Bb=e=>e.status==="dirty",Od=e=>e.status==="valid",Id=e=>typeof Promise<"u"&&e instanceof Promise;function Wh(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function IP(e,t,n,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Me||(Me={}));var Ou,Iu;class Qs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const F1=(e,t)=>{if(Od(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new jr(e.common.issues);return this._error=n,this._error}}};function Je(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var u,l;const{message:d}=e;return a.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:(u=d??r)!==null&&u!==void 0?u:c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:(l=d??n)!==null&&l!==void 0?l:c.defaultError}},description:s}}class tt{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return sa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Un,ctx:{common:t.parent.common,data:t.data,parsedType:sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Id(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)},o=this._parseSync({data:t,path:s.path,parent:s});return F1(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(Id(s)?s:Promise.resolve(s));return F1(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:ie.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ws({schema:this,typeName:ze.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ws.create(this,this._def)}nullable(){return Aa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ms.create(this,this._def)}promise(){return Nc.create(this,this._def)}or(t){return Ld.create([this,t],this._def)}and(t){return $d.create(this,t,this._def)}transform(t){return new ws({...Je(this._def),schema:this,typeName:ze.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Hd({...Je(this._def),innerType:this,defaultValue:n,typeName:ze.ZodDefault})}brand(){return new h0({typeName:ze.ZodBranded,type:this,...Je(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new qd({...Je(this._def),innerType:this,catchValue:n,typeName:ze.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return bf.create(this,t)}readonly(){return Kd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nH=/^c[^\s-]{8,}$/i,rH=/^[0-9a-z]+$/,sH=/^[0-9A-HJKMNP-TV-Z]{26}$/,oH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,aH=/^[a-z0-9_-]{21}$/i,iH=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Pv;const uH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dH=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pH=new RegExp(`^${DP}$`);function AP(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function hH(e){return new RegExp(`^${AP(e)}$`)}function FP(e){let t=`${DP}T${AP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function gH(e,t){return!!((t==="v4"||!t)&&uH.test(e)||(t==="v6"||!t)&&dH.test(e))}class ds extends tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==we.string){const o=this._getOrReturnCtx(t);return be(o,{code:ie.invalid_type,expected:we.string,received:o.parsedType}),Ve}const r=new Un;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),be(s,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,c=t.data.lengtht.test(s),{validation:n,code:ie.invalid_string,...Me.errToObj(r)})}_addCheck(t){return new ds({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Me.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Me.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Me.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Me.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Me.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Me.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Me.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Me.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Me.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Me.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Me.errToObj(n)})}nonempty(t){return this.min(1,Me.errToObj(t))}trim(){return new ds({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ds({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ds({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new ds({checks:[],typeName:ze.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Je(e)})};function mH(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),a=parseInt(t.toFixed(s).replace(".",""));return o%a/Math.pow(10,s)}class Oa extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==we.number){const o=this._getOrReturnCtx(t);return be(o,{code:ie.invalid_type,expected:we.number,received:o.parsedType}),Ve}let r;const s=new Un;for(const o of this._def.checks)o.kind==="int"?ht.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),be(r,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),be(r,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?mH(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),be(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),be(r,{code:ie.not_finite,message:o.message}),s.dirty()):ht.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Me.toString(n))}setLimit(t,n,r,s){return new Oa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(t){return new Oa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&ht.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Oa({checks:[],typeName:ze.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Je(e)});class Ia extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==we.bigint){const o=this._getOrReturnCtx(t);return be(o,{code:ie.invalid_type,expected:we.bigint,received:o.parsedType}),Ve}let r;const s=new Un;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),be(r,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),be(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):ht.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Me.toString(n))}setLimit(t,n,r,s){return new Ia({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(t){return new Ia({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ia({checks:[],typeName:ze.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Je(e)})};class Dd extends tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==we.boolean){const r=this._getOrReturnCtx(t);return be(r,{code:ie.invalid_type,expected:we.boolean,received:r.parsedType}),Ve}return Zn(t.data)}}Dd.create=e=>new Dd({typeName:ze.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Je(e)});class qi extends tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==we.date){const o=this._getOrReturnCtx(t);return be(o,{code:ie.invalid_type,expected:we.date,received:o.parsedType}),Ve}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return be(o,{code:ie.invalid_date}),Ve}const r=new Un;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),be(s,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):ht.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new qi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Me.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Me.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew qi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ze.ZodDate,...Je(e)});class Gh extends tt{_parse(t){if(this._getType(t)!==we.symbol){const r=this._getOrReturnCtx(t);return be(r,{code:ie.invalid_type,expected:we.symbol,received:r.parsedType}),Ve}return Zn(t.data)}}Gh.create=e=>new Gh({typeName:ze.ZodSymbol,...Je(e)});class Ad extends tt{_parse(t){if(this._getType(t)!==we.undefined){const r=this._getOrReturnCtx(t);return be(r,{code:ie.invalid_type,expected:we.undefined,received:r.parsedType}),Ve}return Zn(t.data)}}Ad.create=e=>new Ad({typeName:ze.ZodUndefined,...Je(e)});class Fd extends tt{_parse(t){if(this._getType(t)!==we.null){const r=this._getOrReturnCtx(t);return be(r,{code:ie.invalid_type,expected:we.null,received:r.parsedType}),Ve}return Zn(t.data)}}Fd.create=e=>new Fd({typeName:ze.ZodNull,...Je(e)});class Tc extends tt{constructor(){super(...arguments),this._any=!0}_parse(t){return Zn(t.data)}}Tc.create=e=>new Tc({typeName:ze.ZodAny,...Je(e)});class _i extends tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Zn(t.data)}}_i.create=e=>new _i({typeName:ze.ZodUnknown,...Je(e)});class Ro extends tt{_parse(t){const n=this._getOrReturnCtx(t);return be(n,{code:ie.invalid_type,expected:we.never,received:n.parsedType}),Ve}}Ro.create=e=>new Ro({typeName:ze.ZodNever,...Je(e)});class Jh extends tt{_parse(t){if(this._getType(t)!==we.undefined){const r=this._getOrReturnCtx(t);return be(r,{code:ie.invalid_type,expected:we.void,received:r.parsedType}),Ve}return Zn(t.data)}}Jh.create=e=>new Jh({typeName:ze.ZodVoid,...Je(e)});class ms extends tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==we.array)return be(n,{code:ie.invalid_type,expected:we.array,received:n.parsedType}),Ve;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,c=n.data.lengths.maxLength.value&&(be(n,{code:ie.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>s.type._parseAsync(new Qs(n,a,n.path,c)))).then(a=>Un.mergeArray(r,a));const o=[...n.data].map((a,c)=>s.type._parseSync(new Qs(n,a,n.path,c)));return Un.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ms({...this._def,minLength:{value:t,message:Me.toString(n)}})}max(t,n){return new ms({...this._def,maxLength:{value:t,message:Me.toString(n)}})}length(t,n){return new ms({...this._def,exactLength:{value:t,message:Me.toString(n)}})}nonempty(t){return this.min(1,t)}}ms.create=(e,t)=>new ms({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray,...Je(t)});function kl(e){if(e instanceof qt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ws.create(kl(r))}return new qt({...e._def,shape:()=>t})}else return e instanceof ms?new ms({...e._def,type:kl(e.element)}):e instanceof Ws?Ws.create(kl(e.unwrap())):e instanceof Aa?Aa.create(kl(e.unwrap())):e instanceof Zs?Zs.create(e.items.map(t=>kl(t))):e}class qt extends tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ht.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==we.object){const l=this._getOrReturnCtx(t);return be(l,{code:ie.invalid_type,expected:we.object,received:l.parsedType}),Ve}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ro&&this._def.unknownKeys==="strip"))for(const l in s.data)a.includes(l)||c.push(l);const u=[];for(const l of a){const d=o[l],p=s.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new Qs(s,p,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof Ro){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of c)u.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(l==="strict")c.length>0&&(be(s,{code:ie.unrecognized_keys,keys:c}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of c){const p=s.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new Qs(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of u){const p=await d.key,f=await d.value;l.push({key:p,value:f,alwaysSet:d.alwaysSet})}return l}).then(l=>Un.mergeObjectSync(r,l)):Un.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new qt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,a,c;const u=(a=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Me.errToObj(t).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new qt({...this._def,unknownKeys:"strip"})}passthrough(){return new qt({...this._def,unknownKeys:"passthrough"})}extend(t){return new qt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new qt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ze.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new qt({...this._def,catchall:t})}pick(t){const n={};return ht.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new qt({...this._def,shape:()=>n})}omit(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new qt({...this._def,shape:()=>n})}deepPartial(){return kl(this)}partial(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new qt({...this._def,shape:()=>n})}required(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ws;)o=o._def.innerType;n[r]=o}}),new qt({...this._def,shape:()=>n})}keyof(){return LP(ht.objectKeys(this.shape))}}qt.create=(e,t)=>new qt({shape:()=>e,unknownKeys:"strip",catchall:Ro.create(),typeName:ze.ZodObject,...Je(t)});qt.strictCreate=(e,t)=>new qt({shape:()=>e,unknownKeys:"strict",catchall:Ro.create(),typeName:ze.ZodObject,...Je(t)});qt.lazycreate=(e,t)=>new qt({shape:e,unknownKeys:"strip",catchall:Ro.create(),typeName:ze.ZodObject,...Je(t)});class Ld extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const a=o.map(c=>new jr(c.ctx.common.issues));return be(n,{code:ie.invalid_union,unionErrors:a}),Ve}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},d=u._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const c=a.map(u=>new jr(u));return be(n,{code:ie.invalid_union,unionErrors:c}),Ve}}get options(){return this._def.options}}Ld.create=(e,t)=>new Ld({options:e,typeName:ze.ZodUnion,...Je(t)});const lo=e=>e instanceof zd?lo(e.schema):e instanceof ws?lo(e.innerType()):e instanceof Ud?[e.value]:e instanceof Da?e.options:e instanceof Vd?ht.objectValues(e.enum):e instanceof Hd?lo(e._def.innerType):e instanceof Ad?[void 0]:e instanceof Fd?[null]:e instanceof Ws?[void 0,...lo(e.unwrap())]:e instanceof Aa?[null,...lo(e.unwrap())]:e instanceof h0||e instanceof Kd?lo(e.unwrap()):e instanceof qd?lo(e._def.innerType):[];class rm extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==we.object)return be(n,{code:ie.invalid_type,expected:we.object,received:n.parsedType}),Ve;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(be(n,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const a=lo(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new rm({typeName:ze.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Je(r)})}}function zb(e,t){const n=sa(e),r=sa(t);if(e===t)return{valid:!0,data:e};if(n===we.object&&r===we.object){const s=ht.objectKeys(t),o=ht.objectKeys(e).filter(c=>s.indexOf(c)!==-1),a={...e,...t};for(const c of o){const u=zb(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===we.array&&r===we.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if($b(o)||$b(a))return Ve;const c=zb(o.value,a.value);return c.valid?((Bb(o)||Bb(a))&&n.dirty(),{status:n.value,value:c.data}):(be(r,{code:ie.invalid_intersection_types}),Ve)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}$d.create=(e,t,n)=>new $d({left:e,right:t,typeName:ze.ZodIntersection,...Je(n)});class Zs extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.array)return be(r,{code:ie.invalid_type,expected:we.array,received:r.parsedType}),Ve;if(r.data.lengththis._def.items.length&&(be(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Qs(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Un.mergeArray(n,a)):Un.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Zs({...this._def,rest:t})}}Zs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zs({items:e,typeName:ze.ZodTuple,rest:null,...Je(t)})};class Bd extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.object)return be(r,{code:ie.invalid_type,expected:we.object,received:r.parsedType}),Ve;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in r.data)s.push({key:o._parse(new Qs(r,c,r.path,c)),value:a._parse(new Qs(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?Un.mergeObjectAsync(n,s):Un.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof tt?new Bd({keyType:t,valueType:n,typeName:ze.ZodRecord,...Je(r)}):new Bd({keyType:ds.create(),valueType:t,typeName:ze.ZodRecord,...Je(n)})}}class Qh extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.map)return be(r,{code:ie.invalid_type,expected:we.map,received:r.parsedType}),Ve;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([c,u],l)=>({key:s._parse(new Qs(r,c,r.path,[l,"key"])),value:o._parse(new Qs(r,u,r.path,[l,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of a){const l=await u.key,d=await u.value;if(l.status==="aborted"||d.status==="aborted")return Ve;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(l.value,d.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of a){const l=u.key,d=u.value;if(l.status==="aborted"||d.status==="aborted")return Ve;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(l.value,d.value)}return{status:n.value,value:c}}}}Qh.create=(e,t,n)=>new Qh({valueType:t,keyType:e,typeName:ze.ZodMap,...Je(n)});class Ki extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.set)return be(r,{code:ie.invalid_type,expected:we.set,received:r.parsedType}),Ve;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(be(r,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const l=new Set;for(const d of u){if(d.status==="aborted")return Ve;d.status==="dirty"&&n.dirty(),l.add(d.value)}return{status:n.value,value:l}}const c=[...r.data.values()].map((u,l)=>o._parse(new Qs(r,u,r.path,l)));return r.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new Ki({...this._def,minSize:{value:t,message:Me.toString(n)}})}max(t,n){return new Ki({...this._def,maxSize:{value:t,message:Me.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ki.create=(e,t)=>new Ki({valueType:e,minSize:null,maxSize:null,typeName:ze.ZodSet,...Je(t)});class Zl extends tt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==we.function)return be(n,{code:ie.invalid_type,expected:we.function,received:n.parsedType}),Ve;function r(c,u){return Kh({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qh(),jc].filter(l=>!!l),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function s(c,u){return Kh({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qh(),jc].filter(l=>!!l),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Nc){const c=this;return Zn(async function(...u){const l=new jr([]),d=await c._def.args.parseAsync(u,o).catch(h=>{throw l.addIssue(r(u,h)),l}),p=await Reflect.apply(a,this,d);return await c._def.returns._def.type.parseAsync(p,o).catch(h=>{throw l.addIssue(s(p,h)),l})})}else{const c=this;return Zn(function(...u){const l=c._def.args.safeParse(u,o);if(!l.success)throw new jr([r(u,l.error)]);const d=Reflect.apply(a,this,l.data),p=c._def.returns.safeParse(d,o);if(!p.success)throw new jr([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Zl({...this._def,args:Zs.create(t).rest(_i.create())})}returns(t){return new Zl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Zl({args:t||Zs.create([]).rest(_i.create()),returns:n||_i.create(),typeName:ze.ZodFunction,...Je(r)})}}class zd extends tt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zd.create=(e,t)=>new zd({getter:e,typeName:ze.ZodLazy,...Je(t)});class Ud extends tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return be(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),Ve}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ud.create=(e,t)=>new Ud({value:e,typeName:ze.ZodLiteral,...Je(t)});function LP(e,t){return new Da({values:e,typeName:ze.ZodEnum,...Je(t)})}class Da extends tt{constructor(){super(...arguments),Ou.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return be(n,{expected:ht.joinValues(r),received:n.parsedType,code:ie.invalid_type}),Ve}if(Wh(this,Ou)||IP(this,Ou,new Set(this._def.values)),!Wh(this,Ou).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return be(n,{received:n.data,code:ie.invalid_enum_value,options:r}),Ve}return Zn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Da.create(t,{...this._def,...n})}exclude(t,n=this._def){return Da.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ou=new WeakMap;Da.create=LP;class Vd extends tt{constructor(){super(...arguments),Iu.set(this,void 0)}_parse(t){const n=ht.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==we.string&&r.parsedType!==we.number){const s=ht.objectValues(n);return be(r,{expected:ht.joinValues(s),received:r.parsedType,code:ie.invalid_type}),Ve}if(Wh(this,Iu)||IP(this,Iu,new Set(ht.getValidEnumValues(this._def.values))),!Wh(this,Iu).has(t.data)){const s=ht.objectValues(n);return be(r,{received:r.data,code:ie.invalid_enum_value,options:s}),Ve}return Zn(t.data)}get enum(){return this._def.values}}Iu=new WeakMap;Vd.create=(e,t)=>new Vd({values:e,typeName:ze.ZodNativeEnum,...Je(t)});class Nc extends tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==we.promise&&n.common.async===!1)return be(n,{code:ie.invalid_type,expected:we.promise,received:n.parsedType}),Ve;const r=n.parsedType===we.promise?n.data:Promise.resolve(n.data);return Zn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Nc.create=(e,t)=>new Nc({type:e,typeName:ze.ZodPromise,...Je(t)});class ws extends tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{be(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ve;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?Ve:u.status==="dirty"||n.value==="dirty"?Bl(u.value):u});{if(n.value==="aborted")return Ve;const c=this._def.schema._parseSync({data:a,path:r.path,parent:r});return c.status==="aborted"?Ve:c.status==="dirty"||n.value==="dirty"?Bl(c.value):c}}if(s.type==="refinement"){const a=c=>{const u=s.refinement(c,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Ve:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?Ve:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Od(a))return a;const c=s.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Od(a)?Promise.resolve(s.transform(a.value,o)).then(c=>({status:n.value,value:c})):a);ht.assertNever(s)}}ws.create=(e,t,n)=>new ws({schema:e,typeName:ze.ZodEffects,effect:t,...Je(n)});ws.createWithPreprocess=(e,t,n)=>new ws({schema:t,effect:{type:"preprocess",transform:e},typeName:ze.ZodEffects,...Je(n)});class Ws extends tt{_parse(t){return this._getType(t)===we.undefined?Zn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ws.create=(e,t)=>new Ws({innerType:e,typeName:ze.ZodOptional,...Je(t)});class Aa extends tt{_parse(t){return this._getType(t)===we.null?Zn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Aa.create=(e,t)=>new Aa({innerType:e,typeName:ze.ZodNullable,...Je(t)});class Hd extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===we.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Hd.create=(e,t)=>new Hd({innerType:e,typeName:ze.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Je(t)});class qd extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Id(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new jr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new jr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qd.create=(e,t)=>new qd({innerType:e,typeName:ze.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Je(t)});class Zh extends tt{_parse(t){if(this._getType(t)!==we.nan){const r=this._getOrReturnCtx(t);return be(r,{code:ie.invalid_type,expected:we.nan,received:r.parsedType}),Ve}return{status:"valid",value:t.data}}}Zh.create=e=>new Zh({typeName:ze.ZodNaN,...Je(e)});const vH=Symbol("zod_brand");class h0 extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class bf extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ve:o.status==="dirty"?(n.dirty(),Bl(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ve:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new bf({in:t,out:n,typeName:ze.ZodPipeline})}}class Kd extends tt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Od(s)&&(s.value=Object.freeze(s.value)),s);return Id(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Kd.create=(e,t)=>new Kd({innerType:e,typeName:ze.ZodReadonly,...Je(t)});function $P(e,t={},n){return e?Tc.create().superRefine((r,s)=>{var o,a;if(!e(r)){const c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=c.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,l=typeof c=="string"?{message:c}:c;s.addIssue({code:"custom",...l,fatal:u})}}):Tc.create()}const yH={object:qt.lazycreate};var ze;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ze||(ze={}));const bH=(e,t={message:`Input not instance of ${e.name}`})=>$P(n=>n instanceof e,t),BP=ds.create,zP=Oa.create,xH=Zh.create,wH=Ia.create,UP=Dd.create,SH=qi.create,CH=Gh.create,kH=Ad.create,EH=Fd.create,jH=Tc.create,TH=_i.create,NH=Ro.create,_H=Jh.create,MH=ms.create,RH=qt.create,PH=qt.strictCreate,OH=Ld.create,IH=rm.create,DH=$d.create,AH=Zs.create,FH=Bd.create,LH=Qh.create,$H=Ki.create,BH=Zl.create,zH=zd.create,UH=Ud.create,VH=Da.create,HH=Vd.create,qH=Nc.create,L1=ws.create,KH=Ws.create,WH=Aa.create,GH=ws.createWithPreprocess,JH=bf.create,QH=()=>BP().optional(),ZH=()=>zP().optional(),YH=()=>UP().optional(),XH={string:e=>ds.create({...e,coerce:!0}),number:e=>Oa.create({...e,coerce:!0}),boolean:e=>Dd.create({...e,coerce:!0}),bigint:e=>Ia.create({...e,coerce:!0}),date:e=>qi.create({...e,coerce:!0})},e7=Ve;var j=Object.freeze({__proto__:null,defaultErrorMap:jc,setErrorMap:eH,getErrorMap:qh,makeIssue:Kh,EMPTY_PATH:tH,addIssueToContext:be,ParseStatus:Un,INVALID:Ve,DIRTY:Bl,OK:Zn,isAborted:$b,isDirty:Bb,isValid:Od,isAsync:Id,get util(){return ht},get objectUtil(){return Lb},ZodParsedType:we,getParsedType:sa,ZodType:tt,datetimeRegex:FP,ZodString:ds,ZodNumber:Oa,ZodBigInt:Ia,ZodBoolean:Dd,ZodDate:qi,ZodSymbol:Gh,ZodUndefined:Ad,ZodNull:Fd,ZodAny:Tc,ZodUnknown:_i,ZodNever:Ro,ZodVoid:Jh,ZodArray:ms,ZodObject:qt,ZodUnion:Ld,ZodDiscriminatedUnion:rm,ZodIntersection:$d,ZodTuple:Zs,ZodRecord:Bd,ZodMap:Qh,ZodSet:Ki,ZodFunction:Zl,ZodLazy:zd,ZodLiteral:Ud,ZodEnum:Da,ZodNativeEnum:Vd,ZodPromise:Nc,ZodEffects:ws,ZodTransformer:ws,ZodOptional:Ws,ZodNullable:Aa,ZodDefault:Hd,ZodCatch:qd,ZodNaN:Zh,BRAND:vH,ZodBranded:h0,ZodPipeline:bf,ZodReadonly:Kd,custom:$P,Schema:tt,ZodSchema:tt,late:yH,get ZodFirstPartyTypeKind(){return ze},coerce:XH,any:jH,array:MH,bigint:wH,boolean:UP,date:SH,discriminatedUnion:IH,effect:L1,enum:VH,function:BH,instanceof:bH,intersection:DH,lazy:zH,literal:UH,map:LH,nan:xH,nativeEnum:HH,never:NH,null:EH,nullable:WH,number:zP,object:RH,oboolean:YH,onumber:ZH,optional:KH,ostring:QH,pipeline:JH,preprocess:GH,promise:qH,record:FH,set:$H,strictObject:PH,string:BP,symbol:CH,transformer:L1,tuple:AH,undefined:kH,union:OH,unknown:TH,void:_H,NEVER:e7,ZodIssueCode:ie,quotelessJson:X8,ZodError:jr}),VP=v.createContext({dragDropManager:void 0}),Ur;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ur||(Ur={}));function Ke(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s-1})}var o7={type:g0,payload:{clientOffset:null,sourceClientOffset:null}};function a7(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=r.publishSource,o=s===void 0?!0:s,a=r.clientOffset,c=r.getSourceClientOffset,u=e.getMonitor(),l=e.getRegistry();e.dispatch($1(a)),i7(n,u,l);var d=u7(n,u);if(d===null){e.dispatch(o7);return}var p=null;if(a){if(!c)throw new Error("getSourceClientOffset must be defined");l7(c),p=c(d)}e.dispatch($1(a,p));var f=l.getSource(d),h=f.beginDrag(u,d);if(h!=null){c7(h),l.pinSource(d);var g=l.getSourceType(d);return{type:sm,payload:{itemType:g,item:h,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function i7(e,t,n){Ke(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){Ke(n.getSource(r),"Expected sourceIds to be registered.")})}function l7(e){Ke(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function c7(e){Ke(HP(e),"Item must be an object.")}function u7(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function d7(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:m0}}}function Ub(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function f7(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.clientOffset;p7(n);var o=n.slice(0),a=e.getMonitor(),c=e.getRegistry();h7(o,a,c);var u=a.getItemType();return g7(o,c,u),m7(o,a,c),{type:om,payload:{targetIds:o,clientOffset:s||null}}}}function p7(e){Ke(Array.isArray(e),"Expected targetIds to be an array.")}function h7(e,t,n){Ke(t.isDragging(),"Cannot call hover while not dragging."),Ke(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var s=e[r],o=t.getTargetType(s);Ub(o,n)||e.splice(r,1)}}function m7(e,t,n){e.forEach(function(r){var s=n.getTarget(r);s.hover(t,r)})}function B1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function z1(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),s=e.getRegistry();b7(r);var o=S7(r);o.forEach(function(a,c){var u=x7(a,c,s,r),l={type:am,payload:{dropResult:z1(z1({},n),u)}};e.dispatch(l)})}}function b7(e){Ke(e.isDragging(),"Cannot call drop while not dragging."),Ke(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function x7(e,t,n,r){var s=n.getTarget(e),o=s?s.drop(r,e):void 0;return w7(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function w7(e){Ke(typeof e>"u"||HP(e),"Drop result must either be an object or undefined.")}function S7(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function C7(e){return function(){var n=e.getMonitor(),r=e.getRegistry();k7(n);var s=n.getSourceId();if(s!=null){var o=r.getSource(s,!0);o.endDrag(n,s),r.unpinSource()}return{type:im}}}function k7(e){Ke(e.isDragging(),"Cannot call endDrag while not dragging.")}function E7(e){return{beginDrag:a7(e),publishDragSource:d7(e),hover:f7(e),drop:y7(e),endDrag:C7(e)}}function j7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T7(e,t){for(var n=0;n0;r.backend&&(s&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!s&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return N7(e,[{key:"receiveBackend",value:function(n){this.backend=n}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var n=this,r=this.store.dispatch;function s(a){return function(){for(var c=arguments.length,u=new Array(c),l=0;l"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ir(1));return n(qP)(e,t)}if(typeof e!="function")throw new Error(Ir(2));var s=e,o=t,a=[],c=a,u=!1;function l(){c===a&&(c=a.slice())}function d(){if(u)throw new Error(Ir(3));return o}function p(m){if(typeof m!="function")throw new Error(Ir(4));if(u)throw new Error(Ir(5));var x=!0;return l(),c.push(m),function(){if(x){if(u)throw new Error(Ir(6));x=!1,l();var y=c.indexOf(m);c.splice(y,1),a=null}}}function f(m){if(!M7(m))throw new Error(Ir(7));if(typeof m.type>"u")throw new Error(Ir(8));if(u)throw new Error(Ir(9));try{u=!0,o=s(o,m)}finally{u=!1}for(var x=a=c,b=0;b2&&arguments[2]!==void 0?arguments[2]:R7;if(e.length!==t.length)return!1;for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:K1,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case g0:case sm:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case om:return P7(e.clientOffset,n.clientOffset)?e:q1(q1({},e),{},{clientOffset:n.clientOffset});case im:case am:return K1;default:return e}}var v0="dnd-core/ADD_SOURCE",y0="dnd-core/ADD_TARGET",b0="dnd-core/REMOVE_SOURCE",lm="dnd-core/REMOVE_TARGET";function A7(e){return{type:v0,payload:{sourceId:e}}}function F7(e){return{type:y0,payload:{targetId:e}}}function L7(e){return{type:b0,payload:{sourceId:e}}}function $7(e){return{type:lm,payload:{targetId:e}}}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Dr(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:z7,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case sm:return Dr(Dr({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case m0:return Dr(Dr({},e),{},{isSourcePublic:!0});case om:return Dr(Dr({},e),{},{targetIds:n.targetIds});case lm:return e.targetIds.indexOf(n.targetId)===-1?e:Dr(Dr({},e),{},{targetIds:n7(e.targetIds,n.targetId)});case am:return Dr(Dr({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case im:return Dr(Dr({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function V7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v0:case y0:return e+1;case b0:case lm:return e-1;default:return e}}var Yh=[],x0=[];Yh.__IS_NONE__=!0;x0.__IS_ALL__=!0;function H7(e,t){if(e===Yh)return!1;if(e===x0||typeof t>"u")return!0;var n=s7(t,e);return n.length>0}function q7(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case om:break;case v0:case y0:case lm:case b0:return Yh;case sm:case m0:case im:case am:default:return x0}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,s=t.prevTargetIds,o=s===void 0?[]:s,a=r7(r,o),c=a.length>0||!O7(r,o);if(!c)return Yh;var u=o[o.length-1],l=r[r.length-1];return u!==l&&(u&&a.push(u),l&&a.push(l)),a}function K7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function G1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function J1(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:q7(e.dirtyHandlerIds,{type:t.type,payload:J1(J1({},t.payload),{},{prevTargetIds:t7(e,"dragOperation.targetIds",[])})}),dragOffset:D7(e.dragOffset,t),refCount:V7(e.refCount,t),dragOperation:U7(e.dragOperation,t),stateId:K7(e.stateId)}}function J7(e,t){return{x:e.x+t.x,y:e.y+t.y}}function KP(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Q7(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:KP(J7(t,r),n)}function Z7(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:KP(t,n)}function Y7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X7(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;Ke(typeof n=="function","listener must be a function."),Ke(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,c=function(){var l=r.store.getState(),d=l.stateId;try{var p=d===a||d===a+1&&!H7(l.dirtyHandlerIds,o);p||n()}finally{a=d}};return this.store.subscribe(c)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;Ke(typeof n=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var c=r.store.getState().dragOffset;c!==s&&(s=c,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return Ke(r,"Expected to find a valid source. sourceId=".concat(n)),this.isDragging()?!1:r.canDrag(this,n)}},{key:"canDropOnTarget",value:function(n){if(!n)return!1;var r=this.registry.getTarget(n);if(Ke(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(n),o=this.getItemType();return Ub(s,o)&&r.canDrop(this,n)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n,!0);if(Ke(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(n),o=this.getItemType();return s!==o?!1:r.isDragging(this,n)}},{key:"isOverTarget",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!n)return!1;var s=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),a=this.getItemType();if(a&&!Ub(o,a))return!1;var c=this.getTargetIds();if(!c.length)return!1;var u=c.indexOf(n);return s?u===c.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return Q7(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return Z7(this.store.getState().dragOffset)}}]),e}(),nq=0;function rq(){return nq++}function Bp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bp=function(n){return typeof n}:Bp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Bp(e)}function sq(e){Ke(typeof e.canDrag=="function","Expected canDrag to be a function."),Ke(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ke(typeof e.endDrag=="function","Expected endDrag to be a function.")}function oq(e){Ke(typeof e.canDrop=="function","Expected canDrop to be a function."),Ke(typeof e.hover=="function","Expected hover to be a function."),Ke(typeof e.drop=="function","Expected beginDrag to be a function.")}function Vb(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return Vb(n,!1)});return}Ke(typeof e=="string"||Bp(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Z1=typeof global<"u"?global:self,WP=Z1.MutationObserver||Z1.WebKitMutationObserver;function GP(e){return function(){const n=setTimeout(s,0),r=setInterval(s,50);function s(){clearTimeout(n),clearInterval(r),e()}}}function aq(e){let t=1;const n=new WP(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const iq=typeof WP=="function"?aq:GP;class lq{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let r=0,s=t.length-this.index;r{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=iq(this.flush),this.requestErrorThrow=GP(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class cq{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class uq{create(t){const n=this.freeTasks,r=n.length?n.pop():new cq(this.onError,s=>n[n.length]=s);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const JP=new lq,dq=new uq(JP.registerPendingError);function fq(e){JP.enqueueTask(dq.create(e))}function pq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hq(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:!1;Ke(this.isSourceId(n),"Expected a valid source ID.");var s=r&&n===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return Ke(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return Ke(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return Ke(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=X1(n);return r===Ur.SOURCE}},{key:"isTargetId",value:function(n){var r=X1(n);return r===Ur.TARGET}},{key:"removeSource",value:function(n){var r=this;Ke(this.getSource(n),"Expected an existing source."),this.store.dispatch(L7(n)),fq(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){Ke(this.getTarget(n),"Expected an existing target."),this.store.dispatch($7(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);Ke(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){Ke(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,s){var o=wq(n);return this.types.set(o,r),n===Ur.SOURCE?this.dragSources.set(o,s):n===Ur.TARGET&&this.dropTargets.set(o,s),o}}]),e}();function Cq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=kq(r),o=new tq(s,new Sq(s)),a=new _7(s,o),c=e(a,t,n);return a.receiveBackend(c),a}function kq(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return qP(G7,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var Eq=["children"];function jq(e,t){return Mq(e)||_q(e,t)||Nq(e,t)||Tq()}function Tq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nq(e,t){if(e){if(typeof e=="string")return tk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tk(e,t)}}function tk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pq(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o=0)&&(n[s]=e[s]);return n}var nk=0,zp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Oq=v.memo(function(t){var n=t.children,r=Rq(t,Eq),s=Iq(r),o=jq(s,2),a=o[0],c=o[1];return v.useEffect(function(){if(c){var u=QP();return++nk,function(){--nk===0&&(u[zp]=null)}}},[]),i.jsx(VP.Provider,Object.assign({value:a},{children:n}),void 0)});function Iq(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=Dq(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function Dq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:QP(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t;return s[zp]||(s[zp]={dragDropManager:Cq(e,t,n,r)}),s[zp]}function QP(){return typeof global<"u"?global:window}function Aq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fq(e,t){for(var n=0;n, or turn it into a ")+"drag source or a drop target itself.")}}function qq(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!v.isValidElement(t)){var r=t;return e(r,n),r}var s=t;Hq(s);var o=n?function(a){return e(a,n)}:e;return Kq(s,o)}}function ZP(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var s=qq(r);t[n]=function(){return s}}}),t}function ok(e,t){typeof e=="function"?e(t):e.current=t}function Kq(e,t){var n=e.ref;return Ke(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?v.cloneElement(e,{ref:function(s){ok(n,s),ok(t,s)}}):v.cloneElement(e,{ref:t})}function Up(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Up=function(n){return typeof n}:Up=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Up(e)}function Hb(e){return e!==null&&Up(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function qb(e,t,n,r){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=tW(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),iW=eO(function(){return/firefox/i.test(navigator.userAgent)}),tO=eO(function(){return!!window.safari});function lW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cW(e,t){for(var n=0;nn)d=p-1;else return s[p]}u=Math.max(0,d);var h=n-r[u],g=h*h;return s[u]+o[u]*h+a[u]*g+c[u]*h*g}}]),e}(),dW=1;function nO(e){var t=e.nodeType===dW?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,s=n.left;return{x:s,y:r}}function op(e){return{x:e.clientX,y:e.clientY}}function fW(e){var t;return e.nodeName==="IMG"&&(iW()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function pW(e,t,n,r){var s=e?t.width:n,o=e?t.height:r;return tO()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function hW(e,t,n,r,s){var o=fW(t),a=o?e:t,c=nO(a),u={x:n.x-c.x,y:n.y-c.y},l=e.offsetWidth,d=e.offsetHeight,p=r.anchorX,f=r.anchorY,h=pW(o,t,l,d),g=h.dragPreviewWidth,m=h.dragPreviewHeight,x=function(){var T=new fk([0,.5,1],[u.y,u.y/d*m,u.y+m-d]),E=T.interpolate(f);return tO()&&o&&(E+=(window.devicePixelRatio-1)*m),E},b=function(){var T=new fk([0,.5,1],[u.x,u.x/l*g,u.x+g-l]);return T.interpolate(p)},y=s.offsetX,w=s.offsetY,S=y===0||y,k=w===0||w;return{x:S?y:b(),y:k?w:x()}}var rO="__NATIVE_FILE__",sO="__NATIVE_URL__",oO="__NATIVE_TEXT__",aO="__NATIVE_HTML__";const pk=Object.freeze(Object.defineProperty({__proto__:null,FILE:rO,HTML:aO,TEXT:oO,URL:sO},Symbol.toStringTag,{value:"Module"}));function Lv(e,t,n){var r=t.reduce(function(s,o){return s||e.getData(o)},"");return r??n}var bl;function ap(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wb=(bl={},ap(bl,rO,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ap(bl,aO,{exposeProperties:{html:function(t,n){return Lv(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ap(bl,sO,{exposeProperties:{urls:function(t,n){return Lv(t,n,"").split(` +`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ap(bl,oO,{exposeProperties:{text:function(t,n){return Lv(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),bl);function gW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mW(e,t){for(var n=0;n-1})})[0]||null}function xW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wW(e,t){for(var n=0;n0&&s.actions.hover(a,{clientOffset:op(o)});var c=a.some(function(u){return s.monitor.canDropOnTarget(u)});c&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),at(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),at(this,"handleTopDragOver",function(o){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=op(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var c=(a||[]).some(function(u){return s.monitor.canDropOnTarget(u)});c?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),at(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),at(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;o.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else $v(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),at(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:op(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),at(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new CW(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new aW(this.isNodeInDocument)}return jW(e,[{key:"profile",value:function(){var n,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((n=this.dragStartSourceIds)===null||n===void 0?void 0:n.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var n=this.rootElement;if(n!==void 0){if(n.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");n.__isReactDndBackendSetUp=!0,this.addEventListeners(n)}}},{key:"teardown",value:function(){var n=this.rootElement;if(n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(n,r,s){var o=this;return this.sourcePreviewNodeOptions.set(n,s),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,s){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,s);var a=function(l){return o.handleDragStart(l,n)},c=function(l){return o.handleSelectStart(l)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",c),function(){o.sourceNodes.delete(n),o.sourceNodeOptions.delete(n),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",c),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(n,r){var s=this,o=function(l){return s.handleDragEnter(l,n)},a=function(l){return s.handleDragOver(l,n)},c=function(l){return s.handleDrop(l,n)};return r.addEventListener("dragenter",o),r.addEventListener("dragover",a),r.addEventListener("drop",c),function(){r.removeEventListener("dragenter",o),r.removeEventListener("dragover",a),r.removeEventListener("drop",c)}}},{key:"addEventListeners",value:function(n){n.addEventListener&&(n.addEventListener("dragstart",this.handleTopDragStart),n.addEventListener("dragstart",this.handleTopDragStartCapture,!0),n.addEventListener("dragend",this.handleTopDragEndCapture,!0),n.addEventListener("dragenter",this.handleTopDragEnter),n.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.addEventListener("dragover",this.handleTopDragOver),n.addEventListener("dragover",this.handleTopDragOverCapture,!0),n.addEventListener("drop",this.handleTopDrop),n.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(n){n.removeEventListener&&(n.removeEventListener("dragstart",this.handleTopDragStart),n.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),n.removeEventListener("dragend",this.handleTopDragEndCapture,!0),n.removeEventListener("dragenter",this.handleTopDragEnter),n.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.removeEventListener("dragover",this.handleTopDragOver),n.removeEventListener("dragover",this.handleTopDragOverCapture,!0),n.removeEventListener("drop",this.handleTopDrop),n.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(n);return mk({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(n);return mk({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(pk).some(function(r){return pk[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=bW(n,r),this.currentNativeHandle=this.registry.addSource(n,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(n){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=n;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var n;(n=this.window)===null||n===void 0||n.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(n,r){n.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(n,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(n,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(n,r){this.dropTargetIds.unshift(r)}}]),e}(),NW=function(t,n,r){return new TW(t,n,r)},_W=Object.create,iO=Object.defineProperty,MW=Object.getOwnPropertyDescriptor,lO=Object.getOwnPropertyNames,RW=Object.getPrototypeOf,PW=Object.prototype.hasOwnProperty,OW=(e,t)=>function(){return t||(0,e[lO(e)[0]])((t={exports:{}}).exports,t),t.exports},IW=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of lO(t))!PW.call(e,s)&&s!==n&&iO(e,s,{get:()=>t[s],enumerable:!(r=MW(t,s))||r.enumerable});return e},cO=(e,t,n)=>(n=e!=null?_W(RW(e)):{},IW(iO(n,"default",{value:e,enumerable:!0}),e)),uO=OW({"node_modules/classnames/index.js"(e,t){(function(){var n={}.hasOwnProperty;function r(){for(var s=[],o=0;o-1}var V9=U9,H9=9007199254740991,q9=/^(?:0|[1-9]\d*)$/;function K9(e,t){var n=typeof e;return t=t??H9,!!t&&(n=="number"||n!="symbol"&&q9.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=J9}var vO=Q9;function Z9(e){return e!=null&&vO(e.length)&&!gO(e)}var Y9=Z9,X9=Object.prototype;function eG(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||X9;return e===n}var tG=eG;function nG(e,t){for(var n=-1,r=Array(e);++n-1}var OJ=PJ;function IJ(e,t){var n=this.__data__,r=cm(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var DJ=IJ;function Gc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tc))return!1;var l=o.get(e),d=o.get(t);if(l&&d)return l==t&&d==e;var p=-1,f=!0,h=n&UQ?new kO:void 0;for(o.set(e,t),o.set(t,e);++p":">",'"':""","'":"'"},wZ=eQ(xZ),SZ=wZ,NO=/[&<>"']/g,CZ=RegExp(NO.source);function kZ(e){return e=CO(e),e&&CZ.test(e)?e.replace(NO,SZ):e}var EZ=kZ,_O=/[\\^$.*+?()[\]{}|]/g,jZ=RegExp(_O.source);function TZ(e){return e=CO(e),e&&jZ.test(e)?e.replace(_O,"\\$&"):e}var NZ=TZ;function _Z(e,t){return vZ(e,t)}var MZ=_Z,RZ=1/0,PZ=Xl&&1/w0(new Xl([,-0]))[1]==RZ?function(e){return new Xl(e)}:O9,OZ=PZ,IZ=200;function DZ(e,t,n){var r=-1,s=V9,o=e.length,a=!0,c=[],u=c;if(n)a=!1,s=bZ;else if(o>=IZ){var l=t?null:OZ(e);if(l)return w0(l);a=!1,s=EO,u=new kO}else u=t?[]:c;e:for(;++ri.jsx("button",{className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),BZ=$Z,zZ=(e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,s=e.offsetTop-t.scrollTop;s+r>=n?t.scrollTop+=s-n+r:s<0&&(t.scrollTop+=s)},Yb=(e,t,n,r)=>typeof r=="function"?r(e):e.length>=t&&n,UZ=e=>{const t=v.createRef(),{labelField:n,minQueryLength:r,isFocused:s,classNames:o,selectedIndex:a,query:c}=e;v.useEffect(()=>{if(!t.current)return;const p=t.current.querySelector(`.${o.activeSuggestion}`);p&&zZ(p,t.current)},[a]);const u=(p,f)=>{const h=f.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:g}=p;return{__html:g.replace(RegExp(h,"gi"),m=>`${EZ(m)}`)}},l=(p,f)=>typeof e.renderSuggestion=="function"?e.renderSuggestion(p,f):i.jsx("span",{dangerouslySetInnerHTML:u(p,f)}),d=e.suggestions.map((p,f)=>i.jsx("li",{onMouseDown:e.handleClick.bind(null,f),onTouchStart:e.handleClick.bind(null,f),onMouseOver:e.handleHover.bind(null,f),className:f===e.selectedIndex?e.classNames.activeSuggestion:"",children:l(p,e.query)},f));return d.length===0||!Yb(c,r||2,s,e.shouldRenderSuggestions)?null:i.jsx("div",{ref:t,className:o.suggestions,"data-testid":"suggestions",children:i.jsxs("ul",{children:[" ",d," "]})})},VZ=(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:s,suggestions:o}=t;return!!(e.isFocused===s&&MZ(e.suggestions,o)&&Yb(n,r,s,t.shouldRenderSuggestions)===Yb(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)&&e.selectedIndex===t.selectedIndex)},HZ=v.memo(UZ,VZ),qZ=HZ,KZ=cO(uO()),WZ=cO(uO());function GZ(e){const t=e.map(r=>{const s=r-48*Math.floor(r/48);return String.fromCharCode(96<=r?s:r)}).join(""),n=NZ(t);return new RegExp(`[${n}]+`)}function JZ(e){switch(e){case $s.ENTER:return[10,13];case $s.TAB:return 9;case $s.COMMA:return 188;case $s.SPACE:return 32;case $s.SEMICOLON:return 186;default:return 0}}function Uk(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return t!==void 0&&!n&&r}function QZ(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}var ZZ=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:s,tag:o,index:a}=e,c=l=>{if(Yl.ENTER.includes(l.keyCode)||l.keyCode===Yl.SPACE){l.preventDefault(),l.stopPropagation();return}l.keyCode===Yl.BACKSPACE&&r(l)};if(t)return i.jsx("span",{});const u=`Tag at index ${a} with value ${o.id} focussed. Press backspace to remove`;if(n){const l=n;return i.jsx(l,{"data-testid":"remove",onRemove:r,onKeyDown:c,className:s,"aria-label":u,tag:o,index:a})}return i.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:c,className:s,type:"button","aria-label":u,children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:i.jsx("path",{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"})})})},YZ=ZZ,Vk={TAG:"tag"},XZ=e=>{const t=v.useRef(null),{readOnly:n=!1,tag:r,classNames:s,index:o,moveTag:a,allowDragDrop:c=!0,labelField:u="text",tags:l}=e,[{isDragging:d},p]=LK(()=>({type:Vk.TAG,collect:x=>({isDragging:!!x.isDragging()}),item:e,canDrag:()=>Uk({moveTag:a,readOnly:n,allowDragDrop:c})}),[l]),[,f]=eW(()=>({accept:Vk.TAG,drop:x=>{var w;const b=x.index,y=o;b!==y&&((w=e==null?void 0:e.moveTag)==null||w.call(e,b,y))},canDrop:x=>QZ(x)}),[l]);p(f(t));const h=e.tag[u],{className:g=""}=r,m=d?0:1;return i.jsxs("span",{ref:t,className:(0,WZ.default)("tag-wrapper",s.tag,g),style:{opacity:m,cursor:Uk({moveTag:a,readOnly:n,allowDragDrop:c})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[h,i.jsx(YZ,{tag:e.tag,className:s.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:o})]})},eY=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:s,allowDeleteFromEmptyInput:o,allowAdditionFromPaste:a,allowDragDrop:c,minQueryLength:u,shouldRenderSuggestions:l,removeComponent:d,autocomplete:p,inline:f,maxTags:h,allowUnique:g,editable:m,placeholder:x,delimiters:b,separators:y,tags:w,inputFieldPosition:S,inputProps:k,classNames:C,maxLength:T,inputValue:E,clearAll:N}=e,[P,q]=v.useState(e.suggestions),[O,Y]=v.useState(""),[B,ee]=v.useState(!1),[K,V]=v.useState(-1),[A,D]=v.useState(!1),[X,se]=v.useState(""),[H,oe]=v.useState(-1),[Q,ne]=v.useState(""),re=v.createRef(),W=v.useRef(null),ge=v.useRef(null);v.useEffect(()=>{b.length&&console.warn("[Deprecation] The delimiters prop is deprecated and will be removed in v7.x.x, please use separators instead. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/960")},[]),v.useEffect(()=>{typeof f<"u"&&console.warn("[Deprecation] The inline attribute is deprecated and will be removed in v7.x.x, please use inputFieldPosition instead.")},[f]),v.useEffect(()=>{typeof t<"u"&&console.warn("[Deprecated] autofocus prop will be removed in 7.x so please migrate to autoFocus prop."),(t||n&&t!==!1)&&!r&&Ie()},[n,n,r]),v.useEffect(()=>{tn()},[O,e.suggestions]);const je=de=>{let qe=e.suggestions.slice();if(g){const In=w.map(js=>js.id.trim().toLowerCase());qe=qe.filter(js=>!In.includes(js.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(de,qe);const Nt=qe.filter(In=>Pe(de,In)===0),bt=qe.filter(In=>Pe(de,In)>0);return Nt.concat(bt)},Pe=(de,qe)=>qe[s].toLowerCase().indexOf(de.toLowerCase()),Ie=()=>{Y(""),W.current&&(W.current.value="",W.current.focus())},ye=(de,qe)=>{var bt;qe.preventDefault(),qe.stopPropagation();const Nt=w.slice();Nt.length!==0&&(ne(""),(bt=e==null?void 0:e.handleDelete)==null||bt.call(e,de,qe),ot(de,Nt))},ot=(de,qe)=>{var In;if(!(re!=null&&re.current))return;const Nt=re.current.querySelectorAll(".ReactTags__remove");let bt="";de===0&&qe.length>1?(bt=`Tag at index ${de} with value ${qe[de].id} deleted. Tag at index 0 with value ${qe[1].id} focussed. Press backspace to remove`,Nt[0].focus()):de>0?(bt=`Tag at index ${de} with value ${qe[de].id} deleted. Tag at index ${de-1} with value ${qe[de-1].id} focussed. Press backspace to remove`,Nt[de-1].focus()):(bt=`Tag at index ${de} with value ${qe[de].id} deleted. Input focussed. Press enter to add a new tag`,(In=W.current)==null||In.focus()),se(bt)},Ht=(de,qe,Nt)=>{var bt,In;r||(m&&(oe(de),Y(qe[s]),(bt=ge.current)==null||bt.focus()),(In=e.handleTagClick)==null||In.call(e,de,Nt))},rn=de=>{e.handleInputChange&&e.handleInputChange(de.target.value,de);const qe=de.target.value.trim();Y(qe)},tn=()=>{const de=je(O);q(de),V(K>=de.length?de.length-1:K)},dn=de=>{const qe=de.target.value;e.handleInputFocus&&e.handleInputFocus(qe,de),ee(!0)},_=de=>{const qe=de.target.value;e.handleInputBlur&&(e.handleInputBlur(qe,de),W.current&&(W.current.value="")),ee(!1),oe(-1)},F=de=>{if(de.key==="Escape"&&(de.preventDefault(),de.stopPropagation(),V(-1),D(!1),q([]),oe(-1)),(y.indexOf(de.key)!==-1||b.indexOf(de.keyCode)!==-1)&&!de.shiftKey){(de.keyCode!==Yl.TAB||O!=="")&&de.preventDefault();const qe=A&&K!==-1?P[K]:{id:O.trim(),[s]:O.trim(),className:""};Object.keys(qe)&&ue(qe)}de.key==="Backspace"&&O===""&&(o||S===xu.INLINE)&&ye(w.length-1,de),de.keyCode===Yl.UP_ARROW&&(de.preventDefault(),V(K<=0?P.length-1:K-1),D(!0)),de.keyCode===Yl.DOWN_ARROW&&(de.preventDefault(),D(!0),P.length===0?V(-1):V((K+1)%P.length))},J=()=>h&&w.length>=h,me=de=>{if(!a)return;if(J()){ne(yk.TAG_LIMIT),Ie();return}ne(""),de.preventDefault();const qe=de.clipboardData||window.clipboardData,Nt=qe.getData("text"),{maxLength:bt=Nt.length}=e,In=Math.min(bt,Nt.length),js=qe.getData("text").substr(0,In);let Ho=b;y.length&&(Ho=[],y.forEach(Ts=>{const tu=JZ(Ts);Array.isArray(tu)?Ho=[...Ho,...tu]:Ho.push(tu)}));const eu=GZ(Ho),ll=js.split(eu).map(Ts=>Ts.trim());LZ(ll).forEach(Ts=>ue({id:Ts.trim(),[s]:Ts.trim(),className:""}))},ue=de=>{var Nt;if(!de.id||!de[s])return;if(H===-1){if(J()){ne(yk.TAG_LIMIT),Ie();return}ne("")}const qe=w.map(bt=>bt.id.toLowerCase());if(!(g&&qe.indexOf(de.id.trim().toLowerCase())>=0)){if(p){const bt=je(de[s]);console.warn("[Deprecation] The autocomplete prop will be removed in 7.x to simplify the integration and make it more intutive. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/949"),(p===1&&bt.length===1||p===!0&&bt.length)&&(de=bt[0])}H!==-1&&e.onTagUpdate?e.onTagUpdate(H,de):(Nt=e==null?void 0:e.handleAddition)==null||Nt.call(e,de),Y(""),D(!1),V(-1),oe(-1),Ie()}},ce=de=>{ue(P[de])},Ne=()=>{e.onClearAll&&e.onClearAll(),ne(""),Ie()},rt=de=>{V(de),D(!0)},Pt=(de,qe)=>{var bt;const Nt=w[de];(bt=e==null?void 0:e.handleDrag)==null||bt.call(e,Nt,de,qe)},kn=(()=>{const de={...vk,...e.classNames};return w.map((qe,Nt)=>i.jsx(v.Fragment,{children:H===Nt?i.jsx("div",{className:de.editTagInput,children:i.jsx("input",{ref:bt=>{ge.current=bt},onFocus:dn,value:O,onChange:rn,onKeyDown:F,onBlur:_,className:de.editTagInputField,onPaste:me,"data-testid":"tag-edit"})}):i.jsx(XZ,{index:Nt,tag:qe,tags:w,labelField:s,onDelete:bt=>ye(Nt,bt),moveTag:c?Pt:void 0,removeComponent:d,onTagClicked:bt=>Ht(Nt,qe,bt),readOnly:r,classNames:de,allowDragDrop:c})},Nt))})(),bn={...vk,...C},{name:Vo,id:Es}=e,Xa=f===!1?xu.BOTTOM:S,Vn=r?null:i.jsxs("div",{className:bn.tagInput,children:[i.jsx("input",{...k,ref:de=>{W.current=de},className:bn.tagInputField,type:"text",placeholder:x,"aria-label":x,onFocus:dn,onBlur:_,onChange:rn,onKeyDown:F,onPaste:me,name:Vo,id:Es,maxLength:T,value:E,"data-automation":"input","data-testid":"input"}),i.jsx(qZ,{query:O.trim(),suggestions:P,labelField:s,selectedIndex:K,handleClick:ce,handleHover:rt,minQueryLength:u,shouldRenderSuggestions:l,isFocused:B,classNames:bn,renderSuggestion:e.renderSuggestion}),N&&w.length>0&&i.jsx(BZ,{classNames:bn,onClick:Ne}),Q&&i.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:i.jsx("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),Q]})]});return i.jsxs("div",{className:(0,KZ.default)(bn.tags,"react-tags-wrapper"),ref:re,children:[i.jsx("p",{role:"alert",className:"sr-only",style:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",margin:"-1px",padding:0,width:"1px",height:"1px",border:0},children:X}),Xa===xu.TOP&&Vn,i.jsxs("div",{className:bn.selected,children:[kn,Xa===xu.INLINE&&Vn]}),Xa===xu.BOTTOM&&Vn]})},tY=eY,nY=e=>{var Q;const{placeholder:t=DW,labelField:n=AW,suggestions:r=[],delimiters:s=[],separators:o=(Q=e.delimiters)!=null&&Q.length?[]:[$s.ENTER,$s.TAB],autofocus:a,autoFocus:c=!0,inline:u,inputFieldPosition:l="inline",allowDeleteFromEmptyInput:d=!1,allowAdditionFromPaste:p=!0,autocomplete:f=!1,readOnly:h=!1,allowUnique:g=!0,allowDragDrop:m=!0,tags:x=[],inputProps:b={},editable:y=!1,clearAll:w=!1,handleDelete:S,handleAddition:k,onTagUpdate:C,handleDrag:T,handleFilterSuggestions:E,handleTagClick:N,handleInputChange:P,handleInputFocus:q,handleInputBlur:O,minQueryLength:Y,shouldRenderSuggestions:B,removeComponent:ee,onClearAll:K,classNames:V,name:A,id:D,maxLength:X,inputValue:se,maxTags:H,renderSuggestion:oe}=e;return i.jsx(tY,{placeholder:t,labelField:n,suggestions:r,delimiters:s,separators:o,autofocus:a,autoFocus:c,inline:u,inputFieldPosition:l,allowDeleteFromEmptyInput:d,allowAdditionFromPaste:p,autocomplete:f,readOnly:h,allowUnique:g,allowDragDrop:m,tags:x,inputProps:b,editable:y,clearAll:w,handleDelete:S,handleAddition:k,onTagUpdate:C,handleDrag:T,handleFilterSuggestions:E,handleTagClick:N,handleInputChange:P,handleInputFocus:q,handleInputBlur:O,minQueryLength:Y,shouldRenderSuggestions:B,removeComponent:ee,onClearAll:K,classNames:V,name:A,id:D,maxLength:X,inputValue:se,maxTags:H,renderSuggestion:oe})},rY=({...e})=>i.jsx(Oq,{backend:NW,children:i.jsx(nY,{...e})});/*! Bundled license information: + +classnames/index.js: + (*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + *) + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var sY="Label",MO=v.forwardRef((e,t)=>i.jsx(Fe.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));MO.displayName=sY;var RO=MO;const oY=Fg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),PO=v.forwardRef(({className:e,...t},n)=>i.jsx(RO,{ref:n,className:ve(oY(),e),...t}));PO.displayName=RO.displayName;function OO(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var aY="VisuallyHidden",IO=v.forwardRef((e,t)=>i.jsx(Fe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));IO.displayName=aY;var iY=[" ","Enter","ArrowUp","ArrowDown"],lY=[" ","Enter"],xf="Select",[fm,pm,cY]=_w(xf),[Zc,fce]=Xr(xf,[cY,Vg]),hm=Vg(),[uY,Wa]=Zc(xf),[dY,fY]=Zc(xf),DO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:a,defaultValue:c,onValueChange:u,dir:l,name:d,autoComplete:p,disabled:f,required:h}=e,g=hm(t),[m,x]=v.useState(null),[b,y]=v.useState(null),[w,S]=v.useState(!1),k=hf(l),[C=!1,T]=_a({prop:r,defaultProp:s,onChange:o}),[E,N]=_a({prop:a,defaultProp:c,onChange:u}),P=v.useRef(null),q=m?!!m.closest("form"):!0,[O,Y]=v.useState(new Set),B=Array.from(O).map(ee=>ee.props.value).join(";");return i.jsx(rM,{...g,children:i.jsxs(uY,{required:h,scope:t,trigger:m,onTriggerChange:x,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:gs(),value:E,onValueChange:N,open:C,onOpenChange:T,dir:k,triggerPointerDownPosRef:P,disabled:f,children:[i.jsx(fm.Provider,{scope:t,children:i.jsx(dY,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(ee=>{Y(K=>new Set(K).add(ee))},[]),onNativeOptionRemove:v.useCallback(ee=>{Y(K=>{const V=new Set(K);return V.delete(ee),V})},[]),children:n})}),q?i.jsxs(aI,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:E,onChange:ee=>N(ee.target.value),disabled:f,children:[E===void 0?i.jsx("option",{value:""}):null,Array.from(O)]},B):null]})})};DO.displayName=xf;var AO="SelectTrigger",FO=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=hm(n),a=Wa(AO,n),c=a.disabled||r,u=ft(t,a.onTriggerChange),l=pm(n),[d,p,f]=iI(g=>{const m=l().filter(y=>!y.disabled),x=m.find(y=>y.value===a.value),b=lI(m,g,x);b!==void 0&&a.onValueChange(b.value)}),h=()=>{c||(a.onOpenChange(!0),f())};return i.jsx(sM,{asChild:!0,...o,children:i.jsx(Fe.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":oI(a.value)?"":void 0,...s,ref:u,onClick:ke(s.onClick,g=>{g.currentTarget.focus()}),onPointerDown:ke(s.onPointerDown,g=>{const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(h(),a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:ke(s.onKeyDown,g=>{const m=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(m&&g.key===" ")&&iY.includes(g.key)&&(h(),g.preventDefault())})})})});FO.displayName=AO;var LO="SelectValue",$O=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:a="",...c}=e,u=Wa(LO,n),{onValueNodeHasChildrenChange:l}=u,d=o!==void 0,p=ft(t,u.onValueNodeChange);return mn(()=>{l(d)},[l,d]),i.jsx(Fe.span,{...c,ref:p,style:{pointerEvents:"none"},children:oI(u.value)?i.jsx(i.Fragment,{children:a}):o})});$O.displayName=LO;var pY="SelectIcon",BO=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(Fe.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});BO.displayName=pY;var hY="SelectPortal",zO=e=>i.jsx(Hg,{asChild:!0,...e});zO.displayName=hY;var Gi="SelectContent",UO=v.forwardRef((e,t)=>{const n=Wa(Gi,e.__scopeSelect),[r,s]=v.useState();if(mn(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Ua.createPortal(i.jsx(VO,{scope:e.__scopeSelect,children:i.jsx(fm.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(HO,{...e,ref:t})});UO.displayName=Gi;var uo=10,[VO,Ga]=Zc(Gi),gY="SelectContentImpl",HO=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:x,...b}=e,y=Wa(Gi,n),[w,S]=v.useState(null),[k,C]=v.useState(null),T=ft(t,W=>S(W)),[E,N]=v.useState(null),[P,q]=v.useState(null),O=pm(n),[Y,B]=v.useState(!1),ee=v.useRef(!1);v.useEffect(()=>{if(w)return $w(w)},[w]),Mw();const K=v.useCallback(W=>{const[ge,...je]=O().map(ye=>ye.ref.current),[Pe]=je.slice(-1),Ie=document.activeElement;for(const ye of W)if(ye===Ie||(ye==null||ye.scrollIntoView({block:"nearest"}),ye===ge&&k&&(k.scrollTop=0),ye===Pe&&k&&(k.scrollTop=k.scrollHeight),ye==null||ye.focus(),document.activeElement!==Ie))return},[O,k]),V=v.useCallback(()=>K([E,w]),[K,E,w]);v.useEffect(()=>{Y&&V()},[Y,V]);const{onOpenChange:A,triggerPointerDownPosRef:D}=y;v.useEffect(()=>{if(w){let W={x:0,y:0};const ge=Pe=>{var Ie,ye;W={x:Math.abs(Math.round(Pe.pageX)-(((Ie=D.current)==null?void 0:Ie.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((ye=D.current)==null?void 0:ye.y)??0))}},je=Pe=>{W.x<=10&&W.y<=10?Pe.preventDefault():w.contains(Pe.target)||A(!1),document.removeEventListener("pointermove",ge),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",je,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",je,{capture:!0})}}},[w,A,D]),v.useEffect(()=>{const W=()=>A(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[A]);const[X,se]=iI(W=>{const ge=O().filter(Ie=>!Ie.disabled),je=ge.find(Ie=>Ie.ref.current===document.activeElement),Pe=lI(ge,W,je);Pe&&setTimeout(()=>Pe.ref.current.focus())}),H=v.useCallback((W,ge,je)=>{const Pe=!ee.current&&!je;(y.value!==void 0&&y.value===ge||Pe)&&(N(W),Pe&&(ee.current=!0))},[y.value]),oe=v.useCallback(()=>w==null?void 0:w.focus(),[w]),Q=v.useCallback((W,ge,je)=>{const Pe=!ee.current&&!je;(y.value!==void 0&&y.value===ge||Pe)&&q(W)},[y.value]),ne=r==="popper"?Xb:qO,re=ne===Xb?{side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:x}:{};return i.jsx(VO,{scope:n,content:w,viewport:k,onViewportChange:C,itemRefCallback:H,selectedItem:E,onItemLeave:oe,itemTextRefCallback:Q,focusSelectedItem:V,selectedItemText:P,position:r,isPositioned:Y,searchRef:X,children:i.jsx(Gg,{as:No,allowPinchZoom:!0,children:i.jsx(Bg,{asChild:!0,trapped:y.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:ke(s,W=>{var ge;(ge=y.trigger)==null||ge.focus({preventScroll:!0}),W.preventDefault()}),children:i.jsx($g,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(ne,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:W=>W.preventDefault(),...b,...re,onPlaced:()=>B(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ke(b.onKeyDown,W=>{const ge=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ge&&W.key.length===1&&se(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let Pe=O().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(W.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Ie=W.target,ye=Pe.indexOf(Ie);Pe=Pe.slice(ye+1)}setTimeout(()=>K(Pe)),W.preventDefault()}})})})})})})});HO.displayName=gY;var mY="SelectItemAlignedPosition",qO=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Wa(Gi,n),a=Ga(Gi,n),[c,u]=v.useState(null),[l,d]=v.useState(null),p=ft(t,T=>d(T)),f=pm(n),h=v.useRef(!1),g=v.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:b,focusSelectedItem:y}=a,w=v.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&l&&m&&x&&b){const T=o.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),P=b.getBoundingClientRect();if(o.dir!=="rtl"){const Ie=P.left-E.left,ye=N.left-Ie,ot=T.left-ye,Ht=T.width+ot,rn=Math.max(Ht,E.width),tn=window.innerWidth-uo,dn=Ab(ye,[uo,tn-rn]);c.style.minWidth=Ht+"px",c.style.left=dn+"px"}else{const Ie=E.right-P.right,ye=window.innerWidth-N.right-Ie,ot=window.innerWidth-T.right-ye,Ht=T.width+ot,rn=Math.max(Ht,E.width),tn=window.innerWidth-uo,dn=Ab(ye,[uo,tn-rn]);c.style.minWidth=Ht+"px",c.style.right=dn+"px"}const q=f(),O=window.innerHeight-uo*2,Y=m.scrollHeight,B=window.getComputedStyle(l),ee=parseInt(B.borderTopWidth,10),K=parseInt(B.paddingTop,10),V=parseInt(B.borderBottomWidth,10),A=parseInt(B.paddingBottom,10),D=ee+K+Y+A+V,X=Math.min(x.offsetHeight*5,D),se=window.getComputedStyle(m),H=parseInt(se.paddingTop,10),oe=parseInt(se.paddingBottom,10),Q=T.top+T.height/2-uo,ne=O-Q,re=x.offsetHeight/2,W=x.offsetTop+re,ge=ee+K+W,je=D-ge;if(ge<=Q){const Ie=x===q[q.length-1].ref.current;c.style.bottom="0px";const ye=l.clientHeight-m.offsetTop-m.offsetHeight,ot=Math.max(ne,re+(Ie?oe:0)+ye+V),Ht=ge+ot;c.style.height=Ht+"px"}else{const Ie=x===q[0].ref.current;c.style.top="0px";const ot=Math.max(Q,ee+m.offsetTop+(Ie?H:0)+re)+je;c.style.height=ot+"px",m.scrollTop=ge-Q+m.offsetTop}c.style.margin=`${uo}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,c,l,m,x,b,o.dir,r]);mn(()=>w(),[w]);const[S,k]=v.useState();mn(()=>{l&&k(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(T=>{T&&g.current===!0&&(w(),y==null||y(),g.current=!1)},[w,y]);return i.jsx(yY,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:i.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:i.jsx(Fe.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});qO.displayName=mY;var vY="SelectPopperPosition",Xb=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=uo,...o}=e,a=hm(n);return i.jsx(oM,{...a,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xb.displayName=vY;var[yY,S0]=Zc(Gi,{}),ex="SelectViewport",KO=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Ga(ex,n),a=S0(ex,n),c=ft(t,o.onViewportChange),u=v.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(fm.Slot,{scope:n,children:i.jsx(Fe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ke(s.onScroll,l=>{const d=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&p){const h=Math.abs(u.current-d.scrollTop);if(h>0){const g=window.innerHeight-uo*2,m=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),b=Math.max(m,x);if(b0?S:0,p.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});KO.displayName=ex;var WO="SelectGroup",[bY,xY]=Zc(WO),wY=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=gs();return i.jsx(bY,{scope:n,id:s,children:i.jsx(Fe.div,{role:"group","aria-labelledby":s,...r,ref:t})})});wY.displayName=WO;var GO="SelectLabel",JO=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=xY(GO,n);return i.jsx(Fe.div,{id:s.id,...r,ref:t})});JO.displayName=GO;var eg="SelectItem",[SY,QO]=Zc(eg),ZO=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...a}=e,c=Wa(eg,n),u=Ga(eg,n),l=c.value===r,[d,p]=v.useState(o??""),[f,h]=v.useState(!1),g=ft(t,b=>{var y;return(y=u.itemRefCallback)==null?void 0:y.call(u,b,r,s)}),m=gs(),x=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(SY,{scope:n,value:r,disabled:s,textId:m,isSelected:l,onItemTextChange:v.useCallback(b=>{p(y=>y||((b==null?void 0:b.textContent)??"").trim())},[]),children:i.jsx(fm.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:i.jsx(Fe.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:g,onFocus:ke(a.onFocus,()=>h(!0)),onBlur:ke(a.onBlur,()=>h(!1)),onPointerUp:ke(a.onPointerUp,x),onPointerMove:ke(a.onPointerMove,b=>{var y;s?(y=u.onItemLeave)==null||y.call(u):b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(a.onPointerLeave,b=>{var y;b.currentTarget===document.activeElement&&((y=u.onItemLeave)==null||y.call(u))}),onKeyDown:ke(a.onKeyDown,b=>{var w;((w=u.searchRef)==null?void 0:w.current)!==""&&b.key===" "||(lY.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});ZO.displayName=eg;var Du="SelectItemText",YO=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,a=Wa(Du,n),c=Ga(Du,n),u=QO(Du,n),l=fY(Du,n),[d,p]=v.useState(null),f=ft(t,b=>p(b),u.onItemTextChange,b=>{var y;return(y=c.itemTextRefCallback)==null?void 0:y.call(c,b,u.value,u.disabled)}),h=d==null?void 0:d.textContent,g=v.useMemo(()=>i.jsx("option",{value:u.value,disabled:u.disabled,children:h},u.value),[u.disabled,u.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=l;return mn(()=>(m(g),()=>x(g)),[m,x,g]),i.jsxs(i.Fragment,{children:[i.jsx(Fe.span,{id:u.textId,...o,ref:f}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ua.createPortal(o.children,a.valueNode):null]})});YO.displayName=Du;var XO="SelectItemIndicator",eI=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return QO(XO,n).isSelected?i.jsx(Fe.span,{"aria-hidden":!0,...r,ref:t}):null});eI.displayName=XO;var tx="SelectScrollUpButton",tI=v.forwardRef((e,t)=>{const n=Ga(tx,e.__scopeSelect),r=S0(tx,e.__scopeSelect),[s,o]=v.useState(!1),a=ft(t,r.onScrollButtonChange);return mn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const l=u.scrollTop>0;o(l)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?i.jsx(rI,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});tI.displayName=tx;var nx="SelectScrollDownButton",nI=v.forwardRef((e,t)=>{const n=Ga(nx,e.__scopeSelect),r=S0(nx,e.__scopeSelect),[s,o]=v.useState(!1),a=ft(t,r.onScrollButtonChange);return mn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const l=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?i.jsx(rI,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});nI.displayName=nx;var rI=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Ga("SelectScrollButton",n),a=v.useRef(null),c=pm(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),mn(()=>{var d;const l=c().find(p=>p.ref.current===document.activeElement);(d=l==null?void 0:l.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),i.jsx(Fe.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ke(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ke(s.onPointerMove,()=>{var l;(l=o.onItemLeave)==null||l.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ke(s.onPointerLeave,()=>{u()})})}),CY="SelectSeparator",sI=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(Fe.div,{"aria-hidden":!0,...r,ref:t})});sI.displayName=CY;var rx="SelectArrow",kY=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=hm(n),o=Wa(rx,n),a=Ga(rx,n);return o.open&&a.position==="popper"?i.jsx(aM,{...s,...r,ref:t}):null});kY.displayName=rx;function oI(e){return e===""||e===void 0}var aI=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=v.useRef(null),o=ft(t,s),a=OO(n);return v.useEffect(()=>{const c=s.current,u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&d){const p=new Event("change",{bubbles:!0});d.call(c,n),c.dispatchEvent(p)}},[a,n]),i.jsx(IO,{asChild:!0,children:i.jsx("select",{...r,ref:o,defaultValue:n})})});aI.displayName="BubbleSelect";function iI(e){const t=ln(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(a=>{const c=n.current+a;t(c),function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(c)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function lI(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=EY(e,Math.max(o,0));s.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function EY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jY=DO,cI=FO,TY=$O,NY=BO,_Y=zO,uI=UO,MY=KO,dI=JO,fI=ZO,RY=YO,PY=eI,pI=tI,hI=nI,gI=sI;const OY=jY,IY=TY,mI=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(cI,{ref:r,className:ve("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-default disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(NY,{asChild:!0,children:i.jsx(Lg,{className:"h-4 w-4 opacity-50"})})]}));mI.displayName=cI.displayName;const vI=v.forwardRef(({className:e,...t},n)=>i.jsx(pI,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(bz,{className:"h-4 w-4"})}));vI.displayName=pI.displayName;const yI=v.forwardRef(({className:e,...t},n)=>i.jsx(hI,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Lg,{className:"h-4 w-4"})}));yI.displayName=hI.displayName;const bI=v.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(_Y,{children:i.jsxs(uI,{ref:s,className:ve("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(vI,{}),i.jsx(MY,{className:ve("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(yI,{})]})}));bI.displayName=uI.displayName;const DY=v.forwardRef(({className:e,...t},n)=>i.jsx(dI,{ref:n,className:ve("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));DY.displayName=dI.displayName;const xI=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(fI,{ref:r,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(PY,{children:i.jsx(T_,{className:"h-4 w-4"})})}),i.jsx(RY,{children:t})]}));xI.displayName=fI.displayName;const AY=v.forwardRef(({className:e,...t},n)=>i.jsx(gI,{ref:n,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));AY.displayName=gI.displayName;var C0="Switch",[FY,pce]=Xr(C0),[LY,$Y]=FY(C0),wI=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:c,value:u="on",onCheckedChange:l,...d}=e,[p,f]=v.useState(null),h=ft(t,y=>f(y)),g=v.useRef(!1),m=p?!!p.closest("form"):!0,[x=!1,b]=_a({prop:s,defaultProp:o,onChange:l});return i.jsxs(LY,{scope:n,checked:x,disabled:c,children:[i.jsx(Fe.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":kI(x),"data-disabled":c?"":void 0,disabled:c,value:u,...d,ref:h,onClick:ke(e.onClick,y=>{b(w=>!w),m&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),m&&i.jsx(BY,{control:p,bubbles:!g.current,name:r,value:u,checked:x,required:a,disabled:c,style:{transform:"translateX(-100%)"}})]})});wI.displayName=C0;var SI="SwitchThumb",CI=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=$Y(SI,n);return i.jsx(Fe.span,{"data-state":kI(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});CI.displayName=SI;var BY=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=v.useRef(null),a=OO(n),c=W_(t);return v.useEffect(()=>{const u=o.current,l=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(l,"checked").set;if(a!==n&&p){const f=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(f)}},[a,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function kI(e){return e?"checked":"unchecked"}var EI=wI,zY=CI;const Yc=v.forwardRef(({className:e,...t},n)=>i.jsx(EI,{className:ve("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-slate-400",e),...t,ref:n,children:i.jsx(zY,{className:ve("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Yc.displayName=EI.displayName;const Lo=Pn,jI=v.createContext({}),$o=({...e})=>i.jsx(jI.Provider,{value:{name:e.name},children:i.jsx(D8,{...e})}),gm=()=>{const e=v.useContext(jI),t=v.useContext(TI),{getFieldState:n,formState:r}=nm(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},TI=v.createContext({}),no=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return i.jsx(TI.Provider,{value:{id:r},children:i.jsx("div",{ref:n,className:ve("space-y-2",e),...t})})});no.displayName="FormItem";const fr=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=gm();return i.jsx(PO,{ref:n,className:ve(r&&"text-rose-600",e),htmlFor:s,...t})});fr.displayName="FormLabel";const Ss=v.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=gm();return i.jsx(No,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});Ss.displayName="FormControl";const mm=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=gm();return i.jsx("p",{ref:n,id:r,className:ve("text-sm text-muted-foreground",e),...t})});mm.displayName="FormDescription";const wf=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=gm(),a=s?String(s==null?void 0:s.message):t;return a?i.jsx("p",{ref:r,id:o,className:ve("text-sm font-medium text-rose-600",e),...n,children:a}):null});wf.displayName="FormMessage";const z=({name:e,label:t,children:n,required:r,readOnly:s,className:o,...a})=>i.jsx($o,{...a,name:e,render:({field:c})=>i.jsxs(no,{className:o,children:[t&&i.jsxs(fr,{children:[t,r&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),i.jsx(Ss,{children:v.isValidElement(n)&&v.cloneElement(n,{...c,value:c.value??"",required:r,readOnly:s,checked:c.value,onCheckedChange:c.onChange})}),i.jsx(wf,{})]})}),he=({name:e,label:t,required:n,className:r,helper:s,reverse:o,...a})=>i.jsx($o,{...a,name:e,render:({field:c})=>i.jsxs(no,{className:ve("flex items-center gap-3",o&&"flex-row-reverse justify-end",r),children:[i.jsx("div",{className:"flex flex-col gap-2",children:t&&i.jsxs(fr,{children:[i.jsxs("p",{className:"break-all",children:[t,n&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s&&i.jsx(mm,{className:"mt-2",children:s})]})}),i.jsx(Ss,{children:i.jsx(Yc,{checked:c.value,onCheckedChange:c.onChange,required:n})}),i.jsx(wf,{})]})}),Tt=({name:e,label:t,helper:n,required:r,options:s,placeholder:o,disabled:a,...c})=>i.jsx($o,{...c,name:e,render:({field:u})=>i.jsxs(no,{children:[t&&i.jsxs(fr,{children:[t,r&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),i.jsx(Ss,{children:i.jsxs(OY,{onValueChange:u.onChange,defaultValue:u.value,disabled:a,children:[i.jsx(Ss,{children:i.jsx(mI,{children:i.jsx(IY,{placeholder:o})})}),i.jsx(bI,{children:s.map(l=>i.jsx(xI,{value:l.value,children:l.label},l.value))})]})}),n&&i.jsx(mm,{children:n}),i.jsx(wf,{})]})}),Ja=({name:e,label:t,helper:n,required:r,placeholder:s,...o})=>i.jsx($o,{...o,name:e,render:({field:a})=>{let c=[];return Array.isArray(a.value)&&(c=a.value),i.jsxs(no,{children:[t&&i.jsxs(fr,{children:[t,r&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),i.jsx(Ss,{children:i.jsx(rY,{tags:c.map(u=>({id:u,text:u,className:""})),handleDelete:u=>a.onChange(c.filter((l,d)=>d!==u)),handleAddition:u=>a.onChange([...c,u.id]),inputFieldPosition:"bottom",placeholder:s,autoFocus:!1,allowDragDrop:!1,separators:[$s.ENTER,$s.TAB,$s.COMMA],classNames:{tags:"tagsClass",tagInput:"tagInputClass",tagInputField:gP,selected:"my-2 flex flex-wrap gap-2",tag:"flex items-center gap-2 px-2 py-1 bg-primary/30 rounded-md text-xs",remove:"[&>svg]:fill-rose-600 hover:[&>svg]:fill-rose-700",suggestions:"suggestionsClass",activeSuggestion:"activeSuggestionClass",editTagInput:"editTagInputClass",editTagInputField:"editTagInputFieldClass",clearAll:"clearAllClass"}})}),n&&i.jsx(mm,{children:n}),i.jsx(wf,{})]})}}),qv=j.string().optional().transform(e=>e===""?void 0:e),UY=j.object({name:j.string(),token:qv,number:qv,businessId:qv,integration:j.enum(["WHATSAPP-BUSINESS","WHATSAPP-BAILEYS","EVOLUTION"])});function VY({resetTable:e}){const{t}=Ee(),{createInstance:n}=em(),[r,s]=v.useState(!1),o=[{value:"WHATSAPP-BAILEYS",label:t("instance.form.integration.baileys")},{value:"WHATSAPP-BUSINESS",label:t("instance.form.integration.whatsapp")},{value:"EVOLUTION",label:t("instance.form.integration.evolution")}],a=$t({resolver:Bt(UY),defaultValues:{name:"",integration:"WHATSAPP-BAILEYS",token:A1().replace("-","").toUpperCase(),number:"",businessId:""}}),c=a.watch("integration"),u=async d=>{var p,f,h;try{const g={instanceName:d.name,integration:d.integration,token:d.token===""?null:d.token,number:d.number===""?null:d.number,businessId:d.businessId===""?null:d.businessId};await n(g),Z.success(t("toast.instance.created")),s(!1),l(),e()}catch(g){console.error("Error:",g),Z.error(`Error : ${(h=(f=(p=g==null?void 0:g.response)==null?void 0:p.data)==null?void 0:f.response)==null?void 0:h.message}`)}},l=()=>{a.reset({name:"",integration:"WHATSAPP-BAILEYS",token:A1().replace("-","").toLocaleUpperCase(),number:"",businessId:""})};return i.jsxs(pt,{open:r,onOpenChange:s,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"default",size:"sm",children:[t("instance.button.create")," ",i.jsx(Yr,{size:"18"})]})}),i.jsxs(lt,{className:"sm:max-w-[650px]",onCloseAutoFocus:l,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("instance.modal.title")})}),i.jsx(Pn,{...a,children:i.jsxs("form",{onSubmit:a.handleSubmit(u),className:"grid gap-4 py-4",children:[i.jsx(z,{required:!0,name:"name",label:t("instance.form.name"),children:i.jsx(L,{})}),i.jsx(Tt,{name:"integration",label:t("instance.form.integration.label"),options:o}),i.jsx(z,{required:!0,name:"token",label:t("instance.form.token"),children:i.jsx(L,{})}),i.jsx(z,{name:"number",label:t("instance.form.number"),children:i.jsx(L,{type:"tel"})}),c==="WHATSAPP-BUSINESS"&&i.jsx(z,{required:!0,name:"businessId",label:t("instance.form.businessId"),children:i.jsx(L,{})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:t("instance.button.save")})})]})})]})]})}function HY(){const{t:e}=Ee(),[t,n]=v.useState(null),{deleteInstance:r,logout:s}=em(),{data:o,refetch:a}=C8(),[c,u]=v.useState([]),[l,d]=v.useState("all"),[p,f]=v.useState(""),h=async()=>{await a()},g=async b=>{var y,w,S;n(null),u([...c,b]);try{try{await s(b)}catch(k){console.error("Error logout:",k)}await r(b),await new Promise(k=>setTimeout(k,1e3)),h()}catch(k){console.error("Error instance delete:",k),Z.error(`Error : ${(S=(w=(y=k==null?void 0:k.response)==null?void 0:y.data)==null?void 0:w.response)==null?void 0:S.message}`)}finally{u(c.filter(k=>k!==b))}},m=v.useMemo(()=>{let b=o?[...o]:[];return l!=="all"&&(b=b.filter(y=>y.connectionStatus===l)),p!==""&&(b=b.filter(y=>y.name.toLowerCase().includes(p.toLowerCase()))),b},[o,p,l]),x=[{value:"all",label:e("status.all")},{value:"close",label:e("status.closed")},{value:"connecting",label:e("status.connecting")},{value:"open",label:e("status.open")}];return i.jsxs("div",{className:"my-4 px-4",children:[i.jsxs("div",{className:"flex w-full items-center justify-between",children:[i.jsx("h2",{className:"text-lg",children:e("dashboard.title")}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx($,{variant:"outline",size:"icon",children:i.jsx(Nh,{onClick:h,size:"20"})}),i.jsx(VY,{resetTable:h})]})]}),i.jsxs("div",{className:"my-4 flex items-center justify-between gap-3 px-4",children:[i.jsx("div",{className:"flex-1",children:i.jsx(L,{placeholder:e("dashboard.search"),value:p,onChange:b=>f(b.target.value)})}),i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"secondary",children:[e("dashboard.status")," ",i.jsx(xz,{size:"15"})]})}),i.jsx(tr,{children:x.map(b=>i.jsx(fR,{checked:l===b.value,onCheckedChange:y=>{y&&d(b.value)},children:b.label},b.value))})]})]}),i.jsx("main",{className:"grid gap-6 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.length>0&&Array.isArray(o)&&o.map(b=>{var y,w;return i.jsxs(fi,{children:[i.jsx(pi,{children:i.jsxs(Ed,{to:`/manager/instance/${b.id}/dashboard`,className:"flex w-full flex-row items-center justify-between gap-4",children:[i.jsx("h3",{className:"text-wrap font-semibold",children:b.name}),i.jsx($,{variant:"ghost",size:"icon",children:i.jsx(Io,{className:"card-icon",size:"20"})})]})}),i.jsxs(hi,{className:"flex-1 space-y-6",children:[i.jsx(pP,{token:b.token}),i.jsxs("div",{className:"flex w-full flex-wrap",children:[i.jsx("div",{className:"flex flex-1 gap-2",children:b.profileName&&i.jsxs(i.Fragment,{children:[i.jsx(Ui,{children:i.jsx(Vi,{src:b.profilePicUrl,alt:""})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("strong",{children:b.profileName}),i.jsx("p",{className:"text-sm text-muted-foreground",children:b.ownerJid&&b.ownerJid.split("@")[0]})]})]})}),i.jsxs("div",{className:"flex items-center justify-end gap-4 text-sm",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx(N_,{className:"text-muted-foreground",size:"20"}),i.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(((y=b==null?void 0:b._count)==null?void 0:y.Contact)||0)})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx(Cc,{className:"text-muted-foreground",size:"20"}),i.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(((w=b==null?void 0:b._count)==null?void 0:w.Message)||0)})]})]})]})]}),i.jsxs(Xg,{className:"justify-between",children:[i.jsx(fP,{status:b.connectionStatus}),i.jsx($,{variant:"destructive",size:"sm",onClick:()=>n(b.name),disabled:c.includes(b.name),children:c.includes(b.name)?i.jsx("span",{children:e("button.deleting")}):i.jsx("span",{children:e("button.delete")})})]})]},b.id)})}),!!t&&i.jsx(pt,{onOpenChange:()=>n(null),open:!0,children:i.jsxs(lt,{children:[i.jsx(VR,{}),i.jsx(ct,{children:e("modal.delete.title")}),i.jsx("p",{children:e("modal.delete.message",{instanceName:t})}),i.jsx(Rt,{children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx($,{onClick:()=>n(null),size:"sm",variant:"outline",children:e("button.cancel")}),i.jsx($,{onClick:()=>g(t),variant:"destructive",children:e("button.delete")})]})})]})})]})}const{createElement:Mc,createContext:qY,createRef:hce,forwardRef:NI,useCallback:gr,useContext:_I,useEffect:Mi,useImperativeHandle:MI,useLayoutEffect:KY,useMemo:WY,useRef:or,useState:ed}=lg,Hk=lg.useId,GY=KY,vm=qY(null);vm.displayName="PanelGroupContext";const Ri=GY,JY=typeof Hk=="function"?Hk:()=>null;let QY=0;function k0(e=null){const t=JY(),n=or(e||t||null);return n.current===null&&(n.current=""+QY++),e??n.current}function RI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:o,id:a,maxSize:c,minSize:u,onCollapse:l,onExpand:d,onResize:p,order:f,style:h,tagName:g="div",...m}){const x=_I(vm);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:y,getPanelSize:w,getPanelStyle:S,groupId:k,isPanelCollapsed:C,reevaluatePanelConstraints:T,registerPanel:E,resizePanel:N,unregisterPanel:P}=x,q=k0(a),O=or({callbacks:{onCollapse:l,onExpand:d,onResize:p},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:c,minSize:u},id:q,idIsFromProps:a!==void 0,order:f});or({didLogMissingDefaultSizeWarning:!1}),Ri(()=>{const{callbacks:B,constraints:ee}=O.current,K={...ee};O.current.id=q,O.current.idIsFromProps=a!==void 0,O.current.order=f,B.onCollapse=l,B.onExpand=d,B.onResize=p,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=s,ee.maxSize=c,ee.minSize=u,(K.collapsedSize!==ee.collapsedSize||K.collapsible!==ee.collapsible||K.maxSize!==ee.maxSize||K.minSize!==ee.minSize)&&T(O.current,K)}),Ri(()=>{const B=O.current;return E(B),()=>{P(B)}},[f,q,E,P]),MI(o,()=>({collapse:()=>{b(O.current)},expand:B=>{y(O.current,B)},getId(){return q},getSize(){return w(O.current)},isCollapsed(){return C(O.current)},isExpanded(){return!C(O.current)},resize:B=>{N(O.current,B)}}),[b,y,w,C,q,N]);const Y=S(O.current,s);return Mc(g,{...m,children:e,className:t,id:a,style:{...Y,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":k,"data-panel-id":q,"data-panel-size":parseFloat(""+Y.flexGrow).toFixed(1)})}const PI=NI((e,t)=>Mc(RI,{...e,forwardedRef:t}));RI.displayName="Panel";PI.displayName="forwardRef(Panel)";let sx=null,mi=null;function ZY(e,t){if(t){const n=(t&FI)!==0,r=(t&LI)!==0,s=(t&$I)!==0,o=(t&BI)!==0;if(n)return s?"se-resize":o?"ne-resize":"e-resize";if(r)return s?"sw-resize":o?"nw-resize":"w-resize";if(s)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function YY(){mi!==null&&(document.head.removeChild(mi),sx=null,mi=null)}function Kv(e,t){const n=ZY(e,t);sx!==n&&(sx=n,mi===null&&(mi=document.createElement("style"),document.head.appendChild(mi)),mi.innerHTML=`*{cursor: ${n}!important;}`)}function OI(e){return e.type==="keydown"}function II(e){return e.type.startsWith("pointer")}function DI(e){return e.type.startsWith("mouse")}function ym(e){if(II(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(DI(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function XY(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function eX(e,t,n){return e.xt.x&&e.yt.y}function tX(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Wk(e),b:Wk(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;st(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:Kk(qk(n.a)),b:Kk(qk(n.b))};if(s.a===s.b){const o=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let c=o.length;for(;c--;){const u=o[c];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(s.a-s.b)}const nX=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function rX(e){var t;const n=getComputedStyle((t=AI(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function sX(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||rX(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||nX.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function qk(e){let t=e.length;for(;t--;){const n=e[t];if(st(n,"Missing node"),sX(n))return n}return null}function Kk(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Wk(e){const t=[];for(;e;)t.push(e),e=AI(e);return t}function AI(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const FI=1,LI=2,$I=4,BI=8,oX=XY()==="coarse";let vs=[],Qd=!1,oa=new Map,bm=new Map;const Zd=new Set;function aX(e,t,n,r,s){var o;const{ownerDocument:a}=t,c={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},u=(o=oa.get(a))!==null&&o!==void 0?o:0;return oa.set(a,u+1),Zd.add(c),tg(),function(){var d;bm.delete(e),Zd.delete(c);const p=(d=oa.get(a))!==null&&d!==void 0?d:1;if(oa.set(a,p-1),tg(),p===1&&oa.delete(a),vs.includes(c)){const f=vs.indexOf(c);f>=0&&vs.splice(f,1),j0()}}}function Gk(e){const{target:t}=e,{x:n,y:r}=ym(e);Qd=!0,E0({target:t,x:n,y:r}),tg(),vs.length>0&&(ng("down",e),e.preventDefault(),e.stopPropagation())}function Su(e){const{x:t,y:n}=ym(e);if(e.buttons===0&&(Qd=!1,ng("up",e)),!Qd){const{target:r}=e;E0({target:r,x:t,y:n})}ng("move",e),j0(),vs.length>0&&e.preventDefault()}function xl(e){const{target:t}=e,{x:n,y:r}=ym(e);bm.clear(),Qd=!1,vs.length>0&&e.preventDefault(),ng("up",e),E0({target:t,x:n,y:r}),j0(),tg()}function E0({target:e,x:t,y:n}){vs.splice(0);let r=null;e instanceof HTMLElement&&(r=e),Zd.forEach(s=>{const{element:o,hitAreaMargins:a}=s,c=o.getBoundingClientRect(),{bottom:u,left:l,right:d,top:p}=c,f=oX?a.coarse:a.fine;if(t>=l-f&&t<=d+f&&n>=p-f&&n<=u+f){if(r!==null&&o!==r&&!o.contains(r)&&!r.contains(o)&&tX(r,o)>0){let g=r,m=!1;for(;g&&!g.contains(o);){if(eX(g.getBoundingClientRect(),c)){m=!0;break}g=g.parentElement}if(m)return}vs.push(s)}})}function Wv(e,t){bm.set(e,t)}function j0(){let e=!1,t=!1;vs.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;bm.forEach(r=>{n|=r}),e&&t?Kv("intersection",n):e?Kv("horizontal",n):t?Kv("vertical",n):YY()}function tg(){oa.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",xl),n.removeEventListener("pointerdown",Gk),n.removeEventListener("pointerleave",Su),n.removeEventListener("pointermove",Su)}),window.removeEventListener("pointerup",xl),window.removeEventListener("pointercancel",xl),Zd.size>0&&(Qd?(vs.length>0&&oa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",xl),n.addEventListener("pointerleave",Su),n.addEventListener("pointermove",Su))}),window.addEventListener("pointerup",xl),window.addEventListener("pointercancel",xl)):oa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",Gk,{capture:!0}),n.addEventListener("pointermove",Su))}))}function ng(e,t){Zd.forEach(n=>{const{setResizeHandlerState:r}=n,s=vs.includes(n);r(e,s,t)})}function st(e,t){if(!e)throw console.error(t),Error(t)}const T0=10;function Ji(e,t,n=T0){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function go(e,t,n=T0){return Ji(e,t,n)===0}function br(e,t,n){return Ji(e,t,n)===0}function iX(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-b:b)}}}{const p=e<0?c:u,f=n[p];st(f,`No panel constraints found for index ${p}`);const{collapsedSize:h=0,collapsible:g,minSize:m=0}=f;if(g){const x=t[p];if(st(x!=null,`Previous layout not found for panel index ${p}`),br(x,m)){const b=x-h;Ji(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const p=e<0?1:-1;let f=e<0?u:c,h=0;for(;;){const m=t[f];st(m!=null,`Previous layout not found for panel index ${f}`);const b=zl({panelConstraints:n,panelIndex:f,size:100})-m;if(h+=b,f+=p,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-g:g}{let f=e<0?c:u;for(;f>=0&&f=0))break;e<0?f--:f++}}if(iX(s,a))return s;{const p=e<0?u:c,f=t[p];st(f!=null,`Previous layout not found for panel index ${p}`);const h=f+l,g=zl({panelConstraints:n,panelIndex:p,size:h});if(a[p]=g,!br(g,h)){let m=h-g,b=e<0?u:c;for(;b>=0&&b0?b--:b++}}}const d=a.reduce((p,f)=>f+p,0);return br(d,100)?a:s}function lX({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,o=0,a=0;const c=n[0];st(c!=null,"No pivot index found"),t.forEach((p,f)=>{const{constraints:h}=p,{maxSize:g=100,minSize:m=0}=h;f===c?(r=m,s=g):(o+=m,a+=g)});const u=Math.min(s,100-o),l=Math.max(r,100-a),d=e[c];return{valueMax:u,valueMin:l,valueNow:d}}function Yd(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function zI(e,t,n=document){const s=Yd(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return s??null}function UI(e,t,n){const r=zI(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function VI(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function xm(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function cX(e,t,n,r=document){var s,o,a,c;const u=xm(t,r),l=Yd(e,r),d=u?l.indexOf(u):-1,p=(s=(o=n[d])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null,f=(a=(c=n[d+1])===null||c===void 0?void 0:c.id)!==null&&a!==void 0?a:null;return[p,f]}function uX({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:o,setLayout:a}){or({didWarnAboutMissingResizeHandle:!1}),Ri(()=>{if(!o)return;const c=Yd(n,o);for(let u=0;u{c.forEach((u,l)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,s,o]),Mi(()=>{if(!o)return;const c=t.current;st(c,"Eager values not found");const{panelDataArray:u}=c,l=VI(n,o);st(l!=null,`No group found for id "${n}"`);const d=Yd(n,o);st(d,`No resize handles found for group id "${n}"`);const p=d.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");st(h,"Resize handle element has no handle id attribute");const[g,m]=cX(n,h,u,o);if(g==null||m==null)return()=>{};const x=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const y=u.findIndex(w=>w.id===g);if(y>=0){const w=u[y];st(w,`No panel data found for index ${y}`);const S=r[y],{collapsedSize:k=0,collapsible:C,minSize:T=0}=w.constraints;if(S!=null&&C){const E=Au({delta:br(S,k)?T-k:k-S,initialLayout:r,panelConstraints:u.map(N=>N.constraints),pivotIndices:UI(n,h,o),prevLayout:r,trigger:"keyboard"});r!==E&&a(E)}}break}}};return f.addEventListener("keydown",x),()=>{f.removeEventListener("keydown",x)}});return()=>{p.forEach(f=>f())}},[o,e,t,n,r,s,a])}function Jk(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,s=100;for(let o=0;o{const o=e[s];st(o,`Panel data not found for index ${s}`);const{callbacks:a,constraints:c,id:u}=o,{collapsedSize:l=0,collapsible:d}=c,p=n[u];if(p==null||r!==p){n[u]=r;const{onCollapse:f,onExpand:h,onResize:g}=a;g&&g(r,p),d&&(f||h)&&(h&&(p==null||go(p,l))&&!go(r,l)&&h(),f&&(p==null||!go(p,l))&&go(r,l)&&f())}})}function lp(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function Qk(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function qI(e){return`react-resizable-panels:${e}`}function KI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:o}=t;return s?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function WI(e,t){try{const n=qI(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function mX(e,t,n){var r,s;const o=(r=WI(e,n))!==null&&r!==void 0?r:{},a=KI(t);return(s=o[a])!==null&&s!==void 0?s:null}function vX(e,t,n,r,s){var o;const a=qI(e),c=KI(t),u=(o=WI(e,s))!==null&&o!==void 0?o:{};u[c]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(u))}catch(l){console.error(l)}}function Zk({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,a)=>o+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!br(r,100))for(let o=0;o(Qk(Fu),Fu.getItem(e)),setItem:(e,t)=>{Qk(Fu),Fu.setItem(e,t)}},Yk={};function GI({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:o=null,onLayout:a=null,keyboardResizeBy:c=null,storage:u=Fu,style:l,tagName:d="div",...p}){const f=k0(o),h=or(null),[g,m]=ed(null),[x,b]=ed([]),y=or({}),w=or(new Map),S=or(0),k=or({autoSaveId:e,direction:r,dragState:g,id:f,keyboardResizeBy:c,onLayout:a,storage:u}),C=or({layout:x,panelDataArray:[],panelDataArrayChanged:!1});or({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),MI(s,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:H}=C.current;return H},setLayout:H=>{const{onLayout:oe}=k.current,{layout:Q,panelDataArray:ne}=C.current,re=Zk({layout:H,panelConstraints:ne.map(W=>W.constraints)});Jk(Q,re)||(b(re),C.current.layout=re,oe&&oe(re),wl(ne,re,y.current))}}),[]),Ri(()=>{k.current.autoSaveId=e,k.current.direction=r,k.current.dragState=g,k.current.id=f,k.current.onLayout=a,k.current.storage=u}),uX({committedValuesRef:k,eagerValuesRef:C,groupId:f,layout:x,panelDataArray:C.current.panelDataArray,setLayout:b,panelGroupElement:h.current}),Mi(()=>{const{panelDataArray:H}=C.current;if(e){if(x.length===0||x.length!==H.length)return;let oe=Yk[e];oe==null&&(oe=gX(vX,yX),Yk[e]=oe);const Q=[...H],ne=new Map(w.current);oe(e,Q,ne,x,u)}},[e,x,u]),Mi(()=>{});const T=gr(H=>{const{onLayout:oe}=k.current,{layout:Q,panelDataArray:ne}=C.current;if(H.constraints.collapsible){const re=ne.map(Pe=>Pe.constraints),{collapsedSize:W=0,panelSize:ge,pivotIndices:je}=ei(ne,H,Q);if(st(ge!=null,`Panel size not found for panel "${H.id}"`),!go(ge,W)){w.current.set(H.id,ge);const Ie=El(ne,H)===ne.length-1?ge-W:W-ge,ye=Au({delta:Ie,initialLayout:Q,panelConstraints:re,pivotIndices:je,prevLayout:Q,trigger:"imperative-api"});lp(Q,ye)||(b(ye),C.current.layout=ye,oe&&oe(ye),wl(ne,ye,y.current))}}},[]),E=gr((H,oe)=>{const{onLayout:Q}=k.current,{layout:ne,panelDataArray:re}=C.current;if(H.constraints.collapsible){const W=re.map(ot=>ot.constraints),{collapsedSize:ge=0,panelSize:je=0,minSize:Pe=0,pivotIndices:Ie}=ei(re,H,ne),ye=oe??Pe;if(go(je,ge)){const ot=w.current.get(H.id),Ht=ot!=null&&ot>=ye?ot:ye,tn=El(re,H)===re.length-1?je-Ht:Ht-je,dn=Au({delta:tn,initialLayout:ne,panelConstraints:W,pivotIndices:Ie,prevLayout:ne,trigger:"imperative-api"});lp(ne,dn)||(b(dn),C.current.layout=dn,Q&&Q(dn),wl(re,dn,y.current))}}},[]),N=gr(H=>{const{layout:oe,panelDataArray:Q}=C.current,{panelSize:ne}=ei(Q,H,oe);return st(ne!=null,`Panel size not found for panel "${H.id}"`),ne},[]),P=gr((H,oe)=>{const{panelDataArray:Q}=C.current,ne=El(Q,H);return hX({defaultSize:oe,dragState:g,layout:x,panelData:Q,panelIndex:ne})},[g,x]),q=gr(H=>{const{layout:oe,panelDataArray:Q}=C.current,{collapsedSize:ne=0,collapsible:re,panelSize:W}=ei(Q,H,oe);return st(W!=null,`Panel size not found for panel "${H.id}"`),re===!0&&go(W,ne)},[]),O=gr(H=>{const{layout:oe,panelDataArray:Q}=C.current,{collapsedSize:ne=0,collapsible:re,panelSize:W}=ei(Q,H,oe);return st(W!=null,`Panel size not found for panel "${H.id}"`),!re||Ji(W,ne)>0},[]),Y=gr(H=>{const{panelDataArray:oe}=C.current;oe.push(H),oe.sort((Q,ne)=>{const re=Q.order,W=ne.order;return re==null&&W==null?0:re==null?-1:W==null?1:re-W}),C.current.panelDataArrayChanged=!0},[]);Ri(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:oe,storage:Q}=k.current,{layout:ne,panelDataArray:re}=C.current;let W=null;if(H){const je=mX(H,re,Q);je&&(w.current=new Map(Object.entries(je.expandToSizes)),W=je.layout)}W==null&&(W=pX({panelDataArray:re}));const ge=Zk({layout:W,panelConstraints:re.map(je=>je.constraints)});Jk(ne,ge)||(b(ge),C.current.layout=ge,oe&&oe(ge),wl(re,ge,y.current))}}),Ri(()=>{const H=C.current;return()=>{H.layout=[]}},[]);const B=gr(H=>function(Q){Q.preventDefault();const ne=h.current;if(!ne)return()=>null;const{direction:re,dragState:W,id:ge,keyboardResizeBy:je,onLayout:Pe}=k.current,{layout:Ie,panelDataArray:ye}=C.current,{initialLayout:ot}=W??{},Ht=UI(ge,H,ne);let rn=fX(Q,H,re,W,je,ne);const tn=re==="horizontal";document.dir==="rtl"&&tn&&(rn=-rn);const dn=ye.map(J=>J.constraints),_=Au({delta:rn,initialLayout:ot??Ie,panelConstraints:dn,pivotIndices:Ht,prevLayout:Ie,trigger:OI(Q)?"keyboard":"mouse-or-touch"}),F=!lp(Ie,_);(II(Q)||DI(Q))&&S.current!=rn&&(S.current=rn,F?Wv(H,0):tn?Wv(H,rn<0?FI:LI):Wv(H,rn<0?$I:BI)),F&&(b(_),C.current.layout=_,Pe&&Pe(_),wl(ye,_,y.current))},[]),ee=gr((H,oe)=>{const{onLayout:Q}=k.current,{layout:ne,panelDataArray:re}=C.current,W=re.map(ot=>ot.constraints),{panelSize:ge,pivotIndices:je}=ei(re,H,ne);st(ge!=null,`Panel size not found for panel "${H.id}"`);const Ie=El(re,H)===re.length-1?ge-oe:oe-ge,ye=Au({delta:Ie,initialLayout:ne,panelConstraints:W,pivotIndices:je,prevLayout:ne,trigger:"imperative-api"});lp(ne,ye)||(b(ye),C.current.layout=ye,Q&&Q(ye),wl(re,ye,y.current))},[]),K=gr((H,oe)=>{const{layout:Q,panelDataArray:ne}=C.current,{collapsedSize:re=0,collapsible:W}=oe,{collapsedSize:ge=0,collapsible:je,maxSize:Pe=100,minSize:Ie=0}=H.constraints,{panelSize:ye}=ei(ne,H,Q);ye!=null&&(W&&je&&go(ye,re)?go(re,ge)||ee(H,ge):yePe&&ee(H,Pe))},[ee]),V=gr((H,oe)=>{const{direction:Q}=k.current,{layout:ne}=C.current;if(!h.current)return;const re=xm(H,h.current);st(re,`Drag handle element not found for id "${H}"`);const W=HI(Q,oe);m({dragHandleId:H,dragHandleRect:re.getBoundingClientRect(),initialCursorPosition:W,initialLayout:ne})},[]),A=gr(()=>{m(null)},[]),D=gr(H=>{const{panelDataArray:oe}=C.current,Q=El(oe,H);Q>=0&&(oe.splice(Q,1),delete y.current[H.id],C.current.panelDataArrayChanged=!0)},[]),X=WY(()=>({collapsePanel:T,direction:r,dragState:g,expandPanel:E,getPanelSize:N,getPanelStyle:P,groupId:f,isPanelCollapsed:q,isPanelExpanded:O,reevaluatePanelConstraints:K,registerPanel:Y,registerResizeHandle:B,resizePanel:ee,startDragging:V,stopDragging:A,unregisterPanel:D,panelGroupElement:h.current}),[T,g,r,E,N,P,f,q,O,K,Y,B,ee,V,A,D]),se={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Mc(vm.Provider,{value:X},Mc(d,{...p,children:t,className:n,id:o,ref:h,style:{...se,...l},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const JI=NI((e,t)=>Mc(GI,{...e,forwardedRef:t}));GI.displayName="PanelGroup";JI.displayName="forwardRef(PanelGroup)";function El(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ei(e,t,n){const r=El(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:o}}function bX({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Mi(()=>{if(e||n==null||r==null)return;const s=xm(t,r);if(s==null)return;const o=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const c=s.getAttribute("data-panel-group-id");st(c,`No group element found for id "${c}"`);const u=Yd(c,r),l=zI(c,t,r);st(l!==null,`No resize element found for id "${t}"`);const d=a.shiftKey?l>0?l-1:u.length-1:l+1{s.removeEventListener("keydown",o)}},[r,e,t,n])}function QI({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:o,onDragging:a,onFocus:c,style:u={},tabIndex:l=0,tagName:d="div",...p}){var f,h;const g=or(null),m=or({onDragging:a});Mi(()=>{m.current.onDragging=a});const x=_I(vm);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:y,registerResizeHandle:w,startDragging:S,stopDragging:k,panelGroupElement:C}=x,T=k0(s),[E,N]=ed("inactive"),[P,q]=ed(!1),[O,Y]=ed(null),B=or({state:E});Ri(()=>{B.current.state=E}),Mi(()=>{if(n)Y(null);else{const A=w(T);Y(()=>A)}},[n,T,w]);const ee=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,K=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return Mi(()=>{if(n||O==null)return;const A=g.current;return st(A,"Element ref not attached"),aX(T,A,b,{coarse:ee,fine:K},(X,se,H)=>{if(se)switch(X){case"down":{N("drag"),S(T,H);const{onDragging:oe}=m.current;oe&&oe(!0);break}case"move":{const{state:oe}=B.current;oe!=="drag"&&N("hover"),O(H);break}case"up":{N("hover"),k();const{onDragging:oe}=m.current;oe&&oe(!1);break}}else N("inactive")})},[ee,b,n,K,w,T,O,S,k]),bX({disabled:n,handleId:T,resizeHandler:O,panelGroupElement:C}),Mc(d,{...p,children:e,className:t,id:s,onBlur:()=>{q(!1),o==null||o()},onFocus:()=>{q(!0),c==null||c()},ref:g,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...u},tabIndex:l,"data-panel-group-direction":b,"data-panel-group-id":y,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":P?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":T})}QI.displayName="PanelResizeHandle";const Bo=({className:e,...t})=>i.jsx(JI,{className:ve("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Cn=PI,zo=({withHandle:e,className:t,...n})=>i.jsx(QI,{className:ve("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 after:bg-border focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(Rz,{className:"h-2.5 w-2.5"})})});var N0="Tabs",[xX,gce]=Xr(N0,[Kg]),ZI=Kg(),[wX,_0]=xX(N0),YI=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...l}=e,d=hf(c),[p,f]=_a({prop:r,onChange:s,defaultProp:o});return i.jsx(wX,{scope:n,baseId:gs(),value:p,onValueChange:f,orientation:a,dir:d,activationMode:u,children:i.jsx(Fe.div,{dir:d,"data-orientation":a,...l,ref:t})})});YI.displayName=N0;var XI="TabsList",eD=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=_0(XI,n),a=ZI(n);return i.jsx(fM,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:i.jsx(Fe.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});eD.displayName=XI;var tD="TabsTrigger",nD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=_0(tD,n),c=ZI(n),u=oD(a.baseId,r),l=aD(a.baseId,r),d=r===a.value;return i.jsx(pM,{asChild:!0,...c,focusable:!s,active:d,children:i.jsx(Fe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":l,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:ke(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:ke(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const p=a.activationMode!=="manual";!d&&!s&&p&&a.onValueChange(r)})})})});nD.displayName=tD;var rD="TabsContent",sD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=_0(rD,n),u=oD(c.baseId,r),l=aD(c.baseId,r),d=r===c.value,p=v.useRef(d);return v.useEffect(()=>{const f=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(f)},[]),i.jsx(pr,{present:s||d,children:({present:f})=>i.jsx(Fe.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!f,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:f&&o})})});sD.displayName=rD;function oD(e,t){return`${e}-trigger-${t}`}function aD(e,t){return`${e}-content-${t}`}var SX=YI,iD=eD,lD=nD,cD=sD;const M0=SX,wm=v.forwardRef(({className:e,...t},n)=>i.jsx(iD,{ref:n,className:ve("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));wm.displayName=iD.displayName;const Rc=v.forwardRef(({className:e,...t},n)=>i.jsx(lD,{ref:n,className:ve("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Rc.displayName=lD.displayName;const Pc=v.forwardRef(({className:e,...t},n)=>i.jsx(cD,{ref:n,className:ve("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Pc.displayName=cD.displayName;const CX=e=>["chats","findChats",JSON.stringify(e)],kX=async({instanceName:e})=>(await le.post(`/chat/findChats/${e}`,{where:{}})).data,EX=e=>{const{instanceName:t,...n}=e;return We({...n,queryKey:CX({instanceName:t}),queryFn:()=>kX({instanceName:t}),enabled:!!t})};function Uo(e){const t=o=>typeof window<"u"?window.matchMedia(o).matches:!1,[n,r]=v.useState(t(e));function s(){r(t(e))}return v.useEffect(()=>{const o=window.matchMedia(e);return s(),o.addListener?o.addListener(s):o.addEventListener("change",s),()=>{o.removeListener?o.removeListener(s):o.removeEventListener("change",s)}},[e]),n}const Ys=Object.create(null);Ys.open="0";Ys.close="1";Ys.ping="2";Ys.pong="3";Ys.message="4";Ys.upgrade="5";Ys.noop="6";const Hp=Object.create(null);Object.keys(Ys).forEach(e=>{Hp[Ys[e]]=e});const ox={type:"error",data:"parser error"},uD=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",dD=typeof ArrayBuffer=="function",fD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,R0=({type:e,data:t},n,r)=>uD&&t instanceof Blob?n?r(t):Xk(t,r):dD&&(t instanceof ArrayBuffer||fD(t))?n?r(t):Xk(new Blob([t]),r):r(Ys[e]+(t||"")),Xk=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function eE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Gv;function jX(e,t){if(uD&&e.data instanceof Blob)return e.data.arrayBuffer().then(eE).then(t);if(dD&&(e.data instanceof ArrayBuffer||fD(e.data)))return t(eE(e.data));R0(e,!1,n=>{Gv||(Gv=new TextEncoder),t(Gv.encode(n))})}const tE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,s=0,o,a,c,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),d=new Uint8Array(l);for(r=0;r>4,d[s++]=(a&15)<<4|c>>2,d[s++]=(c&3)<<6|u&63;return l},NX=typeof ArrayBuffer=="function",P0=(e,t)=>{if(typeof e!="string")return{type:"message",data:pD(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:_X(e.substring(1),t)}:Hp[n]?e.length>1?{type:Hp[n],data:e.substring(1)}:{type:Hp[n]}:ox},_X=(e,t)=>{if(NX){const n=TX(e);return pD(n,t)}else return{base64:!0,data:e}},pD=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},hD="",MX=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{R0(o,!1,c=>{r[a]=c,++s===n&&t(r.join(hD))})})},RX=(e,t)=>{const n=e.split(hD),r=[];for(let s=0;s{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Jv;function cp(e){return e.reduce((t,n)=>t+n.length,0)}function up(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;sMath.pow(2,21)-1){c.enqueue(ox);break}s=d*Math.pow(2,32)+l.getUint32(4),r=3}else{if(cp(n)e){c.enqueue(ox);break}}}})}const gD=4;function cn(e){if(e)return IX(e)}function IX(e){for(var t in cn.prototype)e[t]=cn.prototype[t];return e}cn.prototype.on=cn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};cn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};cn.prototype.off=cn.prototype.removeListener=cn.prototype.removeAllListeners=cn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;sPromise.resolve().then(t):(t,n)=>n(t,0),Vr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),DX="arraybuffer";function mD(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const AX=Vr.setTimeout,FX=Vr.clearTimeout;function Cm(e,t){t.useNativeTimers?(e.setTimeoutFn=AX.bind(Vr),e.clearTimeoutFn=FX.bind(Vr)):(e.setTimeoutFn=Vr.setTimeout.bind(Vr),e.clearTimeoutFn=Vr.clearTimeout.bind(Vr))}const LX=1.33;function $X(e){return typeof e=="string"?BX(e):Math.ceil((e.byteLength||e.size)*LX)}function BX(e){let t=0,n=0;for(let r=0,s=e.length;r=57344?n+=3:(r++,n+=4);return n}function vD(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function zX(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function UX(e){let t={},n=e.split("&");for(let r=0,s=n.length;r{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};RX(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,MX(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=vD()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let yD=!1;try{yD=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const qX=yD;function KX(){}class WX extends HX{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let ec=class qp extends cn{constructor(t,n,r){super(),this.createRequest=t,Cm(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=mD(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=qp.requestsCount++,qp.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=KX,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete qp.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ec.requestsCount=0;ec.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",nE);else if(typeof addEventListener=="function"){const e="onpagehide"in Vr?"pagehide":"unload";addEventListener(e,nE,!1)}}function nE(){for(let e in ec.requests)ec.requests.hasOwnProperty(e)&&ec.requests[e].abort()}const GX=function(){const e=bD({xdomain:!1});return e&&e.responseType!==null}();class JX extends WX{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=GX&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ec(bD,this.uri(),t)}}function bD(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||qX))return new XMLHttpRequest}catch{}if(!t)try{return new Vr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const xD=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class QX extends O0{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=xD?{}:mD(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{try{this.doWrite(r,o)}catch{}s&&Sm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=vD()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Qv=Vr.WebSocket||Vr.MozWebSocket;class ZX extends QX{createSocket(t,n,r){return xD?new Qv(t,n,r):n?new Qv(t,n):new Qv(t)}doWrite(t,n){this.ws.send(n)}}class YX extends O0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=OX(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=PX();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n{s&&Sm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const XX={websocket:ZX,webtransport:YX,polling:JX},eee=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tee=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ax(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=eee.exec(e||""),o={},a=14;for(;a--;)o[tee[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=nee(o,o.path),o.queryKey=ree(o,o.query),o}function nee(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ree(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const ix=typeof addEventListener=="function"&&typeof removeEventListener=="function",Kp=[];ix&&addEventListener("offline",()=>{Kp.forEach(e=>e())},!1);class ja extends cn{constructor(t,n){if(super(),this.binaryType=DX,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ax(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ax(n.host).host);Cm(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=UX(this.opts.query)),ix&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Kp.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=gD,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ja.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ja.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Sm(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ja.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ix&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Kp.indexOf(this._offlineEventListener);r!==-1&&Kp.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ja.protocol=gD;class see extends ja{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ja.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=p=>{const f=new Error("probe error: "+p);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function c(){a("transport closed")}function u(){a("socket closed")}function l(p){n&&p.name!==n.name&&o()}const d=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",l)};n.once("open",s),n.once("error",a),n.once("close",c),this.once("close",u),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;rXX[s]).filter(s=>!!s)),super(t,r)}};function aee(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ax(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const iee=typeof ArrayBuffer=="function",lee=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,wD=Object.prototype.toString,cee=typeof Blob=="function"||typeof Blob<"u"&&wD.call(Blob)==="[object BlobConstructor]",uee=typeof File=="function"||typeof File<"u"&&wD.call(File)==="[object FileConstructor]";function I0(e){return iee&&(e instanceof ArrayBuffer||lee(e))||cee&&e instanceof Blob||uee&&e instanceof File}function Wp(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let c=0;c{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,c)=>a?s(a):r(c);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:dt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case dt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case dt.EVENT:case dt.BINARY_EVENT:this.onevent(t);break;case dt.ACK:case dt.BINARY_ACK:this.onack(t);break;case dt.DISCONNECT:this.ondisconnect();break;case dt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:dt.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:dt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}Xc.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Xc.prototype.reset=function(){this.attempts=0};Xc.prototype.setMin=function(e){this.ms=e};Xc.prototype.setMax=function(e){this.max=e};Xc.prototype.setJitter=function(e){this.jitter=e};class ux extends cn{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Cm(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Xc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||vee;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new oee(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=as(n,"open",function(){r.onopen(),t&&t()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=as(n,"error",o);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(as(t,"ping",this.onping.bind(this)),as(t,"data",this.ondata.bind(this)),as(t,"error",this.onerror.bind(this)),as(t,"close",this.onclose.bind(this)),as(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sm(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new SD(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Cu={};function Gp(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=aee(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Cu[s]&&o in Cu[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new ux(r,t):(Cu[s]||(Cu[s]=new ux(r,t)),u=Cu[s]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(Gp,{Manager:ux,Socket:SD,io:Gp,connect:Gp});const td=new Map,A0=e=>{if(td.has(e)){const n=td.get(e);return sE(n)}const t=Gp(e,{transports:["websocket","polling"],autoConnect:!1,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,timeout:2e4});return td.set(e,t),t.on("connect",()=>{console.log(`✅ WebSocket connected to ${e}`)}),t.on("disconnect",n=>{console.log(`❌ WebSocket disconnected from ${e}:`,n)}),t.on("connect_error",n=>{console.error(`🚫 WebSocket connection error to ${e}:`,n)}),t.on("reconnect",n=>{console.log(`🔄 WebSocket reconnected to ${e} after ${n} attempts`)}),t.on("reconnect_error",n=>{console.error(`🔄❌ WebSocket reconnection error to ${e}:`,n)}),sE(t)},F0=e=>{for(const[t,n]of td.entries())if(n===e||e._socket===n){console.log(`🔌 Disconnecting socket for ${t}`),n.disconnect(),td.delete(t);break}},sE=e=>({on:(t,n)=>{e.on(t,n)},off:t=>{e.off(t)},connect:()=>{e.connected||e.connect()},disconnect:()=>{e.disconnect()}}),Pi=v.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:ve("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Pi.displayName="Textarea";const bee=e=>["chats","findChats",JSON.stringify(e)],xee=async({instanceName:e,remoteJid:t})=>{const n=await le.post(`/chat/findChats/${e}`,{where:{remoteJid:t}});return Array.isArray(n.data)?n.data[0]:n.data},wee=e=>{const{instanceName:t,remoteJid:n,...r}=e;return We({...r,queryKey:bee({instanceName:t,remoteJid:n}),queryFn:()=>xee({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},See=e=>["chats","findMessages",JSON.stringify(e)],Cee=async({instanceName:e,remoteJid:t})=>{var r,s;const n=await le.post(`/chat/findMessages/${e}`,{where:{key:{remoteJid:t}}});return(s=(r=n.data)==null?void 0:r.messages)!=null&&s.records?n.data.messages.records:n.data},kee=e=>{const{instanceName:t,remoteJid:n,...r}=e;return We({...r,queryKey:See({instanceName:t,remoteJid:n}),queryFn:()=>Cee({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},Eee=async({instanceName:e,token:t,data:n})=>(await le.post(`/message/sendText/${e}`,n,{headers:{apikey:t,"content-type":"application/json"}})).data,jee=async({instanceName:e,token:t,data:n})=>{try{const r={number:n.number,mediatype:n.mediaMessage.mediatype,mimetype:n.mediaMessage.mimetype,caption:n.mediaMessage.caption,media:n.mediaMessage.media,fileName:n.mediaMessage.fileName};return(await le.post(`/message/sendMedia/${e}`,r,{headers:{apikey:t,"content-type":"application/json"}})).data}catch(r){throw console.error("Erro ao enviar mídia:",r),r}},Tee=async({instanceName:e,token:t,data:n})=>{try{const r={number:n.number,audioMessage:{audio:n.audioMessage.audio},options:n.options};return(await le.post(`/message/sendWhatsAppAudio/${e}`,r,{headers:{apikey:t,"content-type":"application/json"}})).data}catch(r){throw console.error("Erro ao enviar áudio:",r),r}};function CD(){return{sendText:Ae(Eee,{invalidateKeys:[["chats","findMessages"],["chats","findChats"]]})}}function kD(){return{sendMedia:Ae(jee)}}function Nee(){return{sendAudio:Ae(Tee)}}const ED=v.createContext({backgroundColor:"",textForegroundColor:"",primaryColor:"",fromMeBubbleColor:"",fromMeForegroundColor:"",fromOtherBubbleColor:"",fromOtherForegroundColor:"",fromMeQuotedBubbleColor:"",fromOtherQuotedBubbleColor:"",inputBackgroundColor:"",inputTextForegroundColor:"",inputIconsMainColor:""});function _ee({children:e}){const[t]=uf(),{theme:n}=Mg(),r=t.get("backgroundColor"),s=t.get("textForegroundColor"),o=t.get("primaryColor"),a=t.get("fromMeBubbleColor"),c=t.get("fromMeForegroundColor"),u=t.get("fromOtherBubbleColor"),l=t.get("fromOtherForegroundColor"),d=t.get("fromMeQuotedBubbleColor"),p=t.get("fromOtherQuotedBubbleColor"),f=t.get("inputBackgroundColor"),h=t.get("inputTextForegroundColor"),g=t.get("inputIconsMainColor"),m=()=>n==="dark"?"#0f0f0f":"#faf9fa",x=()=>n==="dark"?"#faf9fa":"#020202",b=()=>n==="dark"?"#0b332a":"#e0f0f0",y=()=>n==="dark"?"#0b332a":"#c8fff2",w=()=>n==="dark"?"#ffffff":"#020202",S=()=>n==="dark"?"#1d2724":"#e0f0f0",k=()=>n==="dark"?"#ffffff":"#020202",C=()=>n==="dark"?"#161616":"#e0f0f0",T=()=>n==="dark"?"#faf9fa":"#020202",E=()=>n==="dark"?"#1f463d":"#aff7e6",N=()=>n==="dark"?"#0f1413":"#d2e2e2",P=()=>n==="dark"?"#0e6451":"#0b332a";return i.jsx(ED.Provider,{value:{backgroundColor:r||m(),textForegroundColor:s||x(),primaryColor:o||b(),fromMeBubbleColor:a||y(),fromMeForegroundColor:c||w(),fromOtherBubbleColor:u||S(),fromOtherForegroundColor:l||k(),fromMeQuotedBubbleColor:d||E(),fromOtherQuotedBubbleColor:p||N(),inputBackgroundColor:f||C(),inputTextForegroundColor:h||T(),inputIconsMainColor:g||P()},children:e})}const Qa=()=>v.useContext(ED),jD=({setSelectedMedia:e})=>{const{t}=Ee(),{inputIconsMainColor:n}=Qa(),r=v.useRef(null),s=v.useRef(null),[o,a]=v.useState(!1),c=p=>{var m;const f=(m=p.target.files)==null?void 0:m[0];if(!f){e(null);return}const h=f.type.split("/")[0],g=f.size/(1024*1024);switch(h){case"audio":if(g>16){Z.error(t("chat.media.errors.audioSize"));return}break;case"image":if(g>5){Z.error(t("chat.media.errors.imageSize"));return}break;case"video":if(g>16){Z.error(t("chat.media.errors.videoSize"));return}break;case"application":case"text":if(g>100){Z.error(t("chat.media.errors.documentSize"));return}break;default:Z.error(t("chat.media.errors.unsupportedType"));return}e(f)},u=p=>{p.preventDefault(),r.current&&r.current.click()},l=p=>{p.preventDefault(),s.current&&s.current.click()},d=["text/plain","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/zip","application/x-rar-compressed","application/x-7z-compressed"];return i.jsx(i.Fragment,{children:i.jsxs(Rr,{open:o,onOpenChange:a,children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[i.jsx(Yr,{className:"h-6 w-6",style:{color:n}}),i.jsx("span",{className:"sr-only",children:t("chat.media.attach")})]})}),i.jsxs(tr,{align:"end",children:[i.jsx("input",{ref:s,type:"file",accept:d.join(", "),onChange:c,className:"hidden"}),i.jsxs(Ye,{onClick:l,children:[i.jsx(Nz,{className:"mr-2 h-4 w-4"}),t("chat.media.document")]}),i.jsx("input",{ref:r,type:"file",accept:"image/*, video/*",onChange:c,className:"hidden"}),i.jsxs(Ye,{onClick:u,children:[i.jsx(Oz,{className:"mr-2 h-4 w-4"}),t("chat.media.photosAndVideos")]})]})]})})},TD=({selectedMedia:e,setSelectedMedia:t})=>{const{t:n}=Ee(),r=()=>{t(null)},s=a=>a.type.includes("image")?i.jsx("img",{className:"w-80 rounded-lg",src:URL.createObjectURL(a),alt:n("chat.media.selectedMedia.imageAlt"),style:{maxHeight:"400px",objectFit:"contain"}}):a.type.includes("video")?i.jsx("div",{className:"flex items-center justify-center",children:i.jsx("video",{className:"w-80 rounded-lg object-cover",src:URL.createObjectURL(a),controls:!0})}):i.jsx("div",{className:"flex items-center justify-center",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Tw,{className:"h-6 w-6"}),n("chat.media.selectedMedia.file")]})}),o=a=>{const c=["B","KB","MB","GB","TB"];let u=0;for(;a>1024;)a/=1024,u++;return`${a.toFixed(2)} ${c[u]}`};return i.jsxs("div",{className:"relative flex items-center rounded-lg bg-[#e0f0f0] dark:bg-[#1d2724] dark:text-white",children:[i.jsx("div",{className:"absolute h-full w-1 rounded-l-lg bg-blue-700 dark:bg-blue-300"}),i.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-6 p-4 pl-4",children:[e&&s(e),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium",children:(e==null?void 0:e.name)||n("chat.media.selectedMedia.selectedFile")}),i.jsx("span",{className:"text-xs text-gray-500",children:o((e==null?void 0:e.size)||0)})]})]}),i.jsx($,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 rounded-full",onClick:r,children:i.jsx(Nw,{className:"h-6 w-6"})})]})},oE=e=>{const t=new Date,n=new Date(t);n.setDate(n.getDate()-1);const r=new Date(e);return r.toDateString()===t.toDateString()?"Hoje":r.toDateString()===n.toDateString()?"Ontem":Math.floor((t.getTime()-r.getTime())/(1e3*60*60*24))<7?r.toLocaleDateString("pt-BR",{weekday:"long"}):r.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})},Zv=e=>{try{if(!e.messageTimestamp)return new Date;if(typeof e.messageTimestamp=="object"){const n=[e.messageTimestamp.low,e.messageTimestamp.seconds,e.messageTimestamp.timestamp,e.messageTimestamp.time,e.messageTimestamp.value].find(r=>typeof r=="number"&&!isNaN(r))||Date.now()/1e3;return new Date(n*1e3)}else if(isNaN(Number(e.messageTimestamp))){if(typeof e.messageTimestamp=="string"&&e.messageTimestamp.includes("T"))return new Date(e.messageTimestamp)}else{const t=Number(e.messageTimestamp);return t>1e12?new Date(t):new Date(t*1e3)}return new Date}catch{return new Date}},Mee=({date:e})=>i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx("div",{className:"rounded-full bg-muted px-3 py-1",children:i.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:e})})}),Ree=e=>{if(!e)return"";if(typeof e=="string")try{const t=JSON.parse(e);return t.conversation||t.text||e}catch{return e}return typeof e=="object"?e.conversation||e.text||"":String(e)},aE=({message:e})=>{var n,r,s,o,a;const t=e.messageType;switch(t){case"conversation":if(e.message.contactMessage){const h=e.message.contactMessage;return i.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"text-xl",children:"👤"}),i.jsx("span",{className:"font-medium",children:"Contact"})]}),h.displayName&&i.jsx("p",{className:"text-sm font-medium",children:h.displayName}),h.vcard&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact card"})]})}if(e.message.locationMessage){const h=e.message.locationMessage;return i.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"text-xl",children:"📍"}),i.jsx("span",{className:"font-medium",children:"Location"})]}),h.name&&i.jsx("p",{className:"text-sm font-medium",children:h.name}),h.address&&i.jsx("p",{className:"text-xs text-muted-foreground",children:h.address}),h.degreesLatitude&&h.degreesLongitude&&i.jsx("a",{href:`https://maps.google.com/?q=${h.degreesLatitude},${h.degreesLongitude}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm mt-1 inline-block",children:"View on Maps"})]})}return i.jsx("span",{children:Ree(e.message)});case"extendedTextMessage":return i.jsx("span",{children:e.message.conversation??((n=e.message.extendedTextMessage)==null?void 0:n.text)});case"imageMessage":const u=(e.message.base64?e.message.base64.startsWith("data:")?e.message.base64:`data:image/jpeg;base64,${e.message.base64}`:null)||e.message.mediaUrl;return i.jsxs("div",{className:"flex flex-col gap-2",children:[u?i.jsx("img",{src:u,alt:"Image",className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px",objectFit:"contain"},loading:"lazy"}):i.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[i.jsx("p",{className:"text-center text-muted-foreground",children:"Image couldn't be loaded"}),i.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),((r=e.message.imageMessage)==null?void 0:r.caption)&&i.jsx("p",{className:"text-sm",children:e.message.imageMessage.caption})]});case"videoMessage":const d=(e.message.base64?e.message.base64.startsWith("data:")?e.message.base64:`data:video/mp4;base64,${e.message.base64}`:null)||e.message.mediaUrl;return i.jsxs("div",{className:"flex flex-col gap-2",children:[d?i.jsx("video",{src:d,controls:!0,className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px"}}):i.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[i.jsx("p",{className:"text-center text-muted-foreground",children:"Video couldn't be loaded"}),i.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),((s=e.message.videoMessage)==null?void 0:s.caption)&&i.jsx("p",{className:"text-sm",children:e.message.videoMessage.caption})]});case"audioMessage":const f=(e.message.base64?e.message.base64.startsWith("data:")?e.message.base64:`data:audio/mpeg;base64,${e.message.base64}`:null)||e.message.mediaUrl;return f?i.jsxs("audio",{controls:!0,className:"w-full max-w-xs",children:[i.jsx("source",{src:f,type:"audio/mpeg"}),"Your browser does not support the audio element."]}):i.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[i.jsx("p",{className:"text-center text-muted-foreground",children:"Audio couldn't be loaded"}),i.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]});case"documentMessage":return i.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg max-w-xs",children:[i.jsx("div",{className:"text-2xl",children:"📄"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium truncate",children:((o=e.message.documentMessage)==null?void 0:o.fileName)||"Document"}),((a=e.message.documentMessage)==null?void 0:a.fileLength)&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[(e.message.documentMessage.fileLength/1024/1024).toFixed(2)," MB"]})]})]});case"stickerMessage":return i.jsx("img",{src:e.message.mediaUrl,alt:"Sticker",className:"max-w-32 max-h-32 object-contain"});default:return i.jsx("div",{className:"text-xs text-muted-foreground bg-muted p-2 rounded max-w-xs",children:i.jsxs("details",{children:[i.jsxs("summary",{children:["Unknown message type: ",t]}),i.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-all text-xs",children:JSON.stringify(e.message,null,2)})]})})}};function ND({textareaRef:e,handleTextareaChange:t,textareaHeight:n,lastMessageRef:r,scrollToBottom:s}){var Y,B,ee;const{instance:o}=He(),[a,c]=v.useState(""),[u,l]=v.useState(!1),[d,p]=v.useState(null),[f,h]=v.useState([]),{sendText:g}=CD(),{sendMedia:m}=kD(),{remoteJid:x}=Zr(),b=async()=>{if(!(!a.trim()||!x||!(o!=null&&o.name)||!(o!=null&&o.token)||u))try{l(!0),await g({instanceName:o.name,token:o.token,data:{number:x,text:a.trim()}}),c(""),e.current&&(e.current.value="",t())}catch(K){console.error("Error sending message:",K)}finally{l(!1)}},y=async()=>{if(!(!d||!x||!(o!=null&&o.name)||!(o!=null&&o.token)||u))try{l(!0);const K=await new Promise((V,A)=>{const D=new FileReader;D.readAsDataURL(d),D.onload=()=>{const se=D.result.split(",")[1];V(se)},D.onerror=A});await m({instanceName:o.name,token:o.token,data:{number:x,mediaMessage:{mediatype:d.type.split("/")[0]==="application"?"document":d.type.split("/")[0],mimetype:d.type,caption:a.trim(),media:K,fileName:d.name}}}),p(null),c(""),e.current&&(e.current.value="",t())}catch(K){console.error("Error sending media:",K)}finally{l(!1)}},w=async()=>{d?await y():await b()},S=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),w())},k=K=>{c(K.target.value),t()},{data:C}=wee({remoteJid:x,instanceName:o==null?void 0:o.name}),{data:T,isSuccess:E}=kee({remoteJid:x,instanceName:o==null?void 0:o.name}),N=v.useMemo(()=>{if(!T)return f;const K=new Map;return T.forEach(V=>K.set(V.key.id,V)),f.forEach(V=>{K.set(V.key.id,V)}),Array.from(K.values())},[T,f]);v.useEffect(()=>{if(!(o!=null&&o.name)||!x)return;const V=A0("https://icom-socket-gateway.icommarketing.com.br"),A=(X,se)=>{var oe,Q;if(!o||se.instance!==o.name||((Q=(oe=se==null?void 0:se.data)==null?void 0:oe.key)==null?void 0:Q.remoteJid)!==x)return;const H=se.data;h(ne=>{const re=ne.findIndex(W=>W.key.id===H.key.id);if(re!==-1){const W=[...ne];return W[re]=H,W}else return[...ne,H]})},D=X=>{o&&X.instance===o.name&&console.log("Received message status update:",X)};return V.on("messages.upsert",X=>{A("messages.upsert",X)}),V.on("send.message",X=>{A("send.message",X)}),V.on("messages.update",X=>{D(X)}),V.connect(),()=>{V.off("messages.upsert"),V.off("send.message"),V.off("messages.update"),F0(V)}},[o==null?void 0:o.name,x]);const P=v.useMemo(()=>{if(!N)return[];const K=[...N].sort((X,se)=>{const H=Zv(X).getTime(),oe=Zv(se).getTime();return H-oe}),V=[];let A="",D=[];return K.forEach(X=>{const H=Zv(X).toDateString();H!==A?(D.length>0&&V.push({date:oE(new Date(A)),messages:D}),A=H,D=[X]):D.push(X)}),D.length>0&&V.push({date:oE(new Date(A)),messages:D}),V},[N]);v.useEffect(()=>{E&&N&&s()},[E,N,s]),v.useEffect(()=>{p(null),c(""),h([]),e.current&&(e.current.value="",t())},[x]);const q=K=>i.jsx("div",{className:"bubble-right",children:i.jsx("div",{className:"flex items-start gap-4 self-end",children:i.jsx("div",{className:"grid gap-1",children:i.jsx("div",{className:"bubble",children:i.jsx(aE,{message:K})})})})},K.id),O=K=>i.jsx("div",{className:"bubble-left",children:i.jsx("div",{className:"flex items-start gap-4",children:i.jsx("div",{className:"grid gap-1",children:i.jsx("div",{className:"bubble",children:i.jsx(aE,{message:K})})})})},K.id);return i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"sticky top-0 bg-background border-b border-border p-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs(Ui,{className:"h-10 w-10",children:[i.jsx(Vi,{src:C==null?void 0:C.profilePicUrl,alt:(C==null?void 0:C.pushName)||((Y=C==null?void 0:C.remoteJid)==null?void 0:Y.split("@")[0])}),i.jsx(Ah,{className:"bg-slate-700 text-slate-300 border border-slate-600",children:i.jsx(_h,{className:"h-5 w-5"})})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm truncate",children:(C==null?void 0:C.pushName)||((B=C==null?void 0:C.remoteJid)==null?void 0:B.split("@")[0])}),i.jsx("div",{className:"text-xs text-muted-foreground truncate",children:(ee=C==null?void 0:C.remoteJid)==null?void 0:ee.split("@")[0]})]}),i.jsxs(Gw,{children:[i.jsx(Jw,{asChild:!0,children:i.jsx($,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:i.jsx(Lg,{className:"h-4 w-4"})})}),i.jsxs(tr,{align:"start",className:"max-w-[300px]",children:[i.jsxs(Ye,{className:"items-start gap-2",children:[i.jsx(Uz,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"GPT-4"}),i.jsx("div",{className:"text-muted-foreground/80",children:"With DALL-E, browsing and analysis. Limit 40 messages / 3 hours"})]})]}),i.jsx(Xs,{}),i.jsxs(Ye,{className:"items-start gap-2",children:[i.jsx(R_,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"GPT-3"}),i.jsx("div",{className:"text-muted-foreground/80",children:"Great for everyday tasks"})]})]})]})]})]})}),i.jsxs("div",{className:"message-container mx-auto flex max-w-4xl flex-1 flex-col gap-2 overflow-y-auto px-2",children:[P.map((K,V)=>i.jsxs("div",{children:[i.jsx(Mee,{date:K.date}),i.jsx("div",{className:"flex flex-col gap-2",children:K.messages.map(A=>A.key.fromMe?q(A):O(A))})]},V)),i.jsx("div",{ref:r})]}),i.jsxs("div",{className:"sticky bottom-0 mx-auto flex w-full max-w-2xl flex-col gap-1.5 bg-background px-2 py-2",children:[d&&i.jsx(TD,{selectedMedia:d,setSelectedMedia:p}),i.jsxs("div",{className:"flex items-center rounded-3xl border border-border bg-background px-2 py-1",children:[o&&i.jsx(jD,{instance:o,setSelectedMedia:p}),i.jsx(Pi,{placeholder:"Enviar mensagem...",name:"message",id:"message",rows:1,ref:e,value:a,onChange:k,onKeyDown:S,disabled:u,style:{height:n},className:"min-h-0 w-full resize-none border-none p-3 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 focus-visible:ring-offset-transparent"}),i.jsxs($,{type:"button",size:"icon",onClick:w,disabled:!a.trim()&&!d||u,className:"rounded-full p-2 disabled:opacity-50",children:[i.jsx(jw,{className:"h-6 w-6"}),i.jsx("span",{className:"sr-only",children:"Enviar"})]})]})]})]})}const Pee=e=>e.split("@")[0];function iE(){const e=Uo("(min-width: 768px)"),t=v.useRef(null),[n]=v.useState("auto"),r=v.useRef(null),{instance:s}=He(),[o,a]=v.useState([]),{data:c,isSuccess:u}=EX({instanceName:s==null?void 0:s.name}),l=Te.useMemo(()=>{if(!c)return o;const x=new Map;return c.forEach(b=>x.set(b.remoteJid,b)),o.forEach(b=>{const y=x.get(b.remoteJid);y?x.set(b.remoteJid,{...y,...b}):x.set(b.remoteJid,b)}),Array.from(x.values())},[c,o]),{instanceId:d,remoteJid:p}=Zr(),f=Qt();v.useEffect(()=>{if(!(s!=null&&s.name))return;const b=A0("https://integracaov2.icommarketing.com.br"),y=(w,S)=>{var C,T;if(!s||S.instance!==s.name)return;const k=(T=(C=S==null?void 0:S.data)==null?void 0:C.key)==null?void 0:T.remoteJid;k&&a(E=>{var q,O,Y;const N=E.findIndex(B=>B.remoteJid===k),P={id:k,remoteJid:k,pushName:((q=S==null?void 0:S.data)==null?void 0:q.pushName)||Pee(k),profilePicUrl:((Y=(O=S==null?void 0:S.data)==null?void 0:O.key)==null?void 0:Y.profilePictureUrl)||"",...S==null?void 0:S.data};if(N!==-1){const B=[...E];return B[N]={...B[N],...P},B}else return[...E,P]})};return b.on("messages.upsert",w=>{y("messages.upsert",w)}),b.on("send.message",w=>{y("send.message",w)}),b.connect(),()=>{b.off("messages.upsert"),b.off("send.message"),F0(b)}},[s==null?void 0:s.name]);const h=v.useCallback(()=>{t.current&&t.current.scrollIntoView({})},[]),g=()=>{if(r.current){r.current.style.height="auto";const x=r.current.scrollHeight,y=parseInt(getComputedStyle(r.current).lineHeight)*10;r.current.style.height=`${Math.min(x,y)}px`}};v.useEffect(()=>{u&&h()},[u,h]);const m=x=>{f(`/manager/instance/${d}/chat/${x}`)};return i.jsx("div",{className:"h-[calc(100vh-160px)] overflow-hidden",children:i.jsxs(Bo,{direction:e?"horizontal":"vertical",className:"h-full",children:[i.jsx(Cn,{defaultSize:20,children:i.jsxs("div",{className:"hidden h-full flex-col bg-background text-foreground md:flex",children:[i.jsx("div",{className:"flex-shrink-0 p-2",children:i.jsxs($,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:i.jsx(Cc,{className:"h-4 w-4"})}),i.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:"Chat"}),i.jsx(Yr,{className:"h-4 w-4"})]})}),i.jsxs(M0,{defaultValue:"contacts",className:"flex flex-col flex-1 min-h-0",children:[i.jsxs(wm,{className:"tabs-chat flex-shrink-0",children:[i.jsx(Rc,{value:"contacts",children:"Contatos"}),i.jsx(Rc,{value:"groups",children:"Grupos"})]}),i.jsx(Pc,{value:"contacts",className:"flex-1 overflow-hidden",children:i.jsx("div",{className:"h-full overflow-auto",children:i.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[i.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:"Contatos"}),c==null?void 0:c.map(x=>x.remoteJid.includes("@s.whatsapp.net")&&i.jsxs(Ed,{to:"#",onClick:()=>m(x.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${p===x.remoteJid?"active":""}`,children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsxs(Ui,{className:"h-8 w-8",children:[i.jsx(Vi,{src:x.profilePicUrl,alt:x.pushName||x.remoteJid.split("@")[0]}),i.jsx(Ah,{className:"bg-slate-700 text-slate-300 border border-slate-600",children:i.jsx(_h,{className:"h-5 w-5"})})]})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"chat-title block font-medium",children:x.pushName||x.remoteJid.split("@")[0]}),i.jsx("span",{className:"chat-description block text-xs text-gray-500",children:x.remoteJid.split("@")[0]})]})]},x.id))]})})}),i.jsx(Pc,{value:"groups",className:"flex-1 overflow-hidden",children:i.jsx("div",{className:"h-full overflow-auto",children:i.jsx("div",{className:"grid gap-1 p-2 text-foreground",children:l==null?void 0:l.map(x=>x.remoteJid.includes("@g.us")&&i.jsxs(Ed,{to:"#",onClick:()=>m(x.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${p===x.remoteJid?"active":""}`,children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsxs(Ui,{className:"h-8 w-8",children:[i.jsx(Vi,{src:x.profilePicUrl,alt:x.pushName||x.remoteJid.split("@")[0]}),i.jsx(Ah,{className:"bg-slate-700 text-slate-300 border border-slate-600",children:i.jsx(_h,{className:"h-5 w-5"})})]})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"chat-title block font-medium",children:x.pushName||x.remoteJid.split("@")[0]}),i.jsx("span",{className:"chat-description block text-xs text-gray-500",children:x.remoteJid})]})]},x.id))})})})]})]})}),i.jsx(zo,{withHandle:!0,className:"border border-black"}),i.jsx(Cn,{children:p&&i.jsx(ND,{textareaRef:r,handleTextareaChange:g,textareaHeight:n,lastMessageRef:t,scrollToBottom:h})})]})})}const Oee=e=>["chatwoot","fetchChatwoot",JSON.stringify(e)],Iee=async({instanceName:e,token:t})=>(await le.get(`/chatwoot/find/${e}`,{headers:{apiKey:t}})).data,Dee=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Oee({instanceName:t,token:n}),queryFn:()=>Iee({instanceName:t,token:n}),enabled:!!t})},Aee=async({instanceName:e,token:t,data:n})=>(await le.post(`/chatwoot/set/${e}`,n,{headers:{apikey:t}})).data;function Fee(){return{createChatwoot:Ae(Aee,{invalidateKeys:[["chatwoot","fetchChatwoot"]]})}}const dp=j.string().optional().transform(e=>e===""?void 0:e),Lee=j.object({enabled:j.boolean(),accountId:j.string(),token:j.string(),url:j.string(),signMsg:j.boolean().optional(),signDelimiter:dp,nameInbox:dp,organization:dp,logo:dp,reopenConversation:j.boolean().optional(),conversationPending:j.boolean().optional(),mergeBrazilContacts:j.boolean().optional(),importContacts:j.boolean().optional(),importMessages:j.boolean().optional(),daysLimitImportMessages:j.coerce.number().optional(),autoCreate:j.boolean(),ignoreJids:j.array(j.string()).default([])});function $ee(){const{t:e}=Ee(),{instance:t}=He(),[,n]=v.useState(!1),{createChatwoot:r}=Fee(),{data:s}=Dee({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),o=$t({resolver:Bt(Lee),defaultValues:{enabled:!0,accountId:"",token:"",url:"",signMsg:!0,signDelimiter:"\\n",nameInbox:"",organization:"",logo:"",reopenConversation:!0,conversationPending:!1,mergeBrazilContacts:!0,importContacts:!1,importMessages:!1,daysLimitImportMessages:7,autoCreate:!0,ignoreJids:[]}});v.useEffect(()=>{if(s){o.setValue("ignoreJids",s.ignoreJids||[]);const c={enabled:s.enabled,accountId:s.accountId,token:s.token,url:s.url,signMsg:s.signMsg||!1,signDelimiter:s.signDelimiter||"\\n",nameInbox:s.nameInbox||"",organization:s.organization||"",logo:s.logo||"",reopenConversation:s.reopenConversation||!1,conversationPending:s.conversationPending||!1,mergeBrazilContacts:s.mergeBrazilContacts||!1,importContacts:s.importContacts||!1,importMessages:s.importMessages||!1,daysLimitImportMessages:s.daysLimitImportMessages||7,autoCreate:s.autoCreate||!1,ignoreJids:s.ignoreJids};o.reset(c)}},[s,o]);const a=async c=>{if(!t)return;n(!0);const u={enabled:c.enabled,accountId:c.accountId,token:c.token,url:c.url,signMsg:c.signMsg||!1,signDelimiter:c.signDelimiter||"\\n",nameInbox:c.nameInbox||"",organization:c.organization||"",logo:c.logo||"",reopenConversation:c.reopenConversation||!1,conversationPending:c.conversationPending||!1,mergeBrazilContacts:c.mergeBrazilContacts||!1,importContacts:c.importContacts||!1,importMessages:c.importMessages||!1,daysLimitImportMessages:c.daysLimitImportMessages||7,autoCreate:c.autoCreate,ignoreJids:c.ignoreJids};await r({instanceName:t.name,token:t.token,data:u},{onSuccess:()=>{Z.success(e("chatwoot.toast.success"))},onError:l=>{var d,p,f;console.error(e("chatwoot.toast.error"),l),y_(l)?Z.error(`Error: ${(f=(p=(d=l==null?void 0:l.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`):Z.error(e("chatwoot.toast.error"))},onSettled:()=>{n(!1)}})};return i.jsx(i.Fragment,{children:i.jsx(Lo,{...o,children:i.jsxs("form",{onSubmit:o.handleSubmit(a),className:"w-full space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("chatwoot.title")}),i.jsx(Ka,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:px-4 [&>*]:py-2",children:[i.jsx(he,{name:"enabled",label:e("chatwoot.form.enabled.label"),className:"w-full justify-between",helper:e("chatwoot.form.enabled.description")}),i.jsx(z,{name:"url",label:e("chatwoot.form.url.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"accountId",label:e("chatwoot.form.accountId.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"token",label:e("chatwoot.form.token.label"),children:i.jsx(L,{type:"password"})}),i.jsx(he,{name:"signMsg",label:e("chatwoot.form.signMsg.label"),className:"w-full justify-between",helper:e("chatwoot.form.signMsg.description")}),i.jsx(z,{name:"signDelimiter",label:e("chatwoot.form.signDelimiter.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"nameInbox",label:e("chatwoot.form.nameInbox.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"organization",label:e("chatwoot.form.organization.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"logo",label:e("chatwoot.form.logo.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"conversationPending",label:e("chatwoot.form.conversationPending.label"),className:"w-full justify-between",helper:e("chatwoot.form.conversationPending.description")}),i.jsx(he,{name:"reopenConversation",label:e("chatwoot.form.reopenConversation.label"),className:"w-full justify-between",helper:e("chatwoot.form.reopenConversation.description")}),i.jsx(he,{name:"importContacts",label:e("chatwoot.form.importContacts.label"),className:"w-full justify-between",helper:e("chatwoot.form.importContacts.description")}),i.jsx(he,{name:"importMessages",label:e("chatwoot.form.importMessages.label"),className:"w-full justify-between",helper:e("chatwoot.form.importMessages.description")}),i.jsx(z,{name:"daysLimitImportMessages",label:e("chatwoot.form.daysLimitImportMessages.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("chatwoot.form.ignoreJids.label"),placeholder:e("chatwoot.form.ignoreJids.placeholder")}),i.jsx(he,{name:"autoCreate",label:e("chatwoot.form.autoCreate.label"),className:"w-full justify-between",helper:e("chatwoot.form.autoCreate.description")})]})]}),i.jsx("div",{className:"mx-4 flex justify-end",children:i.jsx($,{type:"submit",children:e("chatwoot.button.save")})})]})})})}var km={},_D={exports:{}},Bee="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",zee=Bee,Uee=zee;function MD(){}function RD(){}RD.resetWarningCache=MD;var Vee=function(){function e(r,s,o,a,c,u){if(u!==Uee){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:RD,resetWarningCache:MD};return n.PropTypes=n,n};_D.exports=Vee();var PD=_D.exports,OD={L:1,M:0,Q:3,H:2},ID={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Hee=ID;function DD(e){this.mode=Hee.MODE_8BIT_BYTE,this.data=e}DD.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t>>7-e%8&1)==1},put:function(e,t){for(var n=0;n>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Wee=AD,us={glog:function(e){if(e<1)throw new Error("glog("+e+")");return us.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return us.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var _n=0;_n<8;_n++)us.EXP_TABLE[_n]=1<<_n;for(var _n=8;_n<256;_n++)us.EXP_TABLE[_n]=us.EXP_TABLE[_n-4]^us.EXP_TABLE[_n-5]^us.EXP_TABLE[_n-6]^us.EXP_TABLE[_n-8];for(var _n=0;_n<255;_n++)us.LOG_TABLE[us.EXP_TABLE[_n]]=_n;var FD=us,ti=FD;function Jp(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var n=0;n=0;)t^=Tn.G15<=0;)t^=Tn.G18<>>=1;return t},getPatternPosition:function(e){return Tn.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case Qo.PATTERN000:return(t+n)%2==0;case Qo.PATTERN001:return t%2==0;case Qo.PATTERN010:return n%3==0;case Qo.PATTERN011:return(t+n)%3==0;case Qo.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case Qo.PATTERN101:return t*n%2+t*n%3==0;case Qo.PATTERN110:return(t*n%2+t*n%3)%2==0;case Qo.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new lE([1],0),n=0;n5&&(n+=3+o-5)}for(var r=0;r=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Vs.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)};Or.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)};Or.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Za.getLostPoint(this);(n==0||e>r)&&(e=r,t=n)}return t};Or.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n),s=1;this.make();for(var o=0;o>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&(t>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}};Or.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=Za.getBCHTypeInfo(n),s=0;s<15;s++){var o=!e&&(r>>s&1)==1;s<6?this.modules[s][8]=o:s<8?this.modules[s+1][8]=o:this.modules[this.moduleCount-15+s][8]=o}for(var s=0;s<15;s++){var o=!e&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=o:s<9?this.modules[8][15-s-1+1]=o:this.modules[8][15-s-1]=o}this.modules[this.moduleCount-8][8]=!e};Or.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,s=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[r][a-c]==null){var u=!1;o>>s&1)==1);var l=Za.getMask(t,r,a-c);l&&(u=!u),this.modules[r][a-c]=u,s--,s==-1&&(o++,s=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}};Vs.PAD0=236;Vs.PAD1=17;Vs.createData=function(e,t,n){for(var r=$D.getRSBlocks(e,t),s=new BD,o=0;oc*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+c*8+")");for(s.getLengthInBits()+4<=c*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=c*8||(s.put(Vs.PAD0,8),s.getLengthInBits()>=c*8));)s.put(Vs.PAD1,8);return Vs.createBytes(s,r)};Vs.createBytes=function(e,t){for(var n=0,r=0,s=0,o=new Array(t.length),a=new Array(t.length),c=0;c=0?h.get(g):0}}for(var m=0,d=0;d=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var nte={bgColor:Fr.default.oneOfType([Fr.default.object,Fr.default.string]).isRequired,bgD:Fr.default.string.isRequired,fgColor:Fr.default.oneOfType([Fr.default.object,Fr.default.string]).isRequired,fgD:Fr.default.string.isRequired,size:Fr.default.number.isRequired,title:Fr.default.string,viewBoxSize:Fr.default.number.isRequired,xmlns:Fr.default.string},$0=(0,zD.forwardRef)(function(e,t){var n=e.bgColor,r=e.bgD,s=e.fgD,o=e.fgColor,a=e.size,c=e.title,u=e.viewBoxSize,l=e.xmlns,d=l===void 0?"http://www.w3.org/2000/svg":l,p=tte(e,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return pp.default.createElement("svg",Xee({},p,{height:a,ref:t,viewBox:"0 0 "+u+" "+u,width:a,xmlns:d}),c?pp.default.createElement("title",null,c):null,pp.default.createElement("path",{d:r,fill:n}),pp.default.createElement("path",{d:s,fill:o}))});$0.displayName="QRCodeSvg";$0.propTypes=nte;L0.default=$0;Object.defineProperty(km,"__esModule",{value:!0});km.QRCode=void 0;var rte=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var pte={bgColor:ao.default.oneOfType([ao.default.object,ao.default.string]),fgColor:ao.default.oneOfType([ao.default.object,ao.default.string]),level:ao.default.string,size:ao.default.number,value:ao.default.string.isRequired},Em=(0,VD.forwardRef)(function(e,t){var n=e.bgColor,r=n===void 0?"#FFFFFF":n,s=e.fgColor,o=s===void 0?"#000000":s,a=e.level,c=a===void 0?"L":a,u=e.size,l=u===void 0?256:u,d=e.value,p=fte(e,["bgColor","fgColor","level","size","value"]),f=new lte.default(-1,ate.default[c]);f.addData(d),f.make();var h=f.modules;return cte.default.createElement(dte.default,rte({},p,{bgColor:r,bgD:h.map(function(g,m){return g.map(function(x,b){return x?"":"M "+b+" "+m+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:o,fgD:h.map(function(g,m){return g.map(function(x,b){return x?"M "+b+" "+m+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:t,size:l,viewBoxSize:h.length}))});km.QRCode=Em;Em.displayName="QRCode";Em.propTypes=pte;var hte=km.default=Em;const gte=Fg("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7 space-y-1 [&_strong]:text-foreground",{variants:{variant:{default:"border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10 text-zinc-900 dark:text-zinc-300 [&>svg]:text-zinc-400 dark:[&>svg]:text-zinc-300",destructive:"border-red-500/20 bg-red-50/50 dark:border-red-500/30 dark:bg-red-500/10 text-red-900 dark:text-red-200 [&>svg]:text-red-600 dark:[&>svg]:text-red-400/80",warning:"border-amber-500/20 bg-amber-50/50 dark:border-amber-500/30 dark:bg-amber-500/10 text-amber-900 dark:text-amber-200 [&>svg]:text-amber-500",info:"border-sky-500/20 bg-sky-50/50 dark:border-sky-500/30 dark:bg-sky-500/10 text-sky-900 dark:text-sky-200 [&>svg]:text-sky-500",success:"border-emerald-500/20 bg-emerald-50/50 dark:border-emerald-500/30 dark:bg-emerald-500/10 text-emerald-900 dark:text-emerald-200 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400/80"}},defaultVariants:{variant:"default"}}),HD=v.forwardRef(({className:e,variant:t,...n},r)=>i.jsx("div",{ref:r,role:"alert",className:ve(gte({variant:t}),e),...n}));HD.displayName="Alert";const qD=v.forwardRef(({className:e,...t},n)=>i.jsx("h5",{ref:n,className:ve("font-medium leading-none tracking-tight",e),...t}));qD.displayName="AlertTitle";const mte=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ve("text-sm [&_p]:leading-relaxed",e),...t}));mte.displayName="AlertDescription";const un=({size:e=45,className:t,...n})=>i.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ve("animate-spin",t),children:i.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})});function vte(){const{t:e,i18n:t}=Ee(),n=new Intl.NumberFormat(t.language),[r,s]=v.useState(null),[o,a]=v.useState(""),c=Kr(wn.TOKEN),{theme:u}=Mg(),{connect:l,logout:d,restart:p}=em(),{instance:f,reloadInstance:h}=He();v.useEffect(()=>{f&&(localStorage.setItem(wn.INSTANCE_ID,f.id),localStorage.setItem(wn.INSTANCE_NAME,f.name),localStorage.setItem(wn.INSTANCE_TOKEN,f.token))},[f]);const g=async()=>{await h()},m=async k=>{try{await p(k),await h()}catch(C){console.error("Error:",C)}},x=async k=>{try{await d(k),await h()}catch(C){console.error("Error:",C)}},b=async(k,C)=>{try{if(s(null),!c){console.error("Token not found.");return}if(C){const T=await l({instanceName:k,token:c,number:f==null?void 0:f.number});a(T.pairingCode)}else{const T=await l({instanceName:k,token:c});s(T.code)}}catch(T){console.error("Error:",T)}},y=async()=>{s(null),a(""),await h()},w=v.useMemo(()=>{var k,C,T;return f?{contacts:((k=f._count)==null?void 0:k.Contact)||0,chats:((C=f._count)==null?void 0:C.Chat)||0,messages:((T=f._count)==null?void 0:T.Message)||0}:{contacts:0,chats:0,messages:0}},[f]),S=v.useMemo(()=>u==="dark"?"#fff":u==="light"?"#000":"#189d68",[u]);return f?i.jsxs("main",{className:"flex flex-col gap-8",children:[i.jsx("section",{children:i.jsxs(fi,{children:[i.jsx(pi,{children:i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[i.jsx("h2",{className:"break-all text-lg font-semibold",children:f.name}),i.jsx(fP,{status:f.connectionStatus})]})}),i.jsxs(hi,{className:"flex flex-col items-start space-y-6",children:[i.jsx("div",{className:"flex w-full flex-1",children:i.jsx(pP,{token:f.token})}),f.profileName&&i.jsxs("div",{className:"flex flex-1 gap-2",children:[i.jsx(Ui,{children:i.jsx(Vi,{src:f.profilePicUrl,alt:""})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("strong",{children:f.profileName}),i.jsx("p",{className:"break-all text-sm text-muted-foreground",children:f.ownerJid})]})]}),f.connectionStatus!=="open"&&i.jsxs(HD,{variant:"warning",className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsx(qD,{className:"text-lg font-bold tracking-wide",children:e("instance.dashboard.alert")}),i.jsxs(pt,{children:[i.jsx(vt,{onClick:()=>b(f.name,!1),asChild:!0,children:i.jsx($,{variant:"warning",children:e("instance.dashboard.button.qrcode.label")})}),i.jsxs(lt,{onCloseAutoFocus:y,children:[i.jsx(ct,{children:e("instance.dashboard.button.qrcode.title")}),i.jsx("div",{className:"flex items-center justify-center",children:r&&i.jsx(hte,{value:r,size:256,bgColor:"transparent",fgColor:S,className:"rounded-sm"})})]})]}),f.number&&i.jsxs(pt,{children:[i.jsx(vt,{className:"connect-code-button",onClick:()=>b(f.name,!0),children:e("instance.dashboard.button.pairingCode.label")}),i.jsx(lt,{onCloseAutoFocus:y,children:i.jsx(ct,{children:i.jsx(eo,{children:o?i.jsxs("div",{className:"py-3",children:[i.jsx("p",{className:"text-center",children:i.jsx("strong",{children:e("instance.dashboard.button.pairingCode.title")})}),i.jsxs("p",{className:"pairing-code text-center",children:[o.substring(0,4),"-",o.substring(4,8)]})]}):i.jsx(un,{})})})})]})]})]}),i.jsxs(Xg,{className:"flex flex-wrap items-center justify-end gap-3",children:[i.jsx($,{variant:"outline",className:"refresh-button",size:"icon",onClick:g,children:i.jsx(Nh,{size:"20"})}),i.jsx($,{className:"action-button",variant:"secondary",onClick:()=>m(f.name),children:e("instance.dashboard.button.restart").toUpperCase()}),i.jsx($,{variant:"destructive",onClick:()=>x(f.name),disabled:f.connectionStatus==="close",children:e("instance.dashboard.button.disconnect").toUpperCase()})]})]})}),i.jsxs("section",{className:"grid grid-cols-[repeat(auto-fit,_minmax(15rem,_1fr))] gap-6",children:[i.jsxs(fi,{className:"instance-card",children:[i.jsx(pi,{children:i.jsxs(Qu,{className:"flex items-center gap-2",children:[i.jsx(N_,{size:"20"}),e("instance.dashboard.contacts")]})}),i.jsx(hi,{children:n.format(w.contacts)})]}),i.jsxs(fi,{className:"instance-card",children:[i.jsx(pi,{children:i.jsxs(Qu,{className:"flex items-center gap-2",children:[i.jsx(Wz,{size:"20"}),e("instance.dashboard.chats")]})}),i.jsx(hi,{children:n.format(w.chats)})]}),i.jsxs(fi,{className:"instance-card",children:[i.jsx(pi,{children:i.jsxs(Qu,{className:"flex items-center gap-2",children:[i.jsx(Cc,{size:"20"}),e("instance.dashboard.messages")]})}),i.jsx(hi,{children:n.format(w.messages)})]})]})]}):i.jsx(un,{})}var yte="Separator",cE="horizontal",bte=["horizontal","vertical"],KD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=cE,...s}=e,o=xte(r)?r:cE,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(Fe.div,{"data-orientation":o,...c,...s,ref:t})});KD.displayName=yte;function xte(e){return bte.includes(e)}var WD=KD;const mt=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>i.jsx(WD,{ref:s,decorative:n,orientation:t,className:ve("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));mt.displayName=WD.displayName;const wte=e=>["dify","fetchDify",JSON.stringify(e)],Ste=async({instanceName:e,token:t})=>(await le.get(`/dify/find/${e}`,{headers:{apikey:t}})).data,GD=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:wte({instanceName:t,token:n}),queryFn:()=>Ste({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Cte=async({instanceName:e,token:t,data:n})=>(await le.post(`/dify/create/${e}`,n,{headers:{apikey:t}})).data,kte=async({instanceName:e,difyId:t,data:n})=>(await le.put(`/dify/update/${t}/${e}`,n)).data,Ete=async({instanceName:e,difyId:t})=>(await le.delete(`/dify/delete/${t}/${e}`)).data,jte=async({instanceName:e,token:t,data:n})=>(await le.post(`/dify/settings/${e}`,n,{headers:{apikey:t}})).data,Tte=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/dify/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function jm(){const e=Ae(jte,{invalidateKeys:[["dify","fetchDefaultSettings"]]}),t=Ae(Tte,{invalidateKeys:[["dify","getDify"],["dify","fetchSessions"]]}),n=Ae(Ete,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),r=Ae(kte,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),s=Ae(Cte,{invalidateKeys:[["dify","fetchDify"]]});return{setDefaultSettingsDify:e,changeStatusDify:t,deleteDify:n,updateDify:r,createDify:s}}const Nte=e=>["dify","fetchDefaultSettings",JSON.stringify(e)],_te=async({instanceName:e,token:t})=>(await le.get(`/dify/fetchSettings/${e}`,{headers:{apikey:t}})).data,Mte=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Nte({instanceName:t,token:n}),queryFn:()=>_te({instanceName:t,token:n}),enabled:!!t})},Rte=j.object({expire:j.string(),keywordFinish:j.string(),delayMessage:j.string(),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.string(),ignoreJids:j.array(j.string()).default([]),difyIdFallback:j.union([j.null(),j.string()]).optional(),splitMessages:j.boolean(),timePerChar:j.string()});function Pte(){const{t:e}=Ee(),{instance:t}=He(),{setDefaultSettingsDify:n}=jm(),[r,s]=v.useState(!1),{data:o,refetch:a}=GD({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=Mte({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),l=$t({resolver:Bt(Rte),defaultValues:{expire:"0",keywordFinish:e("dify.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("dify.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],difyIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&l.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,difyIdFallback:c.difyIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var h,g,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),difyIdFallback:f.difyIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),Z.success(e("dify.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),Z.error(`Error: ${(m=(g=(h=x==null?void 0:x.response)==null?void 0:h.data)==null?void 0:g.response)==null?void 0:m.message}`)}};function p(){u(),a()}return i.jsxs(pt,{open:r,onOpenChange:s,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("dify.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("dify.defaultSettings")})}),i.jsx(Pn,{...l,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:l.handleSubmit(d),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"difyIdFallback",label:e("dify.form.difyIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),i.jsx(z,{name:"expire",label:e("dify.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("dify.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("dify.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("dify.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("dify.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("dify.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("dify.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("dify.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:e("dify.form.splitMessages.label"),reverse:!0}),i.jsx(z,{name:"timePerChar",label:e("dify.form.timePerChar.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("dify.form.ignoreJids.label"),placeholder:e("dify.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("dify.button.save")})})]})})]})]})}/** + * table-core + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function va(e,t){return typeof e=="function"?e(t):e}function Nr(e,t){return n=>{t.setState(r=>({...r,[e]:va(n,r[e])}))}}function Tm(e){return e instanceof Function}function Ote(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function JD(e,t){const n=[],r=s=>{s.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function $e(e,t,n){let r=[],s;return o=>{let a;n.key&&n.debug&&(a=Date.now());const c=e(o);if(!(c.length!==r.length||c.some((d,p)=>r[p]!==d)))return s;r=c;let l;if(n.key&&n.debug&&(l=Date.now()),s=t(...c),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-a)*100)/100,p=Math.round((Date.now()-l)*100)/100,f=p/16,h=(g,m)=>{for(g=String(g);g.length{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function Ite(e,t,n,r){const s=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:$e(()=>[e,n,t,o],(a,c,u,l)=>({table:a,column:c,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Be(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function Dte(e,t,n,r){var s,o;const c={...e._getDefaultColumnDef(),...t},u=c.accessorKey;let l=(s=(o=c.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?s:typeof c.header=="string"?c.header:void 0,d;if(c.accessorFn?d=c.accessorFn:u&&(u.includes(".")?d=f=>{let h=f;for(const m of u.split(".")){var g;h=(g=h)==null?void 0:g[m]}return h}:d=f=>f[c.accessorKey]),!l)throw new Error;let p={id:`${String(l)}`,accessorFn:d,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:$e(()=>[!0],()=>{var f;return[p,...(f=p.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Be(e.options,"debugColumns")),getLeafColumns:$e(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=p.columns)!=null&&h.length){let g=p.columns.flatMap(m=>m.getLeafColumns());return f(g)}return[p]},Be(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(p,e);return p}const Ln="debugHeaders";function uE(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(c),a.push(u)};return c(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const Ate={createTable:e=>{e.getHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var o,a;const c=(o=r==null?void 0:r.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?o:[],u=(a=s==null?void 0:s.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?a:[],l=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(s!=null&&s.includes(p.id)));return hp(t,[...c,...l,...u],e)},Be(e.options,Ln)),e.getCenterHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(s!=null&&s.includes(o.id))),hp(t,n,e,"center")),Be(e.options,Ln)),e.getLeftHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const o=(s=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?s:[];return hp(t,o,e,"left")},Be(e.options,Ln)),e.getRightHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const o=(s=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?s:[];return hp(t,o,e,"right")},Be(e.options,Ln)),e.getFooterGroups=$e(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Be(e.options,Ln)),e.getLeftFooterGroups=$e(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Be(e.options,Ln)),e.getCenterFooterGroups=$e(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Be(e.options,Ln)),e.getRightFooterGroups=$e(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Be(e.options,Ln)),e.getFlatHeaders=$e(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Be(e.options,Ln)),e.getLeftFlatHeaders=$e(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Be(e.options,Ln)),e.getCenterFlatHeaders=$e(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Be(e.options,Ln)),e.getRightFlatHeaders=$e(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Be(e.options,Ln)),e.getCenterLeafHeaders=$e(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Be(e.options,Ln)),e.getLeftLeafHeaders=$e(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Be(e.options,Ln)),e.getRightLeafHeaders=$e(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Be(e.options,Ln)),e.getLeafHeaders=$e(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,o,a,c,u,l;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(d=>d.getLeafHeaders()).flat()},Be(e.options,Ln))}};function hp(e,t,n,r){var s,o;let a=0;const c=function(f,h){h===void 0&&(h=1),a=Math.max(a,h),f.filter(g=>g.getIsVisible()).forEach(g=>{var m;(m=g.columns)!=null&&m.length&&c(g.columns,h+1)},0)};c(e);let u=[];const l=(f,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(x=>{const b=[...m].reverse()[0],y=x.column.depth===g.depth;let w,S=!1;if(y&&x.column.parent?w=x.column.parent:(w=x.column,S=!0),b&&(b==null?void 0:b.column)===w)b.subHeaders.push(x);else{const k=uE(n,w,{id:[r,h,w.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(C=>C.column===w).length}`:void 0,depth:h,index:m.length});k.subHeaders.push(x),m.push(k)}g.headers.push(x),x.headerGroup=g}),u.push(g),h>0&&l(m,h-1)},d=t.map((f,h)=>uE(n,f,{depth:a,index:h}));l(d,a-1),u.reverse();const p=f=>f.filter(g=>g.column.getIsVisible()).map(g=>{let m=0,x=0,b=[0];g.subHeaders&&g.subHeaders.length?(b=[],p(g.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:k}=w;m+=S,b.push(k)})):m=1;const y=Math.min(...b);return x=x+y,g.colSpan=m,g.rowSpan=x,{colSpan:m,rowSpan:x}});return p((s=(o=u[0])==null?void 0:o.headers)!=null?s:[]),u}const Nm=(e,t,n,r,s,o,a)=>{let c={id:t,index:r,original:n,depth:s,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(c._valuesCache.hasOwnProperty(u))return c._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return c._valuesCache[u]=l.accessorFn(c.original,r),c._valuesCache[u]},getUniqueValues:u=>{if(c._uniqueValuesCache.hasOwnProperty(u))return c._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(c._uniqueValuesCache[u]=l.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[u]):(c._uniqueValuesCache[u]=[c.getValue(u)],c._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=c.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>JD(c.subRows,u=>u.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let u=[],l=c;for(;;){const d=l.getParentRow();if(!d)break;u.push(d),l=d}return u.reverse()},getAllCells:$e(()=>[e.getAllLeafColumns()],u=>u.map(l=>Ite(e,c,l,l.id)),Be(e.options,"debugRows")),_getAllCellsByColumnId:$e(()=>[c.getAllCells()],u=>u.reduce((l,d)=>(l[d.column.id]=d,l),{}),Be(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},QD=(e,t,n)=>{var r;const s=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};QD.autoRemove=e=>ys(e);const ZD=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ZD.autoRemove=e=>ys(e);const YD=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};YD.autoRemove=e=>ys(e);const XD=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};XD.autoRemove=e=>ys(e)||!(e!=null&&e.length);const eA=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});eA.autoRemove=e=>ys(e)||!(e!=null&&e.length);const tA=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});tA.autoRemove=e=>ys(e)||!(e!=null&&e.length);const nA=(e,t,n)=>e.getValue(t)===n;nA.autoRemove=e=>ys(e);const rA=(e,t,n)=>e.getValue(t)==n;rA.autoRemove=e=>ys(e);const B0=(e,t,n)=>{let[r,s]=n;const o=e.getValue(t);return o>=r&&o<=s};B0.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(s)?1/0:s;if(o>a){const c=o;o=a,a=c}return[o,a]};B0.autoRemove=e=>ys(e)||ys(e[0])&&ys(e[1]);const fo={includesString:QD,includesStringSensitive:ZD,equalsString:YD,arrIncludes:XD,arrIncludesAll:eA,arrIncludesSome:tA,equals:nA,weakEquals:rA,inNumberRange:B0};function ys(e){return e==null||e===""}const Lte={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Nr("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?fo.includesString:typeof r=="number"?fo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?fo.equals:Array.isArray(r)?fo.arrIncludes:fo.weakEquals},e.getFilterFn=()=>{var n,r;return Tm(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:fo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),o=r==null?void 0:r.find(d=>d.id===e.id),a=va(n,o?o.value:void 0);if(dE(s,a,e)){var c;return(c=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?c:[]}const u={id:e.id,value:a};if(o){var l;return(l=r==null?void 0:r.map(d=>d.id===e.id?u:d))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var o;return(o=va(t,s))==null?void 0:o.filter(a=>{const c=n.find(u=>u.id===a.id);if(c){const u=c.getFilterFn();if(dE(u,a.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const $te=(e,t,n)=>n.reduce((r,s)=>{const o=s.getValue(e);return r+(typeof o=="number"?o:0)},0),Bte=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},zte=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r=o)&&(r=o)}),r},Ute=(e,t,n)=>{let r,s;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=s=a):(r>a&&(r=a),s{let n=0,r=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},Hte=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!Ote(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((o,a)=>o-a);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},qte=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Kte=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Wte=(e,t)=>t.length,Yv={sum:$te,min:Bte,max:zte,extent:Ute,mean:Vte,median:Hte,unique:qte,uniqueCount:Kte,count:Wte},Gte={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Nr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Yv.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Yv.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Tm(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Yv[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function Jte(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const Qte={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Nr("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=$e(n=>[nd(t,n)],n=>n.findIndex(r=>r.id===e.id),Be(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=nd(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=nd(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=$e(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const a=[...t],c=[...s];for(;c.length&&a.length;){const u=a.shift(),l=c.findIndex(d=>d.id===u);l>-1&&o.push(c.splice(l,1)[0])}o=[...o,...c]}return Jte(o,n,r)},Be(e.options,"debugTable"))}},Xv=()=>({left:[],right:[]}),Zte={getInitialState:e=>({columnPinning:Xv(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Nr("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,a;if(n==="right"){var c,u;return{left:((c=s==null?void 0:s.left)!=null?c:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((u=s==null?void 0:s.right)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var l,d;return{left:[...((l=s==null?void 0:s.left)!=null?l:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((d=s==null?void 0:s.right)!=null?d:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((o=s==null?void 0:s.left)!=null?o:[]).filter(p=>!(r!=null&&r.includes(p))),right:((a=s==null?void 0:s.right)!=null?a:[]).filter(p=>!(r!=null&&r.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,o,a;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(c=>c.id),{left:r,right:s}=t.getState().columnPinning,o=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>s==null?void 0:s.includes(c));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=$e(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const o=[...r??[],...s??[]];return n.filter(a=>!o.includes(a.column.id))},Be(t.options,"debugRows")),e.getLeftVisibleCells=$e(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Be(t.options,"debugRows")),e.getRightVisibleCells=$e(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Be(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Xv():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Xv())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,o;return!!((s=r.left)!=null&&s.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=$e(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Be(e.options,"debugColumns")),e.getRightLeafColumns=$e(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Be(e.options,"debugColumns")),e.getCenterLeafColumns=$e(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(o=>!s.includes(o.id))},Be(e.options,"debugColumns"))}},gp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ey=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Yte={getDefaultColumnDef:()=>gp,getInitialState:e=>({columnSizing:{},columnSizingInfo:ey(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Nr("columnSizing",e),onColumnSizingInfoChange:Nr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:gp.minSize,(r=o??e.columnDef.size)!=null?r:gp.size),(s=e.columnDef.maxSize)!=null?s:gp.maxSize)},e.getStart=$e(n=>[n,nd(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,o)=>s+o.getSize(),0),Be(t.options,"debugColumns")),e.getAfter=$e(n=>[n,nd(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,o)=>s+o.getSize(),0),Be(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return o=>{if(!r||!s||(o.persist==null||o.persist(),ty(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),c=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[r.id,r.getSize()]],u=ty(o)?Math.round(o.touches[0].clientX):o.clientX,l={},d=(b,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(w=>{var S,k;const C=t.options.columnResizeDirection==="rtl"?-1:1,T=(y-((S=w==null?void 0:w.startOffset)!=null?S:0))*C,E=Math.max(T/((k=w==null?void 0:w.startSize)!=null?k:0),-.999999);return w.columnSizingStart.forEach(N=>{let[P,q]=N;l[P]=Math.round(Math.max(q+q*E,0)*100)/100}),{...w,deltaOffset:T,deltaPercentage:E}}),(t.options.columnResizeMode==="onChange"||b==="end")&&t.setColumnSizing(w=>({...w,...l})))},p=b=>d("move",b),f=b=>{d("end",b),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,g={moveHandler:b=>p(b.clientX),upHandler:b=>{h==null||h.removeEventListener("mousemove",g.moveHandler),h==null||h.removeEventListener("mouseup",g.upHandler),f(b.clientX)}},m={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),p(b.touches[0].clientX),!1),upHandler:b=>{var y;h==null||h.removeEventListener("touchmove",m.moveHandler),h==null||h.removeEventListener("touchend",m.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),f((y=b.touches[0])==null?void 0:y.clientX)}},x=Xte()?{passive:!1}:!1;ty(o)?(h==null||h.addEventListener("touchmove",m.moveHandler,x),h==null||h.addEventListener("touchend",m.upHandler,x)):(h==null||h.addEventListener("mousemove",g.moveHandler,x),h==null||h.addEventListener("mouseup",g.upHandler,x)),t.setColumnSizingInfo(b=>({...b,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ey():(n=e.initialState.columnSizingInfo)!=null?n:ey())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let mp=null;function Xte(){if(typeof mp=="boolean")return mp;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return mp=e,mp}function ty(e){return e.type==="touchstart"}const ene={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Nr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=$e(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Be(t.options,"debugRows")),e.getVisibleCells=$e(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Be(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>$e(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Be(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function nd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const tne={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},nne={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Nr("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>fo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Tm(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:fo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},rne={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Nr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,o;e.setExpanded(r?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(s=n)!=null?s:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:c,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},dx=0,fx=10,ny=()=>({pageIndex:dx,pageSize:fx}),sne={getInitialState:e=>({...e,pagination:{...ny(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Nr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=o=>va(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?ny():(s=e.initialState.pagination)!=null?s:ny())},e.setPageIndex=r=>{e.setPagination(s=>{let o=va(r,s.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...s,pageIndex:o}})},e.resetPageIndex=r=>{var s,o;e.setPageIndex(r?dx:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?s:dx)},e.resetPageSize=r=>{var s,o;e.setPageSize(r?fx:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?s:fx)},e.setPageSize=r=>{e.setPagination(s=>{const o=Math.max(1,va(r,s.pageSize)),a=s.pageSize*s.pageIndex,c=Math.floor(a/o);return{...s,pageIndex:c,pageSize:o}})},e.setPageCount=r=>e.setPagination(s=>{var o;let a=va(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...s,pageCount:a}}),e.getPageOptions=$e(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((o,a)=>a)),s},Be(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},ry=()=>({top:[],bottom:[]}),one={getInitialState:e=>({rowPinning:ry(),...e}),getDefaultOptions:e=>({onRowPinningChange:Nr("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const o=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],a=s?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],c=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var l,d;if(n==="bottom"){var p,f;return{top:((p=u==null?void 0:u.top)!=null?p:[]).filter(m=>!(c!=null&&c.has(m))),bottom:[...((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(c!=null&&c.has(m))),...Array.from(c)]}}if(n==="top"){var h,g;return{top:[...((h=u==null?void 0:u.top)!=null?h:[]).filter(m=>!(c!=null&&c.has(m))),...Array.from(c)],bottom:((g=u==null?void 0:u.bottom)!=null?g:[]).filter(m=>!(c!=null&&c.has(m)))}}return{top:((l=u==null?void 0:u.top)!=null?l:[]).filter(m=>!(c!=null&&c.has(m))),bottom:((d=u==null?void 0:u.bottom)!=null?d:[]).filter(m=>!(c!=null&&c.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,o=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>s==null?void 0:s.includes(c));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const o=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?ry():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:ry())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,o;return!!((s=r.top)!=null&&s.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(a=>{const c=e.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>t.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=$e(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Be(e.options,"debugRows")),e.getBottomRows=$e(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Be(e.options,"debugRows")),e.getCenterRows=$e(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(o=>!s.has(o.id))},Be(e.options,"debugRows"))}},ane={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Nr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):s.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{px(s,o.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=$e(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?sy(e,n):{rows:[],flatRows:[],rowsById:{}},Be(e.options,"debugTable")),e.getFilteredSelectedRowModel=$e(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?sy(e,n):{rows:[],flatRows:[],rowsById:{}},Be(e.options,"debugTable")),e.getGroupedSelectedRowModel=$e(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?sy(e,n):{rows:[],flatRows:[],rowsById:{}},Be(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return o;const c={...o};return px(c,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return z0(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return hx(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return hx(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},px=(e,t,n,r,s)=>{var o;const a=s.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>px(e,c.id,n,r,s))};function sy(e,t){const n=e.getState().rowSelection,r=[],s={},o=function(a,c){return a.map(u=>{var l;const d=z0(u,n);if(d&&(r.push(u),s[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:o(u.subRows)}),d)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:s}}function z0(e,t){var n;return(n=t[e.id])!=null?n:!1}function hx(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!s)&&(a.getCanSelect()&&(z0(a,t)?o=!0:s=!1),a.subRows&&a.subRows.length)){const c=hx(a,t);c==="all"?o=!0:(c==="some"&&(o=!0),s=!1)}}),s?"all":o?"some":!1}const gx=/([0-9]+)/gm,ine=(e,t,n)=>sA(La(e.getValue(n)).toLowerCase(),La(t.getValue(n)).toLowerCase()),lne=(e,t,n)=>sA(La(e.getValue(n)),La(t.getValue(n))),cne=(e,t,n)=>U0(La(e.getValue(n)).toLowerCase(),La(t.getValue(n)).toLowerCase()),une=(e,t,n)=>U0(La(e.getValue(n)),La(t.getValue(n))),dne=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:rU0(e.getValue(n),t.getValue(n));function U0(e,t){return e===t?0:e>t?1:-1}function La(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function sA(e,t){const n=e.split(gx).filter(Boolean),r=t.split(gx).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),o=r.shift(),a=parseInt(s,10),c=parseInt(o,10),u=[a,c].sort();if(isNaN(u[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const ku={alphanumeric:ine,alphanumericCaseSensitive:lne,text:cne,textCaseSensitive:une,datetime:dne,basic:fne},pne={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Nr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return ku.datetime;if(typeof o=="string"&&(r=!0,o.split(gx).length>1))return ku.alphanumeric}return r?ku.text:ku.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Tm(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ku[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const c=a==null?void 0:a.find(h=>h.id===e.id),u=a==null?void 0:a.findIndex(h=>h.id===e.id);let l=[],d,p=o?n:s==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?c?d="toggle":d="add":a!=null&&a.length&&u!==a.length-1?d="replace":c?d="toggle":d="replace",d==="toggle"&&(o||s||(d="remove")),d==="add"){var f;l=[...a,{id:e.id,desc:p}],l.splice(0,l.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?l=a.map(h=>h.id===e.id?{...h,desc:p}:h):d==="remove"?l=a.filter(h=>h.id!==e.id):l=[{id:e.id,desc:p}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},hne=[Ate,ene,Qte,Zte,Fte,Lte,tne,nne,pne,Gte,rne,sne,one,ane,Yte];function gne(e){var t,n;const r=[...hne,...(t=e._features)!=null?t:[]];let s={_features:r};const o=s._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(s)),{}),a=f=>s.options.mergeOptions?s.options.mergeOptions(o,f):{...o,...f};let u={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(f=>{var h;u=(h=f.getInitialState==null?void 0:f.getInitialState(u))!=null?h:u});const l=[];let d=!1;const p={_features:r,options:{...o,...e},initialState:u,_queue:f=>{l.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();d=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const h=va(f,s.options);s.options=a(h)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,h,g)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(f,h,g))!=null?m:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,h)=>{let g=(h?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!g&&(g=s.getCoreRowModel().rowsById[f],!g))throw new Error;return g},_getDefaultColumnDef:$e(()=>[s.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:g=>{const m=g.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:g=>{var m,x;return(m=(x=g.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...s._features.reduce((g,m)=>Object.assign(g,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Be(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:$e(()=>[s._getColumnDefs()],f=>{const h=function(g,m,x){return x===void 0&&(x=0),g.map(b=>{const y=Dte(s,b,x,m),w=b;return y.columns=w.columns?h(w.columns,y,x+1):[],y})};return h(f)},Be(e,"debugColumns")),getAllFlatColumns:$e(()=>[s.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Be(e,"debugColumns")),_getAllFlatColumnsById:$e(()=>[s.getAllFlatColumns()],f=>f.reduce((h,g)=>(h[g.id]=g,h),{}),Be(e,"debugColumns")),getAllLeafColumns:$e(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,h)=>{let g=f.flatMap(m=>m.getLeafColumns());return h(g)},Be(e,"debugColumns")),getColumn:f=>s._getAllFlatColumnsById()[f]};Object.assign(s,p);for(let f=0;f$e(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,o,a){o===void 0&&(o=0);const c=[];for(let l=0;le._autoResetPageIndex()))}function vne(e,t,n){return n.options.filterFromLeafRows?yne(e,t,n):bne(e,t,n)}function yne(e,t,n){var r;const s=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(u,l){l===void 0&&(l=0);const d=[];for(let f=0;f$e(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f{var h;const g=e.getColumn(f.id);if(!g)return;const m=g.getFilterFn();m&&s.push({id:f.id,filterFn:m,resolvedValue:(h=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?h:f.value})});const a=(n??[]).map(f=>f.id),c=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&c&&u.length&&(a.push("__global__"),u.forEach(f=>{var h;o.push({id:f.id,filterFn:c,resolvedValue:(h=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?h:r})}));let l,d;for(let f=0;f{h.columnFiltersMeta[m]=x})}if(o.length){for(let g=0;g{h.columnFiltersMeta[m]=x})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const p=f=>{for(let h=0;he._autoResetPageIndex()))}function wne(){return e=>$e(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach(u=>{u.depth=0,u.parentId=void 0}),n;const r=t.filter(u=>e.getColumn(u)),s=[],o={},a=function(u,l,d){if(l===void 0&&(l=0),l>=r.length)return u.map(g=>(g.depth=l,s.push(g),o[g.id]=g,g.subRows&&(g.subRows=a(g.subRows,l+1,g.id)),g));const p=r[l],f=Sne(u,p);return Array.from(f.entries()).map((g,m)=>{let[x,b]=g,y=`${p}:${x}`;y=d?`${d}>${y}`:y;const w=a(b,l+1,y);w.forEach(C=>{C.parentId=y});const S=l?JD(b,C=>C.subRows):b,k=Nm(e,y,S[0].original,m,l,void 0,d);return Object.assign(k,{groupingColumnId:p,groupingValue:x,subRows:w,leafRows:S,getValue:C=>{if(r.includes(C)){if(k._valuesCache.hasOwnProperty(C))return k._valuesCache[C];if(b[0]){var T;k._valuesCache[C]=(T=b[0].getValue(C))!=null?T:void 0}return k._valuesCache[C]}if(k._groupingValuesCache.hasOwnProperty(C))return k._groupingValuesCache[C];const E=e.getColumn(C),N=E==null?void 0:E.getAggregationFn();if(N)return k._groupingValuesCache[C]=N(C,S,b),k._groupingValuesCache[C]}}),w.forEach(C=>{s.push(C),o[C.id]=C}),k})},c=a(n.rows,0);return c.forEach(u=>{s.push(u),o[u.id]=u}),{rows:c,flatRows:s,rowsById:o}},Be(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function Sne(e,t){const n=new Map;return e.reduce((r,s)=>{const o=`${s.getGroupingValue(t)}`,a=r.get(o);return a?a.push(s):r.set(o,[s]),r},n)}function Cne(){return e=>$e(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],o=r.filter(u=>{var l;return(l=e.getColumn(u.id))==null?void 0:l.getCanSort()}),a={};o.forEach(u=>{const l=e.getColumn(u.id);l&&(a[u.id]={sortUndefined:l.columnDef.sortUndefined,invertSorting:l.columnDef.invertSorting,sortingFn:l.getSortingFn()})});const c=u=>{const l=u.map(d=>({...d}));return l.sort((d,p)=>{for(let h=0;h{var p;s.push(d),(p=d.subRows)!=null&&p.length&&(d.subRows=c(d.subRows))}),l};return{rows:c(n.rows),flatRows:s,rowsById:n.rowsById}},Be(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** + * react-table + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function fE(e,t){return e?kne(e)?v.createElement(e,t):e:null}function kne(e){return Ene(e)||typeof e=="function"||jne(e)}function Ene(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function jne(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Tne(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:gne(t)})),[r,s]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{s(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const oA=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:n,className:ve("w-full caption-bottom text-sm",e),...t})}));oA.displayName="Table";const aA=v.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:ve("[&_tr]:border-b",e),...t}));aA.displayName="TableHeader";const iA=v.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:ve("[&_tr:last-child]:border-0",e),...t}));iA.displayName="TableBody";const Nne=v.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:ve("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Nne.displayName="TableFooter";const $u=v.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:ve("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));$u.displayName="TableRow";const lA=v.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:ve("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));lA.displayName="TableHead";const Qp=v.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:ve("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Qp.displayName="TableCell";const _ne=v.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:ve("mt-4 text-sm text-muted-foreground",e),...t}));_ne.displayName="TableCaption";function Ya({columns:e,data:t,isLoading:n,loadingMessage:r,noResultsMessage:s,enableHeaders:o=!0,className:a,highlightedRows:c,...u}){var d;const l=Tne({...u,data:t,columns:e,getCoreRowModel:mne(),getFilteredRowModel:xne(),getGroupedRowModel:wne(),getSortedRowModel:Cne()});return i.jsx("div",{className:ve("rounded-md border",a),children:i.jsxs(oA,{children:[o&&i.jsx(aA,{children:l.getHeaderGroups().map(p=>i.jsx($u,{children:p.headers.map(f=>i.jsx(lA,{children:f.isPlaceholder?null:fE(f.column.columnDef.header,f.getContext())},f.id))},p.id))}),i.jsx(iA,{children:n?i.jsx($u,{children:i.jsx(Qp,{colSpan:e.length,className:"h-24 text-center text-muted-foreground",children:r??"Carregando..."})}):i.jsx(i.Fragment,{children:(d=l.getRowModel().rows)!=null&&d.length?l.getRowModel().rows.map(p=>i.jsx($u,{"data-state":p.getIsSelected()?"selected":c!=null&&c.includes(p.id)?"highlighted":"",children:p.getVisibleCells().map(f=>i.jsx(Qp,{children:fE(f.column.columnDef.cell,f.getContext())},f.id))},p.id)):i.jsx($u,{children:i.jsx(Qp,{colSpan:e.length,className:"h-24 text-center",children:s??"Nenhum resultado encontrado!"})})})})]})})}const Mne=e=>["dify","fetchSessions",JSON.stringify(e)],Rne=async({difyId:e,instanceName:t})=>(await le.get(`/dify/fetchSessions/${e}/${t}`)).data,Pne=e=>{const{difyId:t,instanceName:n,...r}=e;return We({...r,queryKey:Mne({difyId:t,instanceName:n}),queryFn:()=>Rne({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function cA({difyId:e}){const{t}=Ee(),{instance:n}=He(),{changeStatusDify:r}=jm(),[s,o]=v.useState([]),{data:a,refetch:c}=Pne({difyId:e,instanceName:n==null?void 0:n.name}),[u,l]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("dify.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("dify.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:t("dify.sessions.table.actions.title")}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:u,onOpenChange:l,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("dify.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("dify.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("dify.sessions.search"),value:d,onChange:m=>p(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{})})]}),i.jsx(Ya,{columns:g,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("dify.sessions.table.none")})]})]})]})}const One=j.object({enabled:j.boolean(),description:j.string(),botType:j.string(),apiUrl:j.string(),apiKey:j.string(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function uA({initialData:e,onSubmit:t,handleDelete:n,difyId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Ee(),l=$t({resolver:Bt(One),defaultValues:e||{enabled:!0,description:"",botType:"chatBot",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=l.watch("triggerType");return i.jsx(Pn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:u("dify.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:u("dify.form.description.label"),required:!0,children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.difySettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"botType",label:u("dify.form.botType.label"),options:[{label:u("dify.form.botType.chatBot"),value:"chatBot"},{label:u("dify.form.botType.textGenerator"),value:"textGenerator"},{label:u("dify.form.botType.agent"),value:"agent"},{label:u("dify.form.botType.workflow"),value:"workflow"}]}),i.jsx(z,{name:"apiUrl",label:u("dify.form.apiUrl.label"),required:!0,children:i.jsx(L,{})}),i.jsx(z,{name:"apiKey",label:u("dify.form.apiKey.label"),required:!0,children:i.jsx(L,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:u("dify.form.triggerType.label"),options:[{label:u("dify.form.triggerType.keyword"),value:"keyword"},{label:u("dify.form.triggerType.all"),value:"all"},{label:u("dify.form.triggerType.advanced"),value:"advanced"},{label:u("dify.form.triggerType.none"),value:"none"}]}),d==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:u("dify.form.triggerOperator.label"),options:[{label:u("dify.form.triggerOperator.contains"),value:"contains"},{label:u("dify.form.triggerOperator.equals"),value:"equals"},{label:u("dify.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("dify.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("dify.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:u("dify.form.triggerValue.label"),children:i.jsx(L,{})})]}),d==="advanced"&&i.jsx(z,{name:"triggerValue",label:u("dify.form.triggerConditions.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:u("dify.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:u("dify.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:u("dify.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:u("dify.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:u("dify.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:u("dify.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:u("dify.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:u("dify.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:u("dify.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:u("dify.form.timePerChar.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:u(o?"dify.button.saving":"dify.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(cA,{difyId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:u("modal.delete.title")}),i.jsx(eo,{children:u("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:u(o?"dify.button.saving":"dify.button.update")})]})]})]})})}function Ine({resetTable:e}){const{t}=Ee(),{instance:n}=He(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createDify:c}=jm(),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:l.enabled,description:l.description,botType:l.botType,apiUrl:l.apiUrl,apiKey:l.apiKey,triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0,splitMessages:l.splitMessages||!1,timePerChar:l.timePerChar||0};await c({instanceName:n.name,token:n.token,data:h}),Z.success(t("dify.toast.success.create")),a(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return i.jsxs(pt,{open:o,onOpenChange:a,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("dify.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("dify.form.title")})}),i.jsx(uA,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const Dne=e=>["dify","getDify",JSON.stringify(e)],Ane=async({difyId:e,instanceName:t})=>(await le.get(`/dify/fetch/${e}/${t}`)).data,Fne=e=>{const{difyId:t,instanceName:n,...r}=e;return We({...r,queryKey:Dne({difyId:t,instanceName:n}),queryFn:()=>Ane({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Lne({difyId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteDify:c,updateDify:u}=jm(),{data:l,isLoading:d}=Fne({difyId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(l!=null&&l.enabled),description:(l==null?void 0:l.description)??"",botType:(l==null?void 0:l.botType)??"",apiUrl:(l==null?void 0:l.apiUrl)??"",apiKey:(l==null?void 0:l.apiKey)??"",triggerType:(l==null?void 0:l.triggerType)??"",triggerOperator:(l==null?void 0:l.triggerOperator)??"",triggerValue:(l==null?void 0:l.triggerValue)??"",expire:(l==null?void 0:l.expire)??0,keywordFinish:(l==null?void 0:l.keywordFinish)??"",delayMessage:(l==null?void 0:l.delayMessage)??0,unknownMessage:(l==null?void 0:l.unknownMessage)??"",listeningFromMe:!!(l!=null&&l.listeningFromMe),stopBotFromMe:!!(l!=null&&l.stopBotFromMe),keepOpen:!!(l!=null&&l.keepOpen),debounceTime:(l==null?void 0:l.debounceTime)??0,splitMessages:(l==null?void 0:l.splitMessages)??!1,timePerChar:(l==null?void 0:l.timePerChar)??0}),[l==null?void 0:l.apiKey,l==null?void 0:l.apiUrl,l==null?void 0:l.botType,l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.unknownMessage,l==null?void 0:l.splitMessages,l==null?void 0:l.timePerChar]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,botType:g.botType,apiUrl:g.apiUrl,apiKey:g.apiKey,triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0,splitMessages:g.splitMessages||!1,timePerChar:g.timePerChar||0};await u({instanceName:r.name,difyId:e,data:y}),Z.success(n("dify.toast.success.update")),t(),s(`/manager/instance/${r.id}/dify/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,difyId:e}),Z.success(n("dify.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/dify`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir dify:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(uA,{initialData:p,onSubmit:f,difyId:e,handleDelete:h,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function pE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{difyId:r}=Zr(),{data:s,refetch:o,isLoading:a}=GD({instanceName:n==null?void 0:n.name}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/dify/${d}`)},l=()=>{o()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("dify.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(cA,{}),i.jsx(Pte,{}),i.jsx(Ine,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:a?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsxs($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:[i.jsx("h4",{className:"text-base",children:d.description||d.id}),i.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:d.botType})]},d.id)):i.jsx($,{variant:"link",children:e("dify.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-border"}),i.jsx(Cn,{children:i.jsx(Lne,{difyId:r,resetTable:l})})]})]})]})}const $ne=e=>["evoai","fetchEvoai",JSON.stringify(e)],Bne=async({instanceName:e,token:t})=>(await le.get(`/evoai/find/${e}`,{headers:{apikey:t}})).data,dA=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:$ne({instanceName:t,token:n}),queryFn:()=>Bne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},zne=async({instanceName:e,token:t,data:n})=>(await le.post(`/evoai/create/${e}`,n,{headers:{apikey:t}})).data,Une=async({instanceName:e,evoaiId:t,data:n})=>(await le.put(`/evoai/update/${t}/${e}`,n)).data,Vne=async({instanceName:e,evoaiId:t})=>(await le.delete(`/evoai/delete/${t}/${e}`)).data,Hne=async({instanceName:e,token:t,data:n})=>(await le.post(`/evoai/settings/${e}`,n,{headers:{apikey:t}})).data,qne=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/evoai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function _m(){const e=Ae(Hne,{invalidateKeys:[["evoai","fetchDefaultSettings"]]}),t=Ae(qne,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchSessions"]]}),n=Ae(Vne,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),r=Ae(Une,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),s=Ae(zne,{invalidateKeys:[["evoai","fetchEvoai"]]});return{setDefaultSettingsEvoai:e,changeStatusEvoai:t,deleteEvoai:n,updateEvoai:r,createEvoai:s}}const Kne=e=>["evoai","fetchDefaultSettings",JSON.stringify(e)],Wne=async({instanceName:e,token:t})=>(await le.get(`/evoai/fetchSettings/${e}`,{headers:{apikey:t}})).data,Gne=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Kne({instanceName:t,token:n}),queryFn:()=>Wne({instanceName:t,token:n}),enabled:!!t})},Jne=j.object({expire:j.string(),keywordFinish:j.string(),delayMessage:j.string(),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.string(),ignoreJids:j.array(j.string()).default([]),evoaiIdFallback:j.union([j.null(),j.string()]).optional(),splitMessages:j.boolean(),timePerChar:j.string()});function Qne(){const{t:e}=Ee(),{instance:t}=He(),{setDefaultSettingsEvoai:n}=_m(),[r,s]=v.useState(!1),{data:o,refetch:a}=dA({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=Gne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),l=$t({resolver:Bt(Jne),defaultValues:{expire:"0",keywordFinish:e("evoai.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evoai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],evoaiIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&l.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,evoaiIdFallback:c.evoaiIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var h,g,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),evoaiIdFallback:f.evoaiIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),Z.success(e("evoai.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),Z.error(`Error: ${(m=(g=(h=x==null?void 0:x.response)==null?void 0:h.data)==null?void 0:g.response)==null?void 0:m.message}`)}};function p(){u(),a()}return i.jsxs(pt,{open:r,onOpenChange:s,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("evoai.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("evoai.defaultSettings")})}),i.jsx(Pn,{...l,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:l.handleSubmit(d),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"evoaiIdFallback",label:e("evoai.form.evoaiIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),i.jsx(z,{name:"expire",label:e("evoai.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("evoai.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("evoai.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("evoai.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("evoai.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("evoai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("evoai.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("evoai.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:e("evoai.form.splitMessages.label"),reverse:!0}),i.jsx(z,{name:"timePerChar",label:e("evoai.form.timePerChar.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("evoai.form.ignoreJids.label"),placeholder:e("evoai.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("evoai.button.save")})})]})})]})]})}const Zne=e=>["evoai","fetchSessions",JSON.stringify(e)],Yne=async({evoaiId:e,instanceName:t})=>(await le.get(`/evoai/fetchSessions/${e}/${t}`)).data,Xne=e=>{const{evoaiId:t,instanceName:n,...r}=e;return We({...r,queryKey:Zne({evoaiId:t,instanceName:n}),queryFn:()=>Yne({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function fA({evoaiId:e}){const{t}=Ee(),{instance:n}=He(),{changeStatusEvoai:r}=_m(),[s,o]=v.useState([]),{data:a,refetch:c}=Xne({evoaiId:e,instanceName:n==null?void 0:n.name}),[u,l]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("evoai.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("evoai.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:t("evoai.sessions.table.actions.title")}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:u,onOpenChange:l,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evoai.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("evoai.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("evoai.sessions.search"),value:d,onChange:m=>p(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{})})]}),i.jsx(Ya,{columns:g,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("evoai.sessions.table.none")})]})]})]})}const ere=j.object({enabled:j.boolean(),description:j.string(),agentUrl:j.string(),apiKey:j.string(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function pA({initialData:e,onSubmit:t,handleDelete:n,evoaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Ee(),l=$t({resolver:Bt(ere),defaultValues:e||{enabled:!0,description:"",agentUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=l.watch("triggerType");return i.jsx(Pn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:u("evoai.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:u("evoai.form.description.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.evoaiSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"agentUrl",label:u("evoai.form.agentUrl.label"),required:!0,children:i.jsx(L,{})}),i.jsx(z,{name:"apiKey",label:u("evoai.form.apiKey.label"),className:"flex-1",children:i.jsx(L,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:u("evoai.form.triggerType.label"),options:[{label:u("evoai.form.triggerType.keyword"),value:"keyword"},{label:u("evoai.form.triggerType.all"),value:"all"},{label:u("evoai.form.triggerType.advanced"),value:"advanced"},{label:u("evoai.form.triggerType.none"),value:"none"}]}),d==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:u("evoai.form.triggerOperator.label"),options:[{label:u("evoai.form.triggerOperator.contains"),value:"contains"},{label:u("evoai.form.triggerOperator.equals"),value:"equals"},{label:u("evoai.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("evoai.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("evoai.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:u("evoai.form.triggerValue.label"),children:i.jsx(L,{})})]}),d==="advanced"&&i.jsx(z,{name:"triggerValue",label:u("evoai.form.triggerConditions.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:u("evoai.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:u("evoai.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:u("evoai.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:u("evoai.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:u("evoai.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:u("evoai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:u("evoai.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:u("evoai.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:u("evoai.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:u("evoai.form.timePerChar.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:u(o?"evoai.button.saving":"evoai.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(fA,{evoaiId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:u("evoai.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:u("modal.delete.title")}),i.jsx(eo,{children:u("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:u(o?"evoai.button.saving":"evoai.button.update")})]})]})]})})}function tre({resetTable:e}){const{t}=Ee(),{instance:n}=He(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createEvoai:c}=_m(),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:l.enabled,description:l.description,agentUrl:l.agentUrl,apiKey:l.apiKey,triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0,splitMessages:l.splitMessages||!1,timePerChar:l.timePerChar||0};await c({instanceName:n.name,token:n.token,data:h}),Z.success(t("evoai.toast.success.create")),a(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return i.jsxs(pt,{open:o,onOpenChange:a,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evoai.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("evoai.form.title")})}),i.jsx(pA,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const nre=e=>["evoai","getEvoai",JSON.stringify(e)],rre=async({evoaiId:e,instanceName:t})=>(await le.get(`/evoai/fetch/${e}/${t}`)).data,sre=e=>{const{evoaiId:t,instanceName:n,...r}=e;return We({...r,queryKey:nre({evoaiId:t,instanceName:n}),queryFn:()=>rre({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function ore({evoaiId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteEvoai:c,updateEvoai:u}=_m(),{data:l,isLoading:d}=sre({evoaiId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(l!=null&&l.enabled),description:(l==null?void 0:l.description)??"",agentUrl:(l==null?void 0:l.agentUrl)??"",apiKey:(l==null?void 0:l.apiKey)??"",triggerType:(l==null?void 0:l.triggerType)??"",triggerOperator:(l==null?void 0:l.triggerOperator)??"",triggerValue:(l==null?void 0:l.triggerValue)??"",expire:(l==null?void 0:l.expire)??0,keywordFinish:(l==null?void 0:l.keywordFinish)??"",delayMessage:(l==null?void 0:l.delayMessage)??0,unknownMessage:(l==null?void 0:l.unknownMessage)??"",listeningFromMe:!!(l!=null&&l.listeningFromMe),stopBotFromMe:!!(l!=null&&l.stopBotFromMe),keepOpen:!!(l!=null&&l.keepOpen),debounceTime:(l==null?void 0:l.debounceTime)??0,splitMessages:(l==null?void 0:l.splitMessages)??!1,timePerChar:(l==null?void 0:l.timePerChar)??0}),[l==null?void 0:l.agentUrl,l==null?void 0:l.apiKey,l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.unknownMessage,l==null?void 0:l.splitMessages,l==null?void 0:l.timePerChar]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,agentUrl:g.agentUrl,apiKey:g.apiKey,triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0,splitMessages:g.splitMessages||!1,timePerChar:g.timePerChar||0};await u({instanceName:r.name,evoaiId:e,data:y}),Z.success(n("evoai.toast.success.update")),t(),s(`/manager/instance/${r.id}/evoai/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,evoaiId:e}),Z.success(n("evoai.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/evoai`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir evoai:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(pA,{initialData:p,onSubmit:f,evoaiId:e,handleDelete:h,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function hE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{evoaiId:r}=Zr(),{data:s,refetch:o,isLoading:a}=dA({instanceName:n==null?void 0:n.name}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/evoai/${d}`)},l=()=>{o()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("evoai.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(fA,{}),i.jsx(Qne,{}),i.jsx(tre,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:a?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):i.jsx($,{variant:"link",children:e("evoai.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-border"}),i.jsx(Cn,{children:i.jsx(ore,{evoaiId:r,resetTable:l})})]})]})]})}const are=e=>["evolutionBot","findEvolutionBot",JSON.stringify(e)],ire=async({instanceName:e,token:t})=>(await le.get(`/evolutionBot/find/${e}`,{headers:{apiKey:t}})).data,hA=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:are({instanceName:t}),queryFn:()=>ire({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},lre=e=>["evolutionBot","fetchDefaultSettings",JSON.stringify(e)],cre=async({instanceName:e,token:t})=>{const n=await le.get(`/evolutionBot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},ure=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:lre({instanceName:t}),queryFn:()=>cre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},dre=async({instanceName:e,token:t,data:n})=>(await le.post(`/evolutionBot/create/${e}`,n,{headers:{apikey:t}})).data,fre=async({instanceName:e,token:t,evolutionBotId:n,data:r})=>(await le.put(`/evolutionBot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,pre=async({instanceName:e,evolutionBotId:t})=>(await le.delete(`/evolutionBot/delete/${t}/${e}`)).data,hre=async({instanceName:e,token:t,data:n})=>(await le.post(`/evolutionBot/settings/${e}`,n,{headers:{apikey:t}})).data,gre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/evolutionBot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Mm(){const e=Ae(hre,{invalidateKeys:[["evolutionBot","fetchDefaultSettings"]]}),t=Ae(gre,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","fetchSessions"]]}),n=Ae(pre,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),r=Ae(fre,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),s=Ae(dre,{invalidateKeys:[["evolutionBot","findEvolutionBot"]]});return{setDefaultSettingsEvolutionBot:e,changeStatusEvolutionBot:t,deleteEvolutionBot:n,updateEvolutionBot:r,createEvolutionBot:s}}const mre=j.object({expire:j.string(),keywordFinish:j.string(),delayMessage:j.string(),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.string(),ignoreJids:j.array(j.string()).default([]),botIdFallback:j.union([j.null(),j.string()]).optional(),splitMessages:j.boolean(),timePerChar:j.string()});function vre(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{data:s,refetch:o}=ure({instanceName:t==null?void 0:t.name,enabled:n}),{data:a,refetch:c}=hA({instanceName:t==null?void 0:t.name,enabled:n}),{setDefaultSettingsEvolutionBot:u}=Mm(),l=$t({resolver:Bt(mre),defaultValues:{expire:"0",keywordFinish:e("evolutionBot.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evolutionBot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],botIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{s&&l.reset({expire:s!=null&&s.expire?s.expire.toString():"0",keywordFinish:s.keywordFinish,delayMessage:s.delayMessage?s.delayMessage.toString():"0",unknownMessage:s.unknownMessage,listeningFromMe:s.listeningFromMe,stopBotFromMe:s.stopBotFromMe,keepOpen:s.keepOpen,debounceTime:s.debounceTime?s.debounceTime.toString():"0",ignoreJids:s.ignoreJids,botIdFallback:s.botIdFallback,splitMessages:s.splitMessages,timePerChar:s.timePerChar?s.timePerChar.toString():"0"})},[s]);const d=async f=>{var h,g,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),botIdFallback:f.botIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await u({instanceName:t.name,token:t.token,data:x}),Z.success(e("evolutionBot.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),Z.error(`Error: ${(m=(g=(h=x==null?void 0:x.response)==null?void 0:h.data)==null?void 0:g.response)==null?void 0:m.message}`)}};function p(){o(),c()}return i.jsxs(pt,{open:n,onOpenChange:r,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("evolutionBot.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("evolutionBot.defaultSettings")})}),i.jsx(Pn,{...l,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:l.handleSubmit(d),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"botIdFallback",label:e("evolutionBot.form.botIdFallback.label"),options:(a==null?void 0:a.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),i.jsx(z,{name:"expire",label:e("evolutionBot.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("evolutionBot.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("evolutionBot.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("evolutionBot.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("evolutionBot.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("evolutionBot.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("evolutionBot.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:e("evolutionBot.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:e("evolutionBot.form.timePerChar.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("evolutionBot.form.ignoreJids.label"),placeholder:e("evolutionBot.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("evolutionBot.button.save")})})]})})]})]})}const yre=e=>["evolutionBot","fetchSessions",JSON.stringify(e)],bre=async({instanceName:e,evolutionBotId:t,token:n})=>(await le.get(`/evolutionBot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,xre=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return We({...s,queryKey:yre({instanceName:t}),queryFn:()=>bre({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function gA({evolutionBotId:e}){const{t}=Ee(),{instance:n}=He(),[r,s]=v.useState([]),[o,a]=v.useState(!1),[c,u]=v.useState(""),{data:l,refetch:d}=xre({instanceName:n==null?void 0:n.name,evolutionBotId:e,enabled:o}),{changeStatusEvolutionBot:p}=Mm();function f(){d()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await p({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("evolutionBot.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("evolutionBot.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:t("evolutionBot.sessions.table.actions.title")}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:o,onOpenChange:a,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("evolutionBot.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("evolutionBot.sessions.search"),value:c,onChange:m=>u(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{})})]}),i.jsx(Ya,{columns:g,data:l??[],onSortingChange:s,state:{sorting:r,globalFilter:c},onGlobalFilterChange:u,enableGlobalFilter:!0,noResultsMessage:t("evolutionBot.sessions.table.none")})]})]})]})}const wre=j.object({enabled:j.boolean(),description:j.string(),apiUrl:j.string(),apiKey:j.string().optional(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function mA({initialData:e,onSubmit:t,handleDelete:n,evolutionBotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Ee(),l=$t({resolver:Bt(wre),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=l.watch("triggerType");return i.jsx(Pn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:u("evolutionBot.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:u("evolutionBot.form.description.label"),required:!0,children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.evolutionBotSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"apiUrl",label:u("evolutionBot.form.apiUrl.label"),required:!0,children:i.jsx(L,{})}),i.jsx(z,{name:"apiKey",label:u("evolutionBot.form.apiKey.label"),children:i.jsx(L,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:u("evolutionBot.form.triggerType.label"),options:[{label:u("evolutionBot.form.triggerType.keyword"),value:"keyword"},{label:u("evolutionBot.form.triggerType.all"),value:"all"},{label:u("evolutionBot.form.triggerType.advanced"),value:"advanced"},{label:u("evolutionBot.form.triggerType.none"),value:"none"}]}),d==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:u("evolutionBot.form.triggerOperator.label"),options:[{label:u("evolutionBot.form.triggerOperator.contains"),value:"contains"},{label:u("evolutionBot.form.triggerOperator.equals"),value:"equals"},{label:u("evolutionBot.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("evolutionBot.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("evolutionBot.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:u("evolutionBot.form.triggerValue.label"),children:i.jsx(L,{})})]}),d==="advanced"&&i.jsx(z,{name:"triggerValue",label:u("evolutionBot.form.triggerConditions.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:u("evolutionBot.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:u("evolutionBot.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:u("evolutionBot.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:u("evolutionBot.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:u("evolutionBot.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:u("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:u("evolutionBot.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:u("evolutionBot.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:u("evolutionBot.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:u("evolutionBot.form.timePerChar.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:u(o?"evolutionBot.button.saving":"evolutionBot.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(gA,{evolutionBotId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:u("modal.delete.title")}),i.jsx(eo,{children:u("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:u(o?"evolutionBot.button.saving":"evolutionBot.button.update")})]})]})]})})}function Sre({resetTable:e}){const{t}=Ee(),{instance:n}=He(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createEvolutionBot:c}=Mm(),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:l.enabled,description:l.description,apiUrl:l.apiUrl,apiKey:l.apiKey,triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0,splitMessages:l.splitMessages||!1,timePerChar:l.timePerChar?l.timePerChar:0};await c({instanceName:n.name,token:n.token,data:h}),Z.success(t("evolutionBot.toast.success.create")),a(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return i.jsxs(pt,{open:o,onOpenChange:a,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("evolutionBot.form.title")})}),i.jsx(mA,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const Cre=e=>["evolutionBot","getEvolutionBot",JSON.stringify(e)],kre=async({instanceName:e,token:t,evolutionBotId:n})=>{const r=await le.get(`/evolutionBot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Ere=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return We({...s,queryKey:Cre({instanceName:t}),queryFn:()=>kre({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function jre({evolutionBotId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteEvolutionBot:c,updateEvolutionBot:u}=Mm(),{data:l,isLoading:d}=Ere({instanceName:r==null?void 0:r.name,evolutionBotId:e}),p=v.useMemo(()=>({enabled:(l==null?void 0:l.enabled)??!0,description:(l==null?void 0:l.description)??"",apiUrl:(l==null?void 0:l.apiUrl)??"",apiKey:(l==null?void 0:l.apiKey)??"",triggerType:(l==null?void 0:l.triggerType)??"",triggerOperator:(l==null?void 0:l.triggerOperator)??"",triggerValue:l==null?void 0:l.triggerValue,expire:(l==null?void 0:l.expire)??0,keywordFinish:l==null?void 0:l.keywordFinish,delayMessage:(l==null?void 0:l.delayMessage)??0,unknownMessage:l==null?void 0:l.unknownMessage,listeningFromMe:l==null?void 0:l.listeningFromMe,stopBotFromMe:!!(l!=null&&l.stopBotFromMe),keepOpen:!!(l!=null&&l.keepOpen),debounceTime:(l==null?void 0:l.debounceTime)??0,splitMessages:(l==null?void 0:l.splitMessages)??!1,timePerChar:l!=null&&l.timePerChar?l==null?void 0:l.timePerChar:0}),[l==null?void 0:l.apiKey,l==null?void 0:l.apiUrl,l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.unknownMessage,l==null?void 0:l.splitMessages,l==null?void 0:l.timePerChar]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,apiUrl:g.apiUrl,apiKey:g.apiKey,triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0,splitMessages:g.splitMessages||!1,timePerChar:g.timePerChar?g.timePerChar:0};await u({instanceName:r.name,evolutionBotId:e,data:y}),Z.success(n("evolutionBot.toast.success.update")),t(),s(`/manager/instance/${r.id}/evolutionBot/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,evolutionBotId:e}),Z.success(n("evolutionBot.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/evolutionBot`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir evolutionBot:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(mA,{initialData:p,onSubmit:f,evolutionBotId:e,handleDelete:h,isModal:!1,openDeletionDialog:o,setOpenDeletionDialog:a})})}function gE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{evolutionBotId:r}=Zr(),{data:s,isLoading:o,refetch:a}=hA({instanceName:n==null?void 0:n.name}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/evolutionBot/${d}`)},l=()=>{a()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("evolutionBot.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(gA,{}),i.jsx(vre,{}),i.jsx(Sre,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):i.jsx($,{variant:"link",children:e("evolutionBot.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-border"}),i.jsx(Cn,{children:i.jsx(jre,{evolutionBotId:r,resetTable:l})})]})]})]})}const Tre=e=>["flowise","findFlowise",JSON.stringify(e)],Nre=async({instanceName:e,token:t})=>(await le.get(`/flowise/find/${e}`,{headers:{apiKey:t}})).data,vA=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Tre({instanceName:t}),queryFn:()=>Nre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},_re=e=>["flowise","fetchDefaultSettings",JSON.stringify(e)],Mre=async({instanceName:e,token:t})=>{const n=await le.get(`/flowise/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Rre=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:_re({instanceName:t}),queryFn:()=>Mre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Pre=async({instanceName:e,token:t,data:n})=>(await le.post(`/flowise/create/${e}`,n,{headers:{apikey:t}})).data,Ore=async({instanceName:e,flowiseId:t,data:n})=>(await le.put(`/flowise/update/${t}/${e}`,n)).data,Ire=async({instanceName:e,flowiseId:t})=>(await le.delete(`/flowise/delete/${t}/${e}`)).data,Dre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/flowise/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data,Are=async({instanceName:e,token:t,data:n})=>(await le.post(`/flowise/settings/${e}`,n,{headers:{apikey:t}})).data;function Rm(){const e=Ae(Are,{invalidateKeys:[["flowise","fetchDefaultSettings"]]}),t=Ae(Dre,{invalidateKeys:[["flowise","getFlowise"],["flowise","fetchSessions"]]}),n=Ae(Ire,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),r=Ae(Ore,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),s=Ae(Pre,{invalidateKeys:[["flowise","findFlowise"]]});return{setDefaultSettingsFlowise:e,changeStatusFlowise:t,deleteFlowise:n,updateFlowise:r,createFlowise:s}}const Fre=j.object({expire:j.string(),keywordFinish:j.string(),delayMessage:j.string(),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.string(),ignoreJids:j.array(j.string()).default([]),flowiseIdFallback:j.union([j.null(),j.string()]).optional(),splitMessages:j.boolean(),timePerChar:j.string()});function Lre(){const{t:e}=Ee(),{instance:t}=He(),{setDefaultSettingsFlowise:n}=Rm(),[r,s]=v.useState(!1),{data:o,refetch:a}=Rre({instanceName:t==null?void 0:t.name,enabled:r}),{data:c,refetch:u}=vA({instanceName:t==null?void 0:t.name,enabled:r}),l=$t({resolver:Bt(Fre),defaultValues:{expire:"0",keywordFinish:e("flowise.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("flowise.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],flowiseIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{o&&l.reset({expire:o!=null&&o.expire?o.expire.toString():"0",keywordFinish:o.keywordFinish,delayMessage:o.delayMessage?o.delayMessage.toString():"0",unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime?o.debounceTime.toString():"0",ignoreJids:o.ignoreJids,flowiseIdFallback:o.flowiseIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar?o.timePerChar.toString():"0"})},[o]);const d=async f=>{var h,g,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),flowiseIdFallback:f.flowiseIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),Z.success(e("flowise.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),Z.error(`Error: ${(m=(g=(h=x==null?void 0:x.response)==null?void 0:h.data)==null?void 0:g.response)==null?void 0:m.message}`)}};function p(){a(),u()}return i.jsxs(pt,{open:r,onOpenChange:s,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("flowise.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("flowise.defaultSettings")})}),i.jsx(Pn,{...l,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:l.handleSubmit(d),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"flowiseIdFallback",label:e("flowise.form.flowiseIdFallback.label"),options:(c==null?void 0:c.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),i.jsx(z,{name:"expire",label:e("flowise.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("flowise.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("flowise.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("flowise.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("flowise.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("flowise.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("flowise.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("flowise.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:e("flowise.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:e("flowise.form.timePerChar.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("flowise.form.ignoreJids.label"),placeholder:e("flowise.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("flowise.button.save")})})]})})]})]})}const $re=e=>["flowise","fetchSessions",JSON.stringify(e)],Bre=async({instanceName:e,flowiseId:t,token:n})=>(await le.get(`/flowise/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,zre=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return We({...s,queryKey:$re({instanceName:t}),queryFn:()=>Bre({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function yA({flowiseId:e}){const{t}=Ee(),{instance:n}=He(),{changeStatusFlowise:r}=Rm(),[s,o]=v.useState([]),[a,c]=v.useState(!1),[u,l]=v.useState(""),{data:d,refetch:p}=zre({instanceName:n==null?void 0:n.name,flowiseId:e,enabled:a});function f(){p()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("flowise.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("flowise.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:t("flowise.sessions.table.actions.title")}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("flowise.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("flowise.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("flowise.sessions.search"),value:u,onChange:m=>l(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{})})]}),i.jsx(Ya,{columns:g,data:d??[],onSortingChange:o,state:{sorting:s,globalFilter:u},onGlobalFilterChange:l,enableGlobalFilter:!0,noResultsMessage:t("flowise.sessions.table.none")})]})]})]})}const Ure=j.object({enabled:j.boolean(),description:j.string(),apiUrl:j.string(),apiKey:j.string().optional(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function bA({initialData:e,onSubmit:t,handleDelete:n,flowiseId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Ee(),l=$t({resolver:Bt(Ure),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=l.watch("triggerType");return i.jsx(Pn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:u("flowise.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:u("flowise.form.description.label"),required:!0,children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.flowiseSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"apiUrl",label:u("flowise.form.apiUrl.label"),required:!0,children:i.jsx(L,{})}),i.jsx(z,{name:"apiKey",label:u("flowise.form.apiKey.label"),children:i.jsx(L,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:u("flowise.form.triggerType.label"),options:[{label:u("flowise.form.triggerType.keyword"),value:"keyword"},{label:u("flowise.form.triggerType.all"),value:"all"},{label:u("flowise.form.triggerType.advanced"),value:"advanced"},{label:u("flowise.form.triggerType.none"),value:"none"}]}),d==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:u("flowise.form.triggerOperator.label"),options:[{label:u("flowise.form.triggerOperator.contains"),value:"contains"},{label:u("flowise.form.triggerOperator.equals"),value:"equals"},{label:u("flowise.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("flowise.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("flowise.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:u("flowise.form.triggerValue.label"),children:i.jsx(L,{})})]}),d==="advanced"&&i.jsx(z,{name:"triggerValue",label:u("flowise.form.triggerConditions.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:u("flowise.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:u("flowise.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:u("flowise.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:u("flowise.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:u("flowise.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:u("flowise.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:u("flowise.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:u("flowise.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:u("flowise.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:u("flowise.form.timePerChar.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:u(o?"flowise.button.saving":"flowise.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(yA,{flowiseId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:u("modal.delete.title")}),i.jsx(eo,{children:u("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:u(o?"flowise.button.saving":"flowise.button.update")})]})]})]})})}function Vre({resetTable:e}){const{t}=Ee(),{instance:n}=He(),{createFlowise:r}=Rm(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const h={enabled:l.enabled,description:l.description,apiUrl:l.apiUrl,apiKey:l.apiKey,triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0,splitMessages:l.splitMessages||!1,timePerChar:l.timePerChar||0};await r({instanceName:n.name,token:n.token,data:h}),Z.success(t("flowise.toast.success.create")),c(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("flowise.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("flowise.form.title")})}),i.jsx(bA,{onSubmit:u,isModal:!0,isLoading:s})]})]})}const Hre=e=>["flowise","getFlowise",JSON.stringify(e)],qre=async({instanceName:e,token:t,flowiseId:n})=>{const r=await le.get(`/flowise/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Kre=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return We({...s,queryKey:Hre({instanceName:t}),queryFn:()=>qre({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Wre({flowiseId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteFlowise:c,updateFlowise:u}=Rm(),{data:l,isLoading:d}=Kre({instanceName:r==null?void 0:r.name,flowiseId:e}),p=v.useMemo(()=>({enabled:(l==null?void 0:l.enabled)??!0,description:(l==null?void 0:l.description)??"",apiUrl:(l==null?void 0:l.apiUrl)??"",apiKey:(l==null?void 0:l.apiKey)??"",triggerType:(l==null?void 0:l.triggerType)??"",triggerOperator:(l==null?void 0:l.triggerOperator)??"",triggerValue:l==null?void 0:l.triggerValue,expire:(l==null?void 0:l.expire)??0,keywordFinish:l==null?void 0:l.keywordFinish,delayMessage:(l==null?void 0:l.delayMessage)??0,unknownMessage:l==null?void 0:l.unknownMessage,listeningFromMe:l==null?void 0:l.listeningFromMe,stopBotFromMe:l==null?void 0:l.stopBotFromMe,keepOpen:l==null?void 0:l.keepOpen,debounceTime:(l==null?void 0:l.debounceTime)??0,splitMessages:(l==null?void 0:l.splitMessages)??!1,timePerChar:(l==null?void 0:l.timePerChar)??0}),[l==null?void 0:l.apiKey,l==null?void 0:l.apiUrl,l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.unknownMessage,l==null?void 0:l.splitMessages,l==null?void 0:l.timePerChar]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,apiUrl:g.apiUrl,apiKey:g.apiKey,triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0,splitMessages:g.splitMessages||!1,timePerChar:g.timePerChar||0};await u({instanceName:r.name,flowiseId:e,data:y}),Z.success(n("flowise.toast.success.update")),t(),s(`/manager/instance/${r.id}/flowise/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,flowiseId:e}),Z.success(n("flowise.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/flowise`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir dify:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(bA,{initialData:p,onSubmit:f,flowiseId:e,handleDelete:h,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function mE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{flowiseId:r}=Zr(),{data:s,isLoading:o,refetch:a}=vA({instanceName:n==null?void 0:n.name}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/flowise/${d}`)},l=()=>{a()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("flowise.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(yA,{}),i.jsx(Lre,{}),i.jsx(Vre,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):i.jsx($,{variant:"link",children:e("flowise.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-border"}),i.jsx(Cn,{children:i.jsx(Wre,{flowiseId:r,resetTable:l})})]})]})]})}const Gre=e=>["n8n","fetchN8n",JSON.stringify(e)],Jre=async({instanceName:e,token:t})=>(await le.get(`/n8n/find/${e}`,{headers:{apikey:t}})).data,xA=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Gre({instanceName:t,token:n}),queryFn:()=>Jre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Qre=async({instanceName:e,token:t,data:n})=>(await le.post(`/n8n/create/${e}`,n,{headers:{apikey:t}})).data,Zre=async({instanceName:e,n8nId:t,data:n})=>(await le.put(`/n8n/update/${t}/${e}`,n)).data,Yre=async({instanceName:e,n8nId:t})=>(await le.delete(`/n8n/delete/${t}/${e}`)).data,Xre=async({instanceName:e,token:t,data:n})=>(await le.post(`/n8n/settings/${e}`,n,{headers:{apikey:t}})).data,ese=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/n8n/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Pm(){const e=Ae(Xre,{invalidateKeys:[["n8n","fetchDefaultSettings"]]}),t=Ae(ese,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchSessions"]]}),n=Ae(Yre,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),r=Ae(Zre,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),s=Ae(Qre,{invalidateKeys:[["n8n","fetchN8n"]]});return{setDefaultSettingsN8n:e,changeStatusN8n:t,deleteN8n:n,updateN8n:r,createN8n:s}}const tse=e=>["n8n","fetchDefaultSettings",JSON.stringify(e)],nse=async({instanceName:e,token:t})=>(await le.get(`/n8n/fetchSettings/${e}`,{headers:{apikey:t}})).data,rse=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:tse({instanceName:t,token:n}),queryFn:()=>nse({instanceName:t,token:n}),enabled:!!t})},sse=j.object({expire:j.string(),keywordFinish:j.string(),delayMessage:j.string(),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.string(),ignoreJids:j.array(j.string()).default([]),n8nIdFallback:j.union([j.null(),j.string()]).optional(),splitMessages:j.boolean(),timePerChar:j.string()});function ose(){const{t:e}=Ee(),{instance:t}=He(),{setDefaultSettingsN8n:n}=Pm(),[r,s]=v.useState(!1),{data:o,refetch:a}=xA({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=rse({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),l=$t({resolver:Bt(sse),defaultValues:{expire:"0",keywordFinish:e("n8n.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("n8n.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],n8nIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&l.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,n8nIdFallback:c.n8nIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var h,g,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),n8nIdFallback:f.n8nIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),Z.success(e("n8n.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),Z.error(`Error: ${(m=(g=(h=x==null?void 0:x.response)==null?void 0:h.data)==null?void 0:g.response)==null?void 0:m.message}`)}};function p(){u(),a()}return i.jsxs(pt,{open:r,onOpenChange:s,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("n8n.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("n8n.defaultSettings")})}),i.jsx(Pn,{...l,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:l.handleSubmit(d),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"n8nIdFallback",label:e("n8n.form.n8nIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),i.jsx(z,{name:"expire",label:e("n8n.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("n8n.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("n8n.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("n8n.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("n8n.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("n8n.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("n8n.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("n8n.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:e("n8n.form.splitMessages.label"),reverse:!0}),i.jsx(z,{name:"timePerChar",label:e("n8n.form.timePerChar.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("n8n.form.ignoreJids.label"),placeholder:e("n8n.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("n8n.button.save")})})]})})]})]})}const ase=e=>["n8n","fetchSessions",JSON.stringify(e)],ise=async({n8nId:e,instanceName:t})=>(await le.get(`/n8n/fetchSessions/${e}/${t}`)).data,lse=e=>{const{n8nId:t,instanceName:n,...r}=e;return We({...r,queryKey:ase({n8nId:t,instanceName:n}),queryFn:()=>ise({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function wA({n8nId:e}){const{t}=Ee(),{instance:n}=He(),{changeStatusN8n:r}=Pm(),[s,o]=v.useState([]),{data:a,refetch:c}=lse({n8nId:e,instanceName:n==null?void 0:n.name}),[u,l]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("n8n.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("n8n.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:t("n8n.sessions.table.actions.title")}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:u,onOpenChange:l,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("n8n.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("n8n.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("n8n.sessions.search"),value:d,onChange:m=>p(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{})})]}),i.jsx(Ya,{columns:g,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("n8n.sessions.table.none")})]})]})]})}const cse=j.object({enabled:j.boolean(),description:j.string(),webhookUrl:j.string(),basicAuthUser:j.string(),basicAuthPass:j.string(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function SA({initialData:e,onSubmit:t,handleDelete:n,n8nId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Ee(),l=$t({resolver:Bt(cse),defaultValues:e||{enabled:!0,description:"",webhookUrl:"",basicAuthUser:"",basicAuthPass:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=l.watch("triggerType");return i.jsx(Pn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:u("n8n.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:u("n8n.form.description.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.n8nSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"webhookUrl",label:u("n8n.form.webhookUrl.label"),required:!0,children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.basicAuth.label")}),i.jsx(mt,{})]}),i.jsxs("div",{className:"flex w-full flex-row gap-4",children:[i.jsx(z,{name:"basicAuthUser",label:u("n8n.form.basicAuthUser.label"),className:"flex-1",children:i.jsx(L,{})}),i.jsx(z,{name:"basicAuthPass",label:u("n8n.form.basicAuthPass.label"),className:"flex-1",children:i.jsx(L,{type:"password"})})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:u("n8n.form.triggerType.label"),options:[{label:u("n8n.form.triggerType.keyword"),value:"keyword"},{label:u("n8n.form.triggerType.all"),value:"all"},{label:u("n8n.form.triggerType.advanced"),value:"advanced"},{label:u("n8n.form.triggerType.none"),value:"none"}]}),d==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:u("n8n.form.triggerOperator.label"),options:[{label:u("n8n.form.triggerOperator.contains"),value:"contains"},{label:u("n8n.form.triggerOperator.equals"),value:"equals"},{label:u("n8n.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("n8n.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("n8n.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:u("n8n.form.triggerValue.label"),children:i.jsx(L,{})})]}),d==="advanced"&&i.jsx(z,{name:"triggerValue",label:u("n8n.form.triggerConditions.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:u("n8n.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:u("n8n.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:u("n8n.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:u("n8n.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:u("n8n.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:u("n8n.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:u("n8n.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:u("n8n.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:u("n8n.form.splitMessages.label"),reverse:!0}),l.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:u("n8n.form.timePerChar.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:u(o?"n8n.button.saving":"n8n.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(wA,{n8nId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:u("n8n.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:u("modal.delete.title")}),i.jsx(eo,{children:u("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:u(o?"n8n.button.saving":"n8n.button.update")})]})]})]})})}function use({resetTable:e}){const{t}=Ee(),{instance:n}=He(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createN8n:c}=Pm(),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:l.enabled,description:l.description,webhookUrl:l.webhookUrl,basicAuthUser:l.basicAuthUser,basicAuthPass:l.basicAuthPass,triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0,splitMessages:l.splitMessages||!1,timePerChar:l.timePerChar||0};await c({instanceName:n.name,token:n.token,data:h}),Z.success(t("n8n.toast.success.create")),a(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return i.jsxs(pt,{open:o,onOpenChange:a,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("n8n.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("n8n.form.title")})}),i.jsx(SA,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const dse=e=>["n8n","getN8n",JSON.stringify(e)],fse=async({n8nId:e,instanceName:t})=>(await le.get(`/n8n/fetch/${e}/${t}`)).data,pse=e=>{const{n8nId:t,instanceName:n,...r}=e;return We({...r,queryKey:dse({n8nId:t,instanceName:n}),queryFn:()=>fse({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function hse({n8nId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteN8n:c,updateN8n:u}=Pm(),{data:l,isLoading:d}=pse({n8nId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(l!=null&&l.enabled),description:(l==null?void 0:l.description)??"",webhookUrl:(l==null?void 0:l.webhookUrl)??"",basicAuthUser:(l==null?void 0:l.basicAuthUser)??"",basicAuthPass:(l==null?void 0:l.basicAuthPass)??"",triggerType:(l==null?void 0:l.triggerType)??"",triggerOperator:(l==null?void 0:l.triggerOperator)??"",triggerValue:(l==null?void 0:l.triggerValue)??"",expire:(l==null?void 0:l.expire)??0,keywordFinish:(l==null?void 0:l.keywordFinish)??"",delayMessage:(l==null?void 0:l.delayMessage)??0,unknownMessage:(l==null?void 0:l.unknownMessage)??"",listeningFromMe:!!(l!=null&&l.listeningFromMe),stopBotFromMe:!!(l!=null&&l.stopBotFromMe),keepOpen:!!(l!=null&&l.keepOpen),debounceTime:(l==null?void 0:l.debounceTime)??0,splitMessages:(l==null?void 0:l.splitMessages)??!1,timePerChar:(l==null?void 0:l.timePerChar)??0}),[l==null?void 0:l.webhookUrl,l==null?void 0:l.basicAuthUser,l==null?void 0:l.basicAuthPass,l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.unknownMessage,l==null?void 0:l.splitMessages,l==null?void 0:l.timePerChar]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,webhookUrl:g.webhookUrl,basicAuthUser:g.basicAuthUser,basicAuthPass:g.basicAuthPass,triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0,splitMessages:g.splitMessages||!1,timePerChar:g.timePerChar||0};await u({instanceName:r.name,n8nId:e,data:y}),Z.success(n("n8n.toast.success.update")),t(),s(`/manager/instance/${r.id}/n8n/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,n8nId:e}),Z.success(n("n8n.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/n8n`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir n8n:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(SA,{initialData:p,onSubmit:f,n8nId:e,handleDelete:h,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function vE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{n8nId:r}=Zr(),{data:s,refetch:o,isLoading:a}=xA({instanceName:n==null?void 0:n.name}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/n8n/${d}`)},l=()=>{o()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("n8n.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(wA,{}),i.jsx(ose,{}),i.jsx(use,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:a?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):i.jsx($,{variant:"link",children:e("n8n.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-border"}),i.jsx(Cn,{children:i.jsx(hse,{n8nId:r,resetTable:l})})]})]})]})}const gse=e=>["openai","findOpenai",JSON.stringify(e)],mse=async({instanceName:e,token:t})=>(await le.get(`/openai/find/${e}`,{headers:{apiKey:t}})).data,CA=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:gse({instanceName:t}),queryFn:()=>mse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},vse=e=>["openai","findOpenaiCreds",JSON.stringify(e)],yse=async({instanceName:e,token:t})=>(await le.get(`/openai/creds/${e}`,{headers:{apiKey:t}})).data,V0=e=>{const{instanceName:t,token:n,...r}=e;return We({staleTime:1e3*60*60*6,...r,queryKey:vse({instanceName:t}),queryFn:()=>yse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},bse=async({instanceName:e,token:t,data:n})=>(await le.post(`/openai/creds/${e}`,n,{headers:{apikey:t}})).data,xse=async({openaiCredsId:e,instanceName:t})=>(await le.delete(`/openai/creds/${e}/${t}`)).data,wse=async({instanceName:e,token:t,data:n})=>(await le.post(`/openai/create/${e}`,n,{headers:{apikey:t}})).data,Sse=async({instanceName:e,token:t,openaiId:n,data:r})=>(await le.put(`/openai/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Cse=async({instanceName:e,token:t,openaiId:n})=>(await le.delete(`/openai/delete/${n}/${e}`,{headers:{apikey:t}})).data,kse=async({instanceName:e,token:t,data:n})=>(await le.post(`/openai/settings/${e}`,n,{headers:{apikey:t}})).data,Ese=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/openai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Cf(){const e=Ae(kse,{invalidateKeys:[["openai","fetchDefaultSettings"]]}),t=Ae(Ese,{invalidateKeys:[["openai","getOpenai"],["openai","fetchSessions"]]}),n=Ae(Cse,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),r=Ae(Sse,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),s=Ae(wse,{invalidateKeys:[["openai","findOpenai"]]}),o=Ae(bse,{invalidateKeys:[["openai","findOpenaiCreds"]]}),a=Ae(xse,{invalidateKeys:[["openai","findOpenaiCreds"]]});return{setDefaultSettingsOpenai:e,changeStatusOpenai:t,deleteOpenai:n,updateOpenai:r,createOpenai:s,createOpenaiCreds:o,deleteOpenaiCreds:a}}const jse=j.object({name:j.string(),apiKey:j.string()});function kA({onCredentialsUpdate:e,showText:t=!0}){const{t:n}=Ee(),{instance:r}=He(),{createOpenaiCreds:s,deleteOpenaiCreds:o}=Cf(),[a,c]=v.useState(!1),[u,l]=v.useState([]),{data:d}=V0({instanceName:r==null?void 0:r.name,enabled:a}),p=$t({resolver:Bt(jse),defaultValues:{name:"",apiKey:""}}),f=async m=>{var x,b,y;try{if(!r||!r.name)throw new Error("instance not found.");const w={name:m.name,apiKey:m.apiKey};await s({instanceName:r.name,token:r.token,data:w}),Z.success(n("openai.toast.success.credentialsCreate")),p.reset(),e&&e()}catch(w){console.error("Error:",w),Z.error(`Error: ${(y=(b=(x=w==null?void 0:w.response)==null?void 0:x.data)==null?void 0:b.response)==null?void 0:y.message}`)}},h=async m=>{var x,b,y;if(!(r!=null&&r.name)){Z.error("Instance not found.");return}try{await o({openaiCredsId:m,instanceName:r==null?void 0:r.name}),Z.success(n("openai.toast.success.credentialsDelete")),e&&e()}catch(w){console.error("Error:",w),Z.error(`Error: ${(y=(b=(x=w==null?void 0:w.response)==null?void 0:x.data)==null?void 0:b.response)==null?void 0:y.message}`)}},g=[{accessorKey:"name",header:({column:m})=>i.jsxs($,{variant:"ghost",onClick:()=>m.toggleSorting(m.getIsSorted()==="asc"),children:[n("openai.credentials.table.name"),i.jsx(mz,{className:"ml-2 h-4 w-4"})]}),cell:({row:m})=>i.jsx("div",{children:m.getValue("name")})},{accessorKey:"apiKey",header:()=>i.jsx("div",{className:"text-right",children:n("openai.credentials.table.apiKey")}),cell:({row:m})=>i.jsxs("div",{children:[`${m.getValue("apiKey")}`.slice(0,20),"..."]})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:n("openai.credentials.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:n("openai.credentials.table.actions.title")}),i.jsx(Xs,{}),i.jsx(Ye,{onClick:()=>h(x.id),children:n("openai.credentials.table.actions.delete")})]})]})}}];return i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"secondary",size:"sm",type:"button",children:t?i.jsxs(i.Fragment,{children:[i.jsx($z,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden md:inline",children:n("openai.credentials.title")})]}):i.jsx(Yr,{size:16})})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:n("openai.credentials.title")})}),i.jsx(Pn,{...p,children:i.jsx("div",{onClick:m=>m.stopPropagation(),onSubmit:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),children:i.jsxs("form",{onSubmit:m=>{m.preventDefault(),m.stopPropagation(),p.handleSubmit(f)(m)},className:"w-full space-y-6",children:[i.jsx("div",{children:i.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[i.jsx(z,{name:"name",label:n("openai.credentials.table.name"),children:i.jsx(L,{})}),i.jsx(z,{name:"apiKey",label:n("openai.credentials.table.apiKey"),children:i.jsx(L,{type:"password"})})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:n("openai.button.save")})})]})})}),i.jsx(mt,{}),i.jsx("div",{children:i.jsx(Ya,{columns:g,data:d??[],onSortingChange:l,state:{sorting:u},noResultsMessage:n("openai.credentials.table.none")})})]})]})}const Tse=e=>["openai","fetchDefaultSettings",JSON.stringify(e)],Nse=async({instanceName:e,token:t})=>{const n=await le.get(`/openai/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},_se=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Tse({instanceName:t}),queryFn:()=>Nse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Mse=j.object({openaiCredsId:j.string(),expire:j.coerce.number(),keywordFinish:j.string(),delayMessage:j.coerce.number().default(0),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.coerce.number(),speechToText:j.boolean(),ignoreJids:j.array(j.string()).default([]),openaiIdFallback:j.union([j.null(),j.string()]).optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function Rse(){const{t:e}=Ee(),{instance:t}=He(),{setDefaultSettingsOpenai:n}=Cf(),[r,s]=v.useState(!1),{data:o,refetch:a}=_se({instanceName:t==null?void 0:t.name,enabled:r}),{data:c,refetch:u}=CA({instanceName:t==null?void 0:t.name,enabled:r}),{data:l}=V0({instanceName:t==null?void 0:t.name,enabled:r}),d=$t({resolver:Bt(Mse),defaultValues:{openaiCredsId:"",expire:0,keywordFinish:e("openai.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("openai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,speechToText:!1,ignoreJids:[],openaiIdFallback:void 0,splitMessages:!1,timePerChar:0}});v.useEffect(()=>{o&&d.reset({openaiCredsId:o.openaiCredsId,expire:(o==null?void 0:o.expire)??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0,speechToText:o.speechToText,ignoreJids:o.ignoreJids,openaiIdFallback:o.openaiIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar??0})},[o]);const p=async h=>{var g,m,x;try{if(!t||!t.name)throw new Error("instance not found.");const b={openaiCredsId:h.openaiCredsId,expire:h.expire,keywordFinish:h.keywordFinish,delayMessage:h.delayMessage,unknownMessage:h.unknownMessage,listeningFromMe:h.listeningFromMe,stopBotFromMe:h.stopBotFromMe,keepOpen:h.keepOpen,debounceTime:h.debounceTime,speechToText:h.speechToText,openaiIdFallback:h.openaiIdFallback||void 0,ignoreJids:h.ignoreJids,splitMessages:h.splitMessages,timePerChar:h.timePerChar};await n({instanceName:t.name,token:t.token,data:b}),Z.success(e("openai.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),Z.error(`Error: ${(x=(m=(g=b==null?void 0:b.response)==null?void 0:g.data)==null?void 0:m.response)==null?void 0:x.message}`)}};function f(){a(),u()}return i.jsxs(pt,{open:r,onOpenChange:s,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden md:inline",children:e("openai.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("openai.defaultSettings")})}),i.jsx(Pn,{...d,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:d.handleSubmit(p),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"openaiCredsId",label:e("openai.form.openaiCredsId.label"),options:(l==null?void 0:l.filter(h=>!!h.id).map(h=>({label:h.name?h.name:h.apiKey.substring(0,15)+"...",value:h.id})))||[]}),i.jsx(Tt,{name:"openaiIdFallback",label:e("openai.form.openaiIdFallback.label"),options:(c==null?void 0:c.filter(h=>!!h.id).map(h=>({label:h.description,value:h.id})))??[]}),i.jsx(z,{name:"expire",label:e("openai.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("openai.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("openai.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("openai.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("openai.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("openai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("openai.form.keepOpen.label"),reverse:!0}),i.jsx(he,{name:"speechToText",label:e("openai.form.speechToText.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("openai.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:e("openai.form.splitMessages.label"),reverse:!0}),d.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:e("openai.form.timePerChar.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("openai.form.ignoreJids.label"),placeholder:e("openai.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("openai.button.save")})})]})})]})]})}const Pse=e=>["openai","getModels",JSON.stringify(e)],Ose=async({instanceName:e,openaiCredsId:t,token:n})=>{const r=t?{openaiCredsId:t}:{};return(await le.get(`/openai/getModels/${e}`,{headers:{apiKey:n},params:r})).data},Ise=e=>{const{instanceName:t,openaiCredsId:n,token:r,...s}=e;return We({staleTime:1e3*60*60*6,...s,queryKey:Pse({instanceName:t,openaiCredsId:n}),queryFn:()=>Ose({instanceName:t,openaiCredsId:n,token:r}),enabled:!!t&&!!n&&(e.enabled??!0)})},Dse=e=>["openai","fetchSessions",JSON.stringify(e)],Ase=async({instanceName:e,openaiId:t,token:n})=>(await le.get(`/openai/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Fse=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return We({...s,queryKey:Dse({instanceName:t}),queryFn:()=>Ase({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function EA({openaiId:e}){const{t}=Ee(),{instance:n}=He(),{changeStatusOpenai:r}=Cf(),[s,o]=v.useState([]),[a,c]=v.useState(!1),{data:u,refetch:l}=Fse({instanceName:n==null?void 0:n.name,openaiId:e,enabled:a}),[d,p]=v.useState("");function f(){l()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("openai.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",size:"icon",children:[i.jsx("span",{className:"sr-only",children:t("openai.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:t("openai.sessions.table.actions.title")}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden md:inline",children:t("openai.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("openai.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("openai.sessions.search"),value:d,onChange:m=>p(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{size:16})})]}),i.jsx(Ya,{columns:g,data:u??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("openai.sessions.table.none")})]})]})]})}const Lse=j.object({enabled:j.boolean(),description:j.string(),openaiCredsId:j.string(),botType:j.string(),assistantId:j.string().optional(),functionUrl:j.string().optional(),model:j.string().optional(),systemMessages:j.string().optional(),assistantMessages:j.string().optional(),userMessages:j.string().optional(),maxTokens:j.coerce.number().optional(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional(),splitMessages:j.boolean().optional(),timePerChar:j.coerce.number().optional()});function jA({initialData:e,onSubmit:t,handleDelete:n,openaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{},open:u}){const{t:l}=Ee(),{instance:d}=He(),[p,f]=v.useState(!1),{data:h,refetch:g}=V0({instanceName:d==null?void 0:d.name,enabled:u}),m=$t({resolver:Bt(Lse),defaultValues:e||{enabled:!0,description:"",openaiCredsId:"",botType:"assistant",assistantId:"",functionUrl:"",model:"",systemMessages:"",assistantMessages:"",userMessages:"",maxTokens:0,triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),x=m.watch("botType"),b=m.watch("triggerType"),y=m.watch("openaiCredsId"),{data:w,isLoading:S,refetch:k}=Ise({instanceName:d==null?void 0:d.name,openaiCredsId:y,token:d==null?void 0:d.token,enabled:p&&!!y}),C=()=>{y&&(f(!0),k())},T=()=>{g()};return i.jsx(Pn,{...m,children:i.jsxs("form",{onSubmit:m.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:l("openai.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:l("openai.form.description.label"),required:!0,children:i.jsx(L,{})}),i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("div",{className:"flex-1",children:i.jsx(Tt,{name:"openaiCredsId",label:l("openai.form.openaiCredsId.label"),required:!0,options:(h==null?void 0:h.filter(E=>!!E.id).map(E=>({label:E.name?E.name:E.apiKey.substring(0,15)+"...",value:E.id})))??[]})}),i.jsx(kA,{onCredentialsUpdate:T,showText:!1})]})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:l("openai.form.openaiSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"botType",label:l("openai.form.botType.label"),required:!0,options:[{label:l("openai.form.botType.assistant"),value:"assistant"},{label:l("openai.form.botType.chatCompletion"),value:"chatCompletion"}]}),x==="assistant"&&i.jsxs(i.Fragment,{children:[i.jsx(z,{name:"assistantId",label:l("openai.form.assistantId.label"),required:!0,children:i.jsx(L,{})}),i.jsx(z,{name:"functionUrl",label:l("openai.form.functionUrl.label"),required:!0,children:i.jsx(L,{})})]}),x==="chatCompletion"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("div",{className:"flex-1",children:i.jsx(Tt,{name:"model",label:l("openai.form.model.label"),required:!0,disabled:!w||w.length===0,options:(w==null?void 0:w.map(E=>({label:E.id,value:E.id})))??[]})}),i.jsx($,{type:"button",variant:"outline",size:"sm",disabled:!y||S,onClick:C,className:"mb-2",children:S?i.jsxs(i.Fragment,{children:[i.jsx(Nh,{className:"mr-2 h-4 w-4 animate-spin"}),l("openai.button.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx(Nh,{className:"mr-2 h-4 w-4"}),l("openai.button.loadModels")]})})]})}),i.jsx(z,{name:"systemMessages",label:l("openai.form.systemMessages.label"),children:i.jsx(Pi,{})}),i.jsx(z,{name:"assistantMessages",label:l("openai.form.assistantMessages.label"),children:i.jsx(Pi,{})}),i.jsx(z,{name:"userMessages",label:l("openai.form.userMessages.label"),children:i.jsx(Pi,{})}),i.jsx(z,{name:"maxTokens",label:l("openai.form.maxTokens.label"),children:i.jsx(L,{type:"number"})})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:l("openai.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:l("openai.form.triggerType.label"),required:!0,options:[{label:l("openai.form.triggerType.keyword"),value:"keyword"},{label:l("openai.form.triggerType.all"),value:"all"},{label:l("openai.form.triggerType.advanced"),value:"advanced"},{label:l("openai.form.triggerType.none"),value:"none"}]}),b==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:l("openai.form.triggerOperator.label"),required:!0,options:[{label:l("openai.form.triggerOperator.contains"),value:"contains"},{label:l("openai.form.triggerOperator.equals"),value:"equals"},{label:l("openai.form.triggerOperator.startsWith"),value:"startsWith"},{label:l("openai.form.triggerOperator.endsWith"),value:"endsWith"},{label:l("openai.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:l("openai.form.triggerValue.label"),required:!0,children:i.jsx(L,{})})]}),b==="advanced"&&i.jsx(z,{name:"triggerValue",label:l("openai.form.triggerConditions.label"),required:!0,children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:l("openai.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:l("openai.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:l("openai.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:l("openai.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:l("openai.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:l("openai.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:l("openai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:l("openai.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:l("openai.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(he,{name:"splitMessages",label:l("openai.form.splitMessages.label"),reverse:!0}),m.watch("splitMessages")&&i.jsx(z,{name:"timePerChar",label:l("openai.form.timePerChar.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:l(o?"openai.button.saving":"openai.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(EA,{openaiId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:l("dify.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:l("modal.delete.title")}),i.jsx(eo,{children:l("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:l("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:l("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:l(o?"openai.button.saving":"openai.button.update")})]})]})]})})}function $se({resetTable:e}){const{t}=Ee(),{instance:n}=He(),{createOpenai:r}=Cf(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const h={enabled:l.enabled,description:l.description,openaiCredsId:l.openaiCredsId,botType:l.botType,assistantId:l.assistantId||"",functionUrl:l.functionUrl||"",model:l.model||"",systemMessages:[l.systemMessages||""],assistantMessages:[l.assistantMessages||""],userMessages:[l.userMessages||""],maxTokens:l.maxTokens||0,triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0,splitMessages:l.splitMessages||!1,timePerChar:l.timePerChar||0};await r({instanceName:n.name,token:n.token,data:h}),Z.success(t("openai.toast.success.create")),c(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("openai.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("openai.form.title")})}),i.jsx(jA,{onSubmit:u,isModal:!0,isLoading:s,open:a})]})]})}const Bse=e=>["openai","getOpenai",JSON.stringify(e)],zse=async({instanceName:e,token:t,openaiId:n})=>{const r=await le.get(`/openai/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Use=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return We({...s,queryKey:Bse({instanceName:t}),queryFn:()=>zse({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Vse({openaiId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteOpenai:c,updateOpenai:u}=Cf(),{data:l,isLoading:d}=Use({instanceName:r==null?void 0:r.name,openaiId:e}),p=v.useMemo(()=>({enabled:(l==null?void 0:l.enabled)??!0,description:(l==null?void 0:l.description)??"",openaiCredsId:(l==null?void 0:l.openaiCredsId)??"",botType:(l==null?void 0:l.botType)??"",assistantId:(l==null?void 0:l.assistantId)||"",functionUrl:(l==null?void 0:l.functionUrl)||"",model:(l==null?void 0:l.model)||"",systemMessages:Array.isArray(l==null?void 0:l.systemMessages)?l==null?void 0:l.systemMessages.join(", "):(l==null?void 0:l.systemMessages)||"",assistantMessages:Array.isArray(l==null?void 0:l.assistantMessages)?l==null?void 0:l.assistantMessages.join(", "):(l==null?void 0:l.assistantMessages)||"",userMessages:Array.isArray(l==null?void 0:l.userMessages)?l==null?void 0:l.userMessages.join(", "):(l==null?void 0:l.userMessages)||"",maxTokens:(l==null?void 0:l.maxTokens)||0,triggerType:(l==null?void 0:l.triggerType)||"",triggerOperator:(l==null?void 0:l.triggerOperator)||"",triggerValue:l==null?void 0:l.triggerValue,expire:(l==null?void 0:l.expire)||0,keywordFinish:l==null?void 0:l.keywordFinish,delayMessage:(l==null?void 0:l.delayMessage)||0,unknownMessage:l==null?void 0:l.unknownMessage,listeningFromMe:l==null?void 0:l.listeningFromMe,stopBotFromMe:l==null?void 0:l.stopBotFromMe,keepOpen:l==null?void 0:l.keepOpen,debounceTime:(l==null?void 0:l.debounceTime)||0,splitMessages:(l==null?void 0:l.splitMessages)||!1,timePerChar:(l==null?void 0:l.timePerChar)||0}),[l==null?void 0:l.assistantId,l==null?void 0:l.assistantMessages,l==null?void 0:l.botType,l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.functionUrl,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.maxTokens,l==null?void 0:l.model,l==null?void 0:l.openaiCredsId,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.systemMessages,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.unknownMessage,l==null?void 0:l.userMessages,l==null?void 0:l.splitMessages,l==null?void 0:l.timePerChar]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,openaiCredsId:g.openaiCredsId,botType:g.botType,assistantId:g.assistantId||"",functionUrl:g.functionUrl||"",model:g.model||"",systemMessages:[g.systemMessages||""],assistantMessages:[g.assistantMessages||""],userMessages:[g.userMessages||""],maxTokens:g.maxTokens||0,triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0,splitMessages:g.splitMessages||!1,timePerChar:g.timePerChar||0};await u({instanceName:r.name,openaiId:e,data:y}),Z.success(n("openai.toast.success.update")),t(),s(`/manager/instance/${r.id}/openai/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,openaiId:e}),Z.success(n("openai.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/openai`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir dify:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(jA,{initialData:p,onSubmit:f,openaiId:e,handleDelete:h,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function yE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{botId:r}=Zr(),{data:s,isLoading:o,refetch:a}=CA({instanceName:n==null?void 0:n.name}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/openai/${d}`)},l=()=>{a()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("openai.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(EA,{}),i.jsx(Rse,{}),i.jsx(kA,{}),i.jsx($se,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsxs($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:[i.jsx("h4",{className:"text-base",children:d.description||d.id}),i.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:d.botType})]},d.id)):i.jsx($,{variant:"link",children:e("openai.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-border"}),i.jsx(Cn,{children:i.jsx(Vse,{openaiId:r,resetTable:l})})]})]})]})}const Hse=e=>["proxy","fetchProxy",JSON.stringify(e)],qse=async({instanceName:e,token:t})=>(await le.get(`/proxy/find/${e}`,{headers:{apiKey:t}})).data,Kse=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Hse({instanceName:t,token:n}),queryFn:()=>qse({instanceName:t,token:n}),enabled:!!t})},Wse=async({instanceName:e,token:t,data:n})=>(await le.post(`/proxy/set/${e}`,n,{headers:{apikey:t}})).data;function Gse(){return{createProxy:Ae(Wse,{invalidateKeys:[["proxy","fetchProxy"]]})}}const Jse=j.object({enabled:j.boolean(),host:j.string(),port:j.string(),protocol:j.string(),username:j.string(),password:j.string()});function Qse(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{createProxy:s}=Gse(),{data:o}=Kse({instanceName:t==null?void 0:t.name}),a=$t({resolver:Bt(Jse),defaultValues:{enabled:!1,host:"",port:"",protocol:"http",username:"",password:""}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,host:o.host,port:o.port,protocol:o.protocol,username:o.username,password:o.password})},[o]);const c=async u=>{var l,d,p;if(t){r(!0);try{const f={enabled:u.enabled,host:u.host,port:u.port,protocol:u.protocol,username:u.username,password:u.password};await s({instanceName:t.name,token:t.token,data:f}),Z.success(e("proxy.toast.success"))}catch(f){console.error(e("proxy.toast.error"),f),Z.error(`Error : ${(p=(d=(l=f==null?void 0:f.response)==null?void 0:l.data)==null?void 0:d.response)==null?void 0:p.message}`)}finally{r(!1)}}};return i.jsx(i.Fragment,{children:i.jsx(Lo,{...a,children:i.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("proxy.title")}),i.jsx(Ka,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(he,{name:"enabled",label:e("proxy.form.enabled.label"),className:"w-full justify-between",helper:e("proxy.form.enabled.description")}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-[10rem_1fr_10rem] md:gap-8",children:[i.jsx(z,{name:"protocol",label:e("proxy.form.protocol.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"host",label:e("proxy.form.host.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"port",label:e("proxy.form.port.label"),children:i.jsx(L,{type:"number"})})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 md:gap-8",children:[i.jsx(z,{name:"username",label:e("proxy.form.username.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"password",label:e("proxy.form.password.label"),children:i.jsx(L,{type:"password"})})]}),i.jsx("div",{className:"flex justify-end px-4 pt-6",children:i.jsx($,{type:"submit",disabled:n,children:e(n?"proxy.button.saving":"proxy.button.save")})})]})]})})})})}const Zse=e=>["rabbitmq","fetchRabbitmq",JSON.stringify(e)],Yse=async({instanceName:e,token:t})=>(await le.get(`/rabbitmq/find/${e}`,{headers:{apiKey:t}})).data,Xse=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Zse({instanceName:t,token:n}),queryFn:()=>Yse({instanceName:t,token:n}),enabled:!!t})},eoe=async({instanceName:e,token:t,data:n})=>(await le.post(`/rabbitmq/set/${e}`,{rabbitmq:n},{headers:{apikey:t}})).data;function toe(){return{createRabbitmq:Ae(eoe,{invalidateKeys:[["rabbitmq","fetchRabbitmq"]]})}}const noe=j.object({enabled:j.boolean(),events:j.array(j.string())});function roe(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{createRabbitmq:s}=toe(),{data:o}=Xse({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=$t({resolver:Bt(noe),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,h,g;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),Z.success(e("rabbitmq.toast.success"))}catch(m){console.error(e("rabbitmq.toast.error"),m),Z.error(`Error: ${(g=(h=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:h.response)==null?void 0:g.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],l=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Lo,{...a,children:i.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("rabbitmq.title")}),i.jsx(Ka,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(he,{name:"enabled",label:e("rabbitmq.form.enabled.label"),className:"w-full justify-between",helper:e("rabbitmq.form.enabled.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx($,{variant:"outline",type:"button",onClick:l,children:e("button.markAll")}),i.jsx($,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),i.jsx($o,{control:a.control,name:"events",render:({field:p})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(fr,{className:"my-2 text-lg",children:e("rabbitmq.form.events.label")}),i.jsx(Ss,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,h)=>f.localeCompare(h)).map(f=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(fr,{className:ve("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),i.jsx(Yc,{checked:p.value.includes(f),onCheckedChange:h=>{h?p.onChange([...p.value,f]):p.onChange(p.value.filter(g=>g!==f))}})]},f))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx($,{type:"submit",disabled:n,children:e(n?"rabbitmq.button.saving":"rabbitmq.button.save")})})]})})})})}const soe=e=>["instance","fetchSettings",JSON.stringify(e)],ooe=async({instanceName:e,token:t})=>(await le.get(`/settings/find/${e}`,{headers:{apikey:t}})).data,aoe=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:soe({instanceName:t,token:n}),queryFn:()=>ooe({instanceName:t,token:n}),enabled:!!t})},ioe=j.object({rejectCall:j.boolean(),msgCall:j.string().optional(),groupsIgnore:j.boolean(),alwaysOnline:j.boolean(),readMessages:j.boolean(),syncFullHistory:j.boolean(),readStatus:j.boolean()});function loe(){const{t:e}=Ee(),[t,n]=v.useState(!1),{instance:r}=He(),{updateSettings:s}=em(),{data:o,isLoading:a}=aoe({instanceName:r==null?void 0:r.name,token:r==null?void 0:r.token}),c=$t({resolver:Bt(ioe),defaultValues:{rejectCall:!1,msgCall:"",groupsIgnore:!1,alwaysOnline:!1,readMessages:!1,syncFullHistory:!1,readStatus:!1}});v.useEffect(()=>{o&&c.reset({rejectCall:o.rejectCall,msgCall:o.msgCall||"",groupsIgnore:o.groupsIgnore,alwaysOnline:o.alwaysOnline,readMessages:o.readMessages,syncFullHistory:o.syncFullHistory,readStatus:o.readStatus})},[c,o]);const u=async p=>{try{if(!r||!r.name)throw new Error("instance not found");n(!0);const f={rejectCall:p.rejectCall,msgCall:p.msgCall,groupsIgnore:p.groupsIgnore,alwaysOnline:p.alwaysOnline,readMessages:p.readMessages,syncFullHistory:p.syncFullHistory,readStatus:p.readStatus};await s({instanceName:r.name,token:r.token,data:f}),Z.success(e("settings.toast.success"))}catch(f){console.error(e("settings.toast.success"),f),Z.error(e("settings.toast.error"))}finally{n(!1)}},l=[{name:"groupsIgnore",label:e("settings.form.groupsIgnore.label"),description:e("settings.form.groupsIgnore.description")},{name:"alwaysOnline",label:e("settings.form.alwaysOnline.label"),description:e("settings.form.alwaysOnline.description")},{name:"readMessages",label:e("settings.form.readMessages.label"),description:e("settings.form.readMessages.description")},{name:"syncFullHistory",label:e("settings.form.syncFullHistory.label"),description:e("settings.form.syncFullHistory.description")},{name:"readStatus",label:e("settings.form.readStatus.label"),description:e("settings.form.readStatus.description")}],d=c.watch("rejectCall");return a?i.jsx(un,{}):i.jsx(i.Fragment,{children:i.jsx(Lo,{...c,children:i.jsx("form",{onSubmit:c.handleSubmit(u),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("settings.title")}),i.jsx(mt,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y",children:[i.jsxs("div",{className:"flex flex-col p-4",children:[i.jsx(he,{name:"rejectCall",label:e("settings.form.rejectCall.label"),className:"w-full justify-between",helper:e("settings.form.rejectCall.description")}),d&&i.jsx("div",{className:"mr-16 mt-2",children:i.jsx(z,{name:"msgCall",children:i.jsx(Pi,{placeholder:e("settings.form.msgCall.description")})})})]}),l.map(p=>i.jsx("div",{className:"flex p-4",children:i.jsx(he,{name:p.name,label:p.label,className:"w-full justify-between",helper:p.description})},p.name)),i.jsx("div",{className:"flex justify-end pt-6",children:i.jsx($,{type:"submit",disabled:t,children:e(t?"settings.button.saving":"settings.button.save")})})]})]})})})})}const coe=e=>["sqs","fetchSqs",JSON.stringify(e)],uoe=async({instanceName:e,token:t})=>(await le.get(`/sqs/find/${e}`,{headers:{apiKey:t}})).data,doe=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:coe({instanceName:t,token:n}),queryFn:()=>uoe({instanceName:t,token:n}),enabled:!!t})},foe=async({instanceName:e,token:t,data:n})=>(await le.post(`/sqs/set/${e}`,{sqs:n},{headers:{apikey:t}})).data;function poe(){return{createSqs:Ae(foe,{invalidateKeys:[["sqs","fetchSqs"]]})}}const hoe=j.object({enabled:j.boolean(),events:j.array(j.string())});function goe(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{createSqs:s}=poe(),{data:o}=doe({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=$t({resolver:Bt(hoe),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,h,g;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),Z.success(e("sqs.toast.success"))}catch(m){console.error(e("sqs.toast.error"),m),Z.error(`Error: ${(g=(h=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:h.response)==null?void 0:g.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],l=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Lo,{...a,children:i.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("sqs.title")}),i.jsx(Ka,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(he,{name:"enabled",label:e("sqs.form.enabled.label"),className:"w-full justify-between",helper:e("sqs.form.enabled.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx($,{variant:"outline",type:"button",onClick:l,children:e("button.markAll")}),i.jsx($,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),i.jsx($o,{control:a.control,name:"events",render:({field:p})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(fr,{className:"my-2 text-lg",children:e("sqs.form.events.label")}),i.jsx(Ss,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,h)=>f.localeCompare(h)).map(f=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(fr,{className:ve("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),i.jsx(Yc,{checked:p.value.includes(f),onCheckedChange:h=>{h?p.onChange([...p.value,f]):p.onChange(p.value.filter(g=>g!==f))}})]},f))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx($,{type:"submit",disabled:n,children:e(n?"sqs.button.saving":"sqs.button.save")})})]})})})})}const moe=e=>["typebot","findTypebot",JSON.stringify(e)],voe=async({instanceName:e,token:t})=>(await le.get(`/typebot/find/${e}`,{headers:{apiKey:t}})).data,TA=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:moe({instanceName:t}),queryFn:()=>voe({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},yoe=e=>["typebot","fetchDefaultSettings",JSON.stringify(e)],boe=async({instanceName:e,token:t})=>{const n=await le.get(`/typebot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},xoe=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:yoe({instanceName:t}),queryFn:()=>boe({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},woe=async({instanceName:e,token:t,data:n})=>(await le.post(`/typebot/create/${e}`,n,{headers:{apikey:t}})).data,Soe=async({instanceName:e,token:t,typebotId:n,data:r})=>(await le.put(`/typebot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Coe=async({instanceName:e,typebotId:t})=>(await le.delete(`/typebot/delete/${t}/${e}`)).data,koe=async({instanceName:e,token:t,data:n})=>(await le.post(`/typebot/settings/${e}`,n,{headers:{apikey:t}})).data,Eoe=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await le.post(`/typebot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Om(){const e=Ae(koe,{invalidateKeys:[["typebot","fetchDefaultSettings"]]}),t=Ae(Eoe,{invalidateKeys:[["typebot","getTypebot"],["typebot","fetchSessions"]]}),n=Ae(Coe,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),r=Ae(Soe,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),s=Ae(woe,{invalidateKeys:[["typebot","findTypebot"]]});return{setDefaultSettingsTypebot:e,changeStatusTypebot:t,deleteTypebot:n,updateTypebot:r,createTypebot:s}}const joe=j.object({expire:j.coerce.number(),keywordFinish:j.string(),delayMessage:j.coerce.number(),unknownMessage:j.string(),listeningFromMe:j.boolean(),stopBotFromMe:j.boolean(),keepOpen:j.boolean(),debounceTime:j.coerce.number()});function Toe(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{setDefaultSettingsTypebot:s}=Om(),{data:o,refetch:a}=xoe({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:n}),{data:c,refetch:u}=TA({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:n}),l=$t({resolver:Bt(joe),defaultValues:{expire:0,keywordFinish:e("typebot.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("typebot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}});v.useEffect(()=>{o&&l.reset({expire:(o==null?void 0:o.expire)??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0})},[o]);const d=async f=>{var h,g,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:f.expire,keywordFinish:f.keywordFinish,delayMessage:f.delayMessage,unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:f.debounceTime};await s({instanceName:t.name,token:t.token,data:x}),Z.success(e("typebot.toast.defaultSettings.success"))}catch(x){console.error(e("typebot.toast.defaultSettings.error"),x),Z.error(`Error: ${(m=(g=(h=x==null?void 0:x.response)==null?void 0:h.data)==null?void 0:g.response)==null?void 0:m.message}`)}};function p(){a(),u()}return i.jsxs(pt,{open:n,onOpenChange:r,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(Io,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("typebot.button.defaultSettings")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[i.jsx(ct,{children:i.jsx(yt,{children:e("typebot.modal.defaultSettings.title")})}),i.jsx(Pn,{...l,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:l.handleSubmit(d),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Tt,{name:"typebotIdFallback",label:e("typebot.form.typebotIdFallback.label"),options:(c==null?void 0:c.filter(f=>!!f.id).map(f=>({label:f.typebot,value:f.description})))??[]}),i.jsx(z,{name:"expire",label:e("typebot.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:e("typebot.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:e("typebot.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:e("typebot.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:e("typebot.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:e("typebot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:e("typebot.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:e("typebot.form.debounceTime.label"),children:i.jsx(L,{type:"number"})}),i.jsx(Ja,{name:"ignoreJids",label:e("typebot.form.ignoreJids.label"),placeholder:e("typebot.form.ignoreJids.placeholder")})]})}),i.jsx(Rt,{children:i.jsx($,{type:"submit",children:e("typebot.button.save")})})]})})]})]})}const Noe=e=>["typebot","fetchSessions",JSON.stringify(e)],_oe=async({instanceName:e,typebotId:t,token:n})=>(await le.get(`/typebot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Moe=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return We({...s,queryKey:Noe({instanceName:t}),queryFn:()=>_oe({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function NA({typebotId:e}){const{t}=Ee(),{instance:n}=He(),[r,s]=v.useState([]),[o,a]=v.useState(!1),[c,u]=v.useState(""),{changeStatusTypebot:l}=Om(),{data:d,refetch:p}=Moe({instanceName:n==null?void 0:n.name,token:n==null?void 0:n.token,typebotId:e});function f(){p()}const h=async(m,x)=>{var b,y,w;try{if(!n)return;await l({instanceName:n.name,token:n.token,remoteJid:m,status:x}),Z.success(t("typebot.toast.success.status")),f()}catch(S){console.error("Error:",S),Z.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},g=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.remoteJid")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.pushName")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.sessionId")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.status")}),cell:({row:m})=>i.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("typebot.sessions.table.actions.title")}),i.jsx(qa,{className:"h-4 w-4"})]})}),i.jsxs(tr,{align:"end",children:[i.jsx(Ao,{children:"Actions"}),i.jsx(Xs,{}),x.status!=="opened"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"opened"),children:[i.jsx(rl,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"paused"),children:[i.jsx(nl,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.pause")]}),x.status!=="closed"&&i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"closed"),children:[i.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.close")]}),i.jsxs(Ye,{onClick:()=>h(x.remoteJid,"delete"),children:[i.jsx(el,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(pt,{open:o,onOpenChange:a,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{variant:"secondary",size:"sm",children:[i.jsx(tl,{size:16,className:"mr-1"})," ",i.jsx("span",{className:"hidden sm:inline",children:t("typebot.sessions.label")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[i.jsx(ct,{children:i.jsx(yt,{children:t("typebot.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(L,{placeholder:t("typebot.sessions.search"),value:c,onChange:m=>u(m.target.value)}),i.jsx($,{variant:"outline",onClick:f,size:"icon",children:i.jsx(sl,{size:16})})]}),i.jsx(Ya,{columns:g,data:d??[],onSortingChange:s,state:{sorting:r,globalFilter:c},onGlobalFilterChange:u,enableGlobalFilter:!0,noResultsMessage:t("typebot.sessions.table.none")})]})]})]})}const Roe=j.object({enabled:j.boolean(),description:j.string(),url:j.string(),typebot:j.string().optional(),triggerType:j.string(),triggerOperator:j.string().optional(),triggerValue:j.string().optional(),expire:j.coerce.number().optional(),keywordFinish:j.string().optional(),delayMessage:j.coerce.number().optional(),unknownMessage:j.string().optional(),listeningFromMe:j.boolean().optional(),stopBotFromMe:j.boolean().optional(),keepOpen:j.boolean().optional(),debounceTime:j.coerce.number().optional()});function _A({initialData:e,onSubmit:t,handleDelete:n,typebotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Ee(),l=$t({resolver:Bt(Roe),defaultValues:e||{enabled:!0,description:"",url:"",typebot:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}}),d=l.watch("triggerType");return i.jsx(Pn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(he,{name:"enabled",label:u("typebot.form.enabled.label"),reverse:!0}),i.jsx(z,{name:"description",label:u("typebot.form.description.label"),required:!0,children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.typebotSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"url",label:u("typebot.form.url.label"),required:!0,children:i.jsx(L,{})}),i.jsx(z,{name:"typebot",label:u("typebot.form.typebot.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.triggerSettings.label")}),i.jsx(mt,{})]}),i.jsx(Tt,{name:"triggerType",label:u("typebot.form.triggerType.label"),options:[{label:u("typebot.form.triggerType.keyword"),value:"keyword"},{label:u("typebot.form.triggerType.all"),value:"all"},{label:u("typebot.form.triggerType.advanced"),value:"advanced"},{label:u("typebot.form.triggerType.none"),value:"none"}]}),d==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Tt,{name:"triggerOperator",label:u("typebot.form.triggerOperator.label"),options:[{label:u("typebot.form.triggerOperator.contains"),value:"contains"},{label:u("typebot.form.triggerOperator.equals"),value:"equals"},{label:u("typebot.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("typebot.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("typebot.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(z,{name:"triggerValue",label:u("typebot.form.triggerValue.label"),children:i.jsx(L,{})})]}),d==="advanced"&&i.jsx(z,{name:"triggerValue",label:u("typebot.form.triggerConditions.label"),children:i.jsx(L,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.generalSettings.label")}),i.jsx(mt,{})]}),i.jsx(z,{name:"expire",label:u("typebot.form.expire.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"keywordFinish",label:u("typebot.form.keywordFinish.label"),children:i.jsx(L,{})}),i.jsx(z,{name:"delayMessage",label:u("typebot.form.delayMessage.label"),children:i.jsx(L,{type:"number"})}),i.jsx(z,{name:"unknownMessage",label:u("typebot.form.unknownMessage.label"),children:i.jsx(L,{})}),i.jsx(he,{name:"listeningFromMe",label:u("typebot.form.listeningFromMe.label"),reverse:!0}),i.jsx(he,{name:"stopBotFromMe",label:u("typebot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(he,{name:"keepOpen",label:u("typebot.form.keepOpen.label"),reverse:!0}),i.jsx(z,{name:"debounceTime",label:u("typebot.form.debounceTime.label"),children:i.jsx(L,{type:"number"})})]}),s&&i.jsx(Rt,{children:i.jsx($,{disabled:o,type:"submit",children:u(o?"typebot.button.saving":"typebot.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(NA,{typebotId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsx($,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),i.jsx(lt,{children:i.jsxs(ct,{children:[i.jsx(yt,{children:u("modal.delete.title")}),i.jsx(eo,{children:u("modal.delete.messageSingle")}),i.jsxs(Rt,{children:[i.jsx($,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),i.jsx($,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),i.jsx($,{disabled:o,type:"submit",children:u(o?"typebot.button.saving":"typebot.button.update")})]})]})]})})}function Poe({resetTable:e}){const{t}=Ee(),{instance:n}=He(),{createTypebot:r}=Om(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async l=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const h={enabled:l.enabled,description:l.description,url:l.url,typebot:l.typebot||"",triggerType:l.triggerType,triggerOperator:l.triggerOperator||"",triggerValue:l.triggerValue||"",expire:l.expire||0,keywordFinish:l.keywordFinish||"",delayMessage:l.delayMessage||0,unknownMessage:l.unknownMessage||"",listeningFromMe:l.listeningFromMe||!1,stopBotFromMe:l.stopBotFromMe||!1,keepOpen:l.keepOpen||!1,debounceTime:l.debounceTime||0};await r({instanceName:n.name,token:n.token,data:h}),Z.success(t("typebot.toast.success.create")),c(!1),e()}catch(h){console.error("Error:",h),Z.error(`Error: ${(f=(p=(d=h==null?void 0:h.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return i.jsxs(pt,{open:a,onOpenChange:c,children:[i.jsx(vt,{asChild:!0,children:i.jsxs($,{size:"sm",children:[i.jsx(Yr,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("typebot.button.create")})]})}),i.jsxs(lt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(ct,{children:i.jsx(yt,{children:t("typebot.form.title")})}),i.jsx(_A,{onSubmit:u,isModal:!0,isLoading:s})]})]})}const Ooe=e=>["typebot","getTypebot",JSON.stringify(e)],Ioe=async({instanceName:e,token:t,typebotId:n})=>{const r=await le.get(`/typebot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Doe=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return We({...s,queryKey:Ooe({instanceName:t}),queryFn:()=>Ioe({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Aoe({typebotId:e,resetTable:t}){const{t:n}=Ee(),{instance:r}=He(),s=Qt(),[o,a]=v.useState(!1),{deleteTypebot:c,updateTypebot:u}=Om(),{data:l,isLoading:d}=Doe({instanceName:r==null?void 0:r.name,typebotId:e}),p=v.useMemo(()=>({enabled:!!(l!=null&&l.enabled),description:(l==null?void 0:l.description)??"",url:(l==null?void 0:l.url)??"",typebot:(l==null?void 0:l.typebot)??"",triggerType:(l==null?void 0:l.triggerType)??"",triggerOperator:(l==null?void 0:l.triggerOperator)??"",triggerValue:l==null?void 0:l.triggerValue,expire:(l==null?void 0:l.expire)??0,keywordFinish:l==null?void 0:l.keywordFinish,delayMessage:(l==null?void 0:l.delayMessage)??0,unknownMessage:l==null?void 0:l.unknownMessage,listeningFromMe:!!(l!=null&&l.listeningFromMe),stopBotFromMe:!!(l!=null&&l.stopBotFromMe),keepOpen:!!(l!=null&&l.keepOpen),debounceTime:(l==null?void 0:l.debounceTime)??0}),[l==null?void 0:l.debounceTime,l==null?void 0:l.delayMessage,l==null?void 0:l.description,l==null?void 0:l.enabled,l==null?void 0:l.expire,l==null?void 0:l.keepOpen,l==null?void 0:l.keywordFinish,l==null?void 0:l.listeningFromMe,l==null?void 0:l.stopBotFromMe,l==null?void 0:l.triggerOperator,l==null?void 0:l.triggerType,l==null?void 0:l.triggerValue,l==null?void 0:l.typebot,l==null?void 0:l.unknownMessage,l==null?void 0:l.url]),f=async g=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:g.enabled,description:g.description,url:g.url,typebot:g.typebot||"",triggerType:g.triggerType,triggerOperator:g.triggerOperator||"",triggerValue:g.triggerValue||"",expire:g.expire||0,keywordFinish:g.keywordFinish||"",delayMessage:g.delayMessage||1e3,unknownMessage:g.unknownMessage||"",listeningFromMe:g.listeningFromMe||!1,stopBotFromMe:g.stopBotFromMe||!1,keepOpen:g.keepOpen||!1,debounceTime:g.debounceTime||0};await u({instanceName:r.name,typebotId:e,data:y}),Z.success(n("typebot.toast.success.update")),t(),s(`/manager/instance/${r.id}/typebot/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),Z.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},h=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,typebotId:e}),Z.success(n("typebot.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/typebot`)):console.error("instance not found")}catch(g){console.error("Erro ao excluir dify:",g)}};return d?i.jsx(un,{}):i.jsx("div",{className:"m-4",children:i.jsx(_A,{initialData:p,onSubmit:f,typebotId:e,handleDelete:h,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function bE(){const{t:e}=Ee(),t=Uo("(min-width: 768px)"),{instance:n}=He(),{typebotId:r}=Zr(),{data:s,isLoading:o,refetch:a}=TA({instanceName:n==null?void 0:n.name,token:n==null?void 0:n.token}),c=Qt(),u=d=>{n&&c(`/manager/instance/${n.id}/typebot/${d}`)},l=()=>{a()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("typebot.title")}),i.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[i.jsx(NA,{}),i.jsx(Toe,{}),i.jsx(Poe,{resetTable:l})]})]}),i.jsx(mt,{className:"my-4"}),i.jsxs(Bo,{direction:t?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(un,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>i.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:d.description?i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"text-base",children:d.description}),i.jsxs("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:[d.url," - ",d.typebot]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"text-base",children:d.url}),i.jsx("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:d.typebot})]})},d.id)):i.jsx($,{variant:"link",children:e("typebot.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(zo,{withHandle:!0,className:"border border-black"}),i.jsx(Cn,{children:i.jsx(Aoe,{typebotId:r,resetTable:l})})]})]})]})}const Foe=e=>["webhook","fetchWebhook",JSON.stringify(e)],Loe=async({instanceName:e,token:t})=>(await le.get(`/webhook/find/${e}`,{headers:{apiKey:t}})).data,$oe=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Foe({instanceName:t,token:n}),queryFn:()=>Loe({instanceName:t,token:n}),enabled:!!t})},Boe=async({instanceName:e,token:t,data:n})=>(await le.post(`/webhook/set/${e}`,{webhook:n},{headers:{apikey:t}})).data;function zoe(){return{createWebhook:Ae(Boe,{invalidateKeys:[["webhook","fetchWebhook"]]})}}const Uoe=j.object({enabled:j.boolean(),url:j.string().url("Invalid URL format"),events:j.array(j.string()),base64:j.boolean(),byEvents:j.boolean()});function Voe(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{createWebhook:s}=zoe(),{data:o}=$oe({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=$t({resolver:Bt(Uoe),defaultValues:{enabled:!1,url:"",events:[],base64:!1,byEvents:!1}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,url:o.url,events:o.events,base64:o.webhookBase64,byEvents:o.webhookByEvents})},[o]);const c=async p=>{var f,h,g;if(t){r(!0);try{const m={enabled:p.enabled,url:p.url,events:p.events,base64:p.base64,byEvents:p.byEvents};await s({instanceName:t.name,token:t.token,data:m}),Z.success(e("webhook.toast.success"))}catch(m){console.error(e("webhook.toast.error"),m),Z.error(`Error: ${(g=(h=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:h.response)==null?void 0:g.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],l=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Lo,{...a,children:i.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("webhook.title")}),i.jsx(Ka,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(he,{name:"enabled",label:e("webhook.form.enabled.label"),className:"w-full justify-between",helper:e("webhook.form.enabled.description")}),i.jsx(z,{name:"url",label:"URL",children:i.jsx(L,{})}),i.jsx(he,{name:"byEvents",label:e("webhook.form.byEvents.label"),className:"w-full justify-between",helper:e("webhook.form.byEvents.description")}),i.jsx(he,{name:"base64",label:e("webhook.form.base64.label"),className:"w-full justify-between",helper:e("webhook.form.base64.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx($,{variant:"outline",type:"button",onClick:l,children:e("button.markAll")}),i.jsx($,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),i.jsx($o,{control:a.control,name:"events",render:({field:p})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(fr,{className:"my-2 text-lg",children:e("webhook.form.events.label")}),i.jsx(Ss,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,h)=>f.localeCompare(h)).map(f=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(fr,{className:ve("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),i.jsx(Yc,{checked:p.value.includes(f),onCheckedChange:h=>{h?p.onChange([...p.value,f]):p.onChange(p.value.filter(g=>g!==f))}})]},f))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx($,{type:"submit",disabled:n,children:e(n?"webhook.button.saving":"webhook.button.save")})})]})})})})}const Hoe=e=>["websocket","fetchWebsocket",JSON.stringify(e)],qoe=async({instanceName:e,token:t})=>(await le.get(`/websocket/find/${e}`,{headers:{apiKey:t}})).data,Koe=e=>{const{instanceName:t,token:n,...r}=e;return We({...r,queryKey:Hoe({instanceName:t,token:n}),queryFn:()=>qoe({instanceName:t,token:n}),enabled:!!t})},Woe=async({instanceName:e,token:t,data:n})=>(await le.post(`/websocket/set/${e}`,{websocket:n},{headers:{apikey:t}})).data;function Goe(){return{createWebsocket:Ae(Woe,{invalidateKeys:[["websocket","fetchWebsocket"]]})}}const Joe=j.object({enabled:j.boolean(),events:j.array(j.string())});function Qoe(){const{t:e}=Ee(),{instance:t}=He(),[n,r]=v.useState(!1),{createWebsocket:s}=Goe(),{data:o}=Koe({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=$t({resolver:Bt(Joe),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,h,g;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),Z.success(e("websocket.toast.success"))}catch(m){console.error(e("websocket.toast.error"),m),Z.error(`Error: ${(g=(h=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:h.response)==null?void 0:g.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],l=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Lo,{...a,children:i.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("websocket.title")}),i.jsx(Ka,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(he,{name:"enabled",label:e("websocket.form.enabled.label"),className:"w-full justify-between",helper:e("websocket.form.enabled.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx($,{variant:"outline",type:"button",onClick:l,children:e("button.markAll")}),i.jsx($,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),i.jsx($o,{control:a.control,name:"events",render:({field:p})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(fr,{className:"my-2 text-lg",children:e("websocket.form.events.label")}),i.jsx(Ss,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,h)=>f.localeCompare(h)).map(f=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(fr,{className:ve("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),i.jsx(Yc,{checked:p.value.includes(f),onCheckedChange:h=>{h?p.onChange([...p.value,f]):p.onChange(p.value.filter(g=>g!==f))}})]},f))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx($,{type:"submit",disabled:n,children:e(n?"websocket.button.saving":"websocket.button.save")})})]})})})})}const MA=v.createContext({instance:null,isLoading:!0,error:null});function Zoe({children:e}){const[t]=uf(),[n,r]=v.useState(null),[s,o]=v.useState(!0),[a,c]=v.useState(null);return v.useEffect(()=>{(async()=>{const l=t.get("token"),d=t.get("instanceName");if(!l||!d){c("Token e instanceName são obrigatórios"),o(!1);return}try{const p="https://integracaov2.icommarketing.com.br";localStorage.setItem(wn.API_URL,p),localStorage.setItem(wn.INSTANCE_TOKEN,l);const{data:f}=await Lt.get(`${p}/instance/fetchInstances?instanceName=${d}`,{headers:{apikey:l}});console.log("API Response:",f),f&&Array.isArray(f)&&f.length>0?r(f[0]):c("Instância não encontrada")}catch{c("Erro ao validar token ou buscar instância")}finally{o(!1)}})()},[t]),i.jsx(MA.Provider,{value:{instance:n,isLoading:s,error:a},children:e})}const H0=()=>v.useContext(MA),q0=v.createContext({}),Yoe=({children:e})=>{const[t,n]=v.useState(null);return i.jsx(q0.Provider,{value:{replyingMessage:t,setReplyingMessage:n},children:e})},Xoe=e=>{const t=Math.floor(e/60),n=e%60,r=t<10?`${t}`:t,s=n<10?`0${n}`:n;return`${r}:${s}`},xE=200,eae=({imageMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:e==null?void 0:e.mediaUrl,alt:"Quoted message",width:100,height:100}),i.jsx(Pz,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),tae=({videoMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:e==null?void 0:e.mediaUrl,alt:"Quoted message",width:100,height:100}),i.jsx(Gz,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),nae=({audioMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(__,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:Xoe(e.seconds)})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.fileName})]}),rae=({stickerMessage:e})=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:e.mediaUrl,alt:"Sticker",width:100,height:100}),i.jsx(Hz,{className:"h-6 w-6 text-muted-foreground"})]}),sae=({documentMessage:e})=>i.jsx("div",{className:"flex flex-col gap-2",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Tw,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]})}),oae=({documentMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Tw,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),aae=({contactMessage:e})=>i.jsx("div",{className:"flex flex-col gap-2",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(_h,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.displayName})]})}),iae=({locationMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Bz,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.name})]}),i.jsx("span",{className:"inline-block max-w-40 text-sm text-muted-foreground",children:e.address})]}),lae=({conversation:e})=>i.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.length>xE?`${e.substring(0,xE)}...`:e}),cae=({chat:e})=>{const{replyingMessage:t,setReplyingMessage:n}=v.useContext(q0),r=()=>{n(null)},s=l=>{var d,p,f,h;return l!=null&&l.conversation?l.conversation:(h=(f=(p=(d=l==null?void 0:l.viewOnceMessage)==null?void 0:d.message)==null?void 0:p.interactiveMessage)==null?void 0:f.body)!=null&&h.text?l.viewOnceMessage.message.interactiveMessage.body.text:""},o=()=>t!=null&&t.key.fromMe?"Você":e==null?void 0:e.pushName,a=()=>{if((t==null?void 0:t.messageType)==="imageMessage")return i.jsx(eae,{imageMessage:{caption:t==null?void 0:t.message.imageMessage.caption,mediaUrl:t==null?void 0:t.message.mediaUrl}});if((t==null?void 0:t.messageType)==="videoMessage")return i.jsx(tae,{videoMessage:{caption:t==null?void 0:t.message.videoMessage.caption,mediaUrl:t==null?void 0:t.message.mediaUrl}});if((t==null?void 0:t.messageType)==="audioMessage")return i.jsx(nae,{audioMessage:t==null?void 0:t.message.audioMessage});if((t==null?void 0:t.messageType)==="stickerMessage")return i.jsx(rae,{stickerMessage:t==null?void 0:t.message});if((t==null?void 0:t.messageType)==="documentMessage")return i.jsx(sae,{documentMessage:{name:t==null?void 0:t.message.documentMessage.name,mediaUrl:t==null?void 0:t.message.mediaUrl}});if((t==null?void 0:t.messageType)==="documentWithCaptionMessage")return i.jsx(oae,{documentMessage:{name:t==null?void 0:t.message.documentWithCaptionMessage.message.documentMessage.name,caption:t==null?void 0:t.message.documentWithCaptionMessage.message.documentMessage.caption,mediaUrl:t==null?void 0:t.message.mediaUrl}});if((t==null?void 0:t.messageType)==="contactMessage")return i.jsx(aae,{contactMessage:t==null?void 0:t.message.contactMessage});if((t==null?void 0:t.messageType)==="locationMessage")return i.jsx(iae,{locationMessage:t==null?void 0:t.message.locationMessage});if((t==null?void 0:t.messageType)==="conversation"||(t==null?void 0:t.messageType)==="interactiveMessage"||(t==null?void 0:t.messageType)==="extendedTextMessage")return i.jsx(lae,{conversation:s(t==null?void 0:t.message)})},{inputIconsMainColor:c,inputBackgroundColor:u}=Qa();return i.jsxs("div",{className:"relative flex items-center overflow-hidden rounded-lg dark:text-white",style:{backgroundColor:u},children:[i.jsx("div",{className:`absolute h-full w-1 rounded-l-lg ${t!=null&&t.key.fromMe?"bg-blue-700 dark:bg-blue-300":"bg-blue-100"}`}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 p-2 pl-4",children:[i.jsx("span",{className:`text-sm font-bold ${t!=null&&t.key.fromMe?"text-blue-700 dark:text-blue-300":"text-blue-600"}`,children:o()}),a()]}),i.jsx($,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 shrink-0 rounded-full",onClick:r,style:{backgroundColor:u,color:c},children:i.jsx(Nw,{className:"h-6 w-6"})})]})},oy=[{name:"Smileys",icon:M_,emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇"]},{name:"Natureza",icon:n1,emojis:["🌿","🌱","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻"]},{name:"Comida",icon:n1,emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍒","🍑"]},{name:"Atividades",icon:Cz,emojis:["⚽️","🏀","🏈","⚾️","🎾","🏐","🏉","🎱","🏓","🏸"]},{name:"Viagem",icon:vz,emojis:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐"]},{name:"Objetos",icon:Lz,emojis:["💡","🔦","🕯","🧳","⌛️","⏳","🌡","🧪","🧬","🔬"]},{name:"Símbolos",icon:Mz,emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔"]}];function uae({handleEmojiClick:e}){const{inputIconsMainColor:t}=Qa(),n=r=>{var o;return((o=oy.find(a=>a.name===r))==null?void 0:o.emojis)||[]};return i.jsxs(Rr,{children:[i.jsx(Pr,{asChild:!0,children:i.jsxs($,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[i.jsx(M_,{className:"h-6 w-6",style:{color:t}}),i.jsx("span",{className:"sr-only",children:"Emojis"})]})}),i.jsx(tr,{className:"bg-background p-2",align:"end",children:i.jsxs(M0,{defaultValue:"Smileys",className:"w-full",children:[i.jsx(wm,{className:"grid grid-cols-8 gap-2",children:oy.map(r=>i.jsx(Rc,{value:r.name,children:i.jsx(r.icon,{className:"h-5 w-5"})},r.name))}),oy.map(r=>i.jsx(Pc,{value:r.name,children:i.jsx("div",{className:"grid grid-cols-8 gap-2",children:n(r.name).map((s,o)=>i.jsx($,{variant:"ghost",className:"h-12 p-2 text-2xl",onClick:()=>e(s),children:s},o))})},r.name))]})})]})}const dae=({isSendingMessage:e,isRecording:t,audioBlob:n,elapsedTime:r,startRecording:s,stopRecording:o,clearRecording:a,sendAudioMessage:c,disabled:u})=>{const{inputIconsMainColor:l}=Qa();return i.jsxs("div",{className:"flex items-center gap-2",children:[t&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:o,children:i.jsx(Vz,{className:"h-6 w-6 text-[#b03f3f]"})}),i.jsxs("span",{children:[r,"s"]})]}),n&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e,onClick:a,children:i.jsx(Kz,{className:"h-6 w-6 text-[#b03f3f]"})}),i.jsx("audio",{controls:!0,src:URL.createObjectURL(n)})]}),i.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e||t||u,onClick:n?c:s,children:e?i.jsx(un,{className:"h-6 w-6",style:{color:l}}):n?i.jsx(jw,{className:"h-6 w-6",style:{color:l}}):i.jsx(__,{className:"h-6 w-6",style:{color:l}})})]})},fae=({isSendingMessage:e,sendMessage:t,disabled:n})=>{const{inputIconsMainColor:r}=Qa();return i.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:t,disabled:e||n,children:e?i.jsx(un,{className:"h-6 w-6",style:{color:r}}):i.jsx(jw,{className:"h-6 w-6",style:{color:r}})})},pae=({chat:e})=>{const[t]=uf(),{inputBackgroundColor:n,inputTextForegroundColor:r}=Qa(),s=t.get("remoteJid"),{instance:o}=H0(),{sendText:a}=CD(),{sendMedia:c}=kD(),{sendAudio:u}=Nee(),{replyingMessage:l,setReplyingMessage:d}=v.useContext(q0),p=v.useRef(null),f=v.useRef(null),h=v.useRef(null),[g,m]=v.useState(""),[x,b]=v.useState(!1),[y,w]=v.useState(null),[S,k]=v.useState(!1),[C,T]=v.useState(null),[E,N]=v.useState(0),{t:P}=Ee();v.useEffect(()=>{d(null),w(null)},[s,d,w]);const q=Q=>{if(m(Q.target.value),p.current){p.current.style.height="auto";const ne=p.current.scrollHeight,W=parseInt(getComputedStyle(p.current).lineHeight)*10;p.current.style.height=`${Math.min(ne,W)}px`}},O=Q=>{if(m(ne=>ne+Q),p.current){p.current.style.height="auto";const ne=p.current.scrollHeight,W=parseInt(getComputedStyle(p.current).lineHeight)*10;p.current.style.height=`${Math.min(ne,W)}px`}},Y=async()=>{try{k(!0);const Q=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:44100,echoCancellation:!0,noiseSuppression:!0}});let ne="";const re=["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","audio/opus"];for(const je of re)if(MediaRecorder.isTypeSupported(je)){ne=je;break}if(!ne)throw new Error("Nenhum formato aceito pela Meta disponível");const W=new MediaRecorder(Q,{mimeType:ne,audioBitsPerSecond:128e3});h.current=W;const ge=[];W.ondataavailable=je=>{je.data.size>0&&ge.push(je.data)},W.onstop=()=>{const je=new Blob(ge,{type:ne}),Pe=new File([je],`audio.${ne.split("/")[1]}`,{type:ne,lastModified:Date.now()});T(Pe)},W.start(),f.current=setInterval(()=>{N(je=>je+1)},1e3)}catch(Q){console.error("Erro ao iniciar gravação:",Q),Z.error(P("chat.toast.recordingError")),k(!1)}},B=()=>{h.current&&(h.current.stop(),f.current&&clearInterval(f.current),k(!1))},ee=()=>{T(null),N(0)},K=Q=>{var ne,re,W;console.error("Error to send message",Q),Z.error(y_(Q)?`${P("chat.toast.error")}: ${(W=(re=(ne=Q==null?void 0:Q.response)==null?void 0:ne.data)==null?void 0:re.response)==null?void 0:W.message}`:P("chat.toast.sendError"))},V=()=>{b(!1),d(null)},A=async()=>{if(!(o!=null&&o.name)||!(o!=null&&o.token)||!s)return;const Q={instanceName:o.name,token:o.token,data:{number:s,text:g}};await a(Q,{onSuccess:()=>{m(""),p.current&&(p.current.style.height="auto")},onError:K,onSettled:V})},D=async()=>{if(!(!(o!=null&&o.name)||!(o!=null&&o.token)||!y||!s)){b(!0);try{const Q=await new Promise((re,W)=>{const ge=new FileReader;ge.readAsDataURL(y),ge.onload=()=>{const Pe=ge.result.split(",")[1];re(Pe)},ge.onerror=W}),ne={instanceName:o.name,token:o.token,data:{number:s,mediaMessage:{mediatype:y.type.split("/")[0]==="application"?"document":y.type.split("/")[0],mimetype:y.type,caption:g,media:Q,fileName:y.name}}};await c(ne,{onSuccess:()=>{w(null),m(""),p.current&&(p.current.style.height="auto")},onError:K,onSettled:V})}catch(Q){console.error("Error converting media to base64:",Q),K(Q),b(!1)}}},X=async()=>{if(!(!(o!=null&&o.name)||!(o!=null&&o.token)||!C||!s)){b(!0);try{const Q=await new Promise((re,W)=>{const ge=new FileReader;ge.readAsDataURL(C),ge.onload=()=>{const Pe=ge.result.split(",")[1];re(Pe)},ge.onerror=W}),ne={instanceName:o.name,token:o.token,data:{number:s,audioMessage:{audio:Q}}};await u(ne,{onSuccess:()=>{T(null),N(0)},onError:K,onSettled:V})}catch(Q){console.error("Error converting audio to base64:",Q),K(Q),b(!1)}}},se=async()=>{b(!0),y?await D():await A()},H=()=>!g&&!y?i.jsx(dae,{isSendingMessage:x,isRecording:S,audioBlob:C,elapsedTime:E,startRecording:Y,stopRecording:B,clearRecording:ee,sendAudioMessage:X}):i.jsx(fae,{isSendingMessage:x,sendMessage:se}),oe=()=>S||C?H():i.jsxs(i.Fragment,{children:[i.jsx(uae,{handleEmojiClick:O}),i.jsx(jD,{instance:o,setSelectedMedia:w}),i.jsx(Pi,{placeholder:P("chat.message.placeholder"),name:"message",id:"message",rows:1,ref:p,value:g,onChange:q,onKeyDown:Q=>{!Q.shiftKey&&Q.key==="Enter"&&!x&&(Q.preventDefault(),se())},className:"min-h-0 w-full resize-none rounded-lg border-none p-3 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 focus-visible:ring-offset-transparent",style:{backgroundColor:n,color:r}}),H()]});return o?i.jsxs("div",{className:"input-container",children:[y&&i.jsx(TD,{selectedMedia:y,setSelectedMedia:w}),l&&i.jsx(cae,{chat:e}),i.jsx("div",{className:`flex items-end ${(S||C)&&"justify-end"} rounded-3xl px-4 py-1`,style:{backgroundColor:n,color:r},children:oe()})]}):i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground",children:P("chat.noInstance")||"Nenhuma instância selecionada"})})},hae=j.object({remoteJid:j.string().min(1)});function gae({onSuccess:e}){const{t}=Ee(),{primaryColor:n}=Qa(),r=$t({resolver:Bt(hae),defaultValues:{remoteJid:""}}),s=o=>{e(o)};return i.jsx(Lo,{...r,children:i.jsxs("form",{onSubmit:r.handleSubmit(s),children:[i.jsx($o,{control:r.control,name:"remoteJid",render:({field:o})=>i.jsxs(no,{children:[i.jsx(fr,{children:t("chat.newChat.contact")}),i.jsx(Ss,{children:i.jsx(L,{type:"text",placeholder:t("chat.newChat.placeholder"),...o})})]})}),i.jsx("div",{className:"flex justify-end",children:i.jsx($,{type:"submit",className:"mt-4",style:{backgroundColor:n},children:t("chat.newChat.submit")})})]})})}function mae({isOpen:e,setIsOpen:t}){const[n]=uf(),{t:r}=Ee(),s=Qt(),o=a=>{const c=new URLSearchParams(n);c.set("remoteJid",a.remoteJid),s(`/manager/embed-chat?${c.toString()}`),t(!1)};return i.jsx(pt,{open:e,onOpenChange:t,children:i.jsxs(lt,{className:"max-w-2xl",children:[i.jsxs(ct,{children:[i.jsx(yt,{children:r("chat.newChat.title")}),i.jsx(eo,{children:r("chat.newChat.description")})]}),i.jsx(gae,{onSuccess:o})]})})}const ay=e=>e?e.replace("@s.whatsapp.net","").replace("@g.us",""):"";function vae(){const[e]=uf(),{backgroundColor:t,textForegroundColor:n,primaryColor:r}=Qa(),s=Uo("(min-width: 768px)"),{t:o}=Ee(),a=Qt(),c=e.get("token"),{remoteJid:u}=Zr(),l=u||e.get("remoteJid"),[d,p]=v.useState([]),f=v.useRef(null),h=v.useRef(null),[g,m]=v.useState(null),[x,b]=v.useState(!1),{instance:y}=H0(),w=k=>{const C=new URLSearchParams(e);a(`/manager/embed-chat/${encodeURIComponent(k.remoteJid||k.id)}?${C.toString()}`)};v.useEffect(()=>{if(!(y!=null&&y.name))return;let k=!0;return(async()=>{try{const{data:T}=await le.post(`/chat/findChats/${y.name}`,{where:{}},{headers:{apikey:c||y.token}});k&&p(T||[])}catch(T){k&&(console.error("Erro ao buscar chats:",T),Z.error("Erro ao buscar chats"))}})(),()=>{k=!1}},[y==null?void 0:y.name,c]),v.useEffect(()=>{if(!y)return;const k="https://icom-socket-gateway.icommarketing.com.br",C=localStorage.getItem("accessToken");c&&localStorage.setItem("accessToken",c);const T=A0(k);function E(N,P){y&&P.instance===y.name&&p(q=>{var K,V,A,D,X;const O=(V=(K=P==null?void 0:P.data)==null?void 0:K.key)==null?void 0:V.remoteJid,Y=q.findIndex(se=>se.remoteJid&&se.remoteJid===O||se.id&&se.id===O),B=Y!==-1?q[Y]:null,ee={id:O,remoteJid:O,pushName:(B==null?void 0:B.pushName)||((A=P==null?void 0:P.data)==null?void 0:A.pushName)||ay(O),profilePicUrl:(B==null?void 0:B.profilePicUrl)||((X=(D=P==null?void 0:P.data)==null?void 0:D.key)==null?void 0:X.profilePictureUrl)||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",updatedAt:new Date().toISOString(),labels:(B==null?void 0:B.labels)||[],createdAt:(B==null?void 0:B.createdAt)||new Date().toISOString(),instanceId:y.id};if(Y!==-1){const se=[...q];return se[Y]={...B,updatedAt:ee.updatedAt},se}else return[...q,ee]})}return T.on("messages.upsert",N=>{E("messages.upsert",N)}),T.on("send.message",N=>{E("send.message",N)}),T.on("messages.update",N=>{}),T.connect(),()=>{T.off("messages.upsert"),T.off("send.message"),T.off("messages.update"),F0(T),c?localStorage.setItem("accessToken",C||""):localStorage.removeItem("accessToken")}},[y,l,c]),v.useEffect(()=>{if(l){const k=d.find(C=>C.id===l);m(k||null)}},[l,d]);const S={backgroundColor:t,color:n};return i.jsx("div",{className:"relative h-full",style:S,children:i.jsxs(Bo,{direction:s?"horizontal":"vertical",children:[i.jsx(Cn,{defaultSize:30,minSize:20,maxSize:60,children:i.jsxs("div",{className:"hidden flex-col gap-2 text-foreground md:flex",style:S,children:[i.jsx("div",{className:"sticky top-0 p-2",children:i.jsxs($,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",onClick:()=>b(!0),style:{backgroundColor:r,color:n},children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:i.jsx(Cc,{className:"h-4 w-4"})}),i.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:o("chat.title")}),i.jsx(Yr,{className:"h-4 w-4"})]})}),i.jsxs(M0,{defaultValue:"contacts",children:[i.jsxs(wm,{className:"tabs-chat",children:[i.jsx(Rc,{value:"contacts",className:"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",style:{"--primary":r||"#e2e8f0","--primary-foreground":n||"#000000"},children:o("chat.contacts")}),i.jsx(Rc,{value:"groups",className:"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",style:{"--primary":r||"#e2e8f0","--primary-foreground":n||"#000000"},children:o("chat.groups")})]}),i.jsx(Pc,{value:"contacts",children:i.jsx("div",{className:"contacts-container",children:i.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[i.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.contacts")}),d==null?void 0:d.sort((k,C)=>new Date(C.lastMessage.messageTimestamp).getTime()-new Date(k.lastMessage.messageTimestamp).getTime()).map(k=>(k==null?void 0:k.id)&&!k.id.includes("@g.us")&&i.jsxs("div",{onClick:()=>w(k),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:l===k.id?r:""},children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsx("img",{src:k.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"chat-title font-medium",style:{color:n},children:k.pushName||ay(k.id)}),i.jsx("span",{className:"text-xs",style:{color:n}})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("span",{className:"text-xs font-bold",style:{color:n},children:[o("chat.recent"),":"," "]}),i.jsx("span",{className:"block truncate text-xs",style:{color:n}})]})]})]},k.id))]})})}),i.jsx(Pc,{value:"groups",children:i.jsx("div",{className:"contacts-container",children:i.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[i.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.groups")}),d==null?void 0:d.sort((k,C)=>new Date(C.lastMessage.messageTimestamp).getTime()-new Date(k.lastMessage.messageTimestamp).getTime()).map(k=>(k==null?void 0:k.id)&&k.id.includes("@g.us")&&i.jsxs("div",{onClick:()=>w(k),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:l===k.id?r:""},children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsx("img",{src:k.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"chat-title font-medium",children:k.pushName}),i.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("span",{className:"text-xs font-bold text-gray-500 dark:text-gray-400",children:[o("chat.recent")," "]}),i.jsx("span",{className:"block truncate text-xs text-gray-500"})]})]})]},k.id))]})})})]})]})}),i.jsx(zo,{withHandle:!0}),i.jsxs(Cn,{style:S,children:[l&&i.jsx(Yoe,{children:i.jsxs("div",{className:"flex h-full flex-col justify-between",style:S,children:[i.jsx("div",{className:"flex items-center gap-3 p-3",children:i.jsxs("div",{className:"flex flex-1 items-center gap-3",children:[i.jsx("img",{src:(g==null?void 0:g.profilePicUrl)||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-10 w-10 rounded-full"}),i.jsx("div",{className:"flex flex-col",children:i.jsx("span",{className:"font-medium",children:(g==null?void 0:g.pushName)||ay(l)})})]})}),i.jsx(ND,{textareaRef:f,handleTextareaChange:()=>{},textareaHeight:"auto",lastMessageRef:h,scrollToBottom:()=>{h.current&&h.current.scrollIntoView({behavior:"smooth"})}}),i.jsx(pae,{chat:g})]})}),i.jsx(mae,{isOpen:x,setIsOpen:b})]})]})})}function yae(){const{instance:e,isLoading:t,error:n}=H0();return t?i.jsx("div",{className:"flex h-screen items-center justify-center",children:i.jsx(un,{})}):n?i.jsx("div",{className:"flex h-screen items-center justify-center",children:i.jsx("div",{className:"rounded-md bg-red-50 p-4 dark:bg-red-900",children:i.jsx("span",{className:"text-red-800 dark:text-red-200",children:n})})}):e?i.jsx("div",{className:"h-screen",children:i.jsx(vae,{})}):null}function wE(){return i.jsx(pj,{client:qN,children:i.jsx(WR,{children:i.jsx(Zoe,{children:i.jsx(_ee,{children:i.jsx(yae,{})})})})})}const bae=async({url:e,token:t})=>{try{const{data:n}=await Lt.post(`${e}/verify-creds`,{},{headers:{apikey:t}});return KN({facebookAppId:n.facebookAppId,facebookConfigId:n.facebookConfigId,facebookUserToken:n.facebookUserToken}),n}catch{return null}},xae=j.object({serverUrl:j.string({required_error:"serverUrl is required"}).url("URL inválida"),apiKey:j.string({required_error:"ApiKey is required"})});function wae(){const{t:e}=Ee(),t=Qt(),n=$t({resolver:Bt(xae),defaultValues:{serverUrl:window.location.protocol+"//"+window.location.host,apiKey:""}}),r=async s=>{const o=await b_({url:s.serverUrl});if(!o||!o.version){WN(),n.setError("serverUrl",{type:"manual",message:e("login.message.invalidServer")});return}if(!await bae({token:s.apiKey,url:s.serverUrl})){n.setError("apiKey",{type:"manual",message:e("login.message.invalidCredentials")});return}KN({version:o.version,clientName:o.clientName,url:s.serverUrl,token:s.apiKey}),t("/manager/")};return i.jsxs("div",{className:"flex min-h-screen flex-col",children:[i.jsx("div",{className:"flex items-center justify-center pt-2",children:i.jsx("img",{className:"h-10",src:"/assets/images/evolution-logo.png",alt:"logo"})}),i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsxs(fi,{className:"b-none w-[350px] shadow-none",children:[i.jsxs(pi,{children:[i.jsx(Qu,{className:"text-center",children:e("login.title")}),i.jsx(hP,{className:"text-center",children:e("login.description")})]}),i.jsx(Lo,{...n,children:i.jsxs("form",{onSubmit:n.handleSubmit(r),children:[i.jsx(hi,{children:i.jsxs("div",{className:"grid w-full items-center gap-4",children:[i.jsx(z,{required:!0,name:"serverUrl",label:e("login.form.serverUrl"),children:i.jsx(L,{})}),i.jsx(z,{required:!0,name:"apiKey",label:e("login.form.apiKey"),children:i.jsx(L,{type:"password"})})]})}),i.jsx(Xg,{className:"flex justify-center",children:i.jsx($,{className:"w-full",type:"submit",children:e("login.button.login")})})]})})]})}),i.jsx(Ew,{})]})}const Sae=C$([{path:"/manager/login",element:i.jsx(Y$,{children:i.jsx(wae,{})})},{path:"/manager/",element:i.jsx(Ot,{children:i.jsx(y8,{children:i.jsx(HY,{})})})},{path:"/manager/instance/:instanceId/dashboard",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(vte,{})})})},{path:"/manager/instance/:instanceId/chat",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(iE,{})})})},{path:"/manager/instance/:instanceId/chat/:remoteJid",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(iE,{})})})},{path:"/manager/instance/:instanceId/settings",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(loe,{})})})},{path:"/manager/instance/:instanceId/openai",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(yE,{})})})},{path:"/manager/instance/:instanceId/openai/:botId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(yE,{})})})},{path:"/manager/instance/:instanceId/webhook",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(Voe,{})})})},{path:"/manager/instance/:instanceId/websocket",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(Qoe,{})})})},{path:"/manager/instance/:instanceId/rabbitmq",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(roe,{})})})},{path:"/manager/instance/:instanceId/sqs",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(goe,{})})})},{path:"/manager/instance/:instanceId/chatwoot",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx($ee,{})})})},{path:"/manager/instance/:instanceId/typebot",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(bE,{})})})},{path:"/manager/instance/:instanceId/typebot/:typebotId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(bE,{})})})},{path:"/manager/instance/:instanceId/dify",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(pE,{})})})},{path:"/manager/instance/:instanceId/dify/:difyId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(pE,{})})})},{path:"/manager/instance/:instanceId/n8n",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(vE,{})})})},{path:"/manager/instance/:instanceId/n8n/:n8nId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(vE,{})})})},{path:"/manager/instance/:instanceId/evoai",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(hE,{})})})},{path:"/manager/instance/:instanceId/evoai/:evoaiId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(hE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(gE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot/:evolutionBotId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(gE,{})})})},{path:"/manager/instance/:instanceId/flowise",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(mE,{})})})},{path:"/manager/instance/:instanceId/flowise/:flowiseId",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(mE,{})})})},{path:"/manager/instance/:instanceId/proxy",element:i.jsx(Ot,{children:i.jsx(Ut,{children:i.jsx(Qse,{})})})},{path:"/manager/embed-chat",element:i.jsx(wE,{})},{path:"/manager/embed-chat/:remoteJid",element:i.jsx(wE,{})}]),Cae={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class rg{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Cae,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[c,u]=a;for(let l=0;l{let[c,u]=a;for(let l=0;l{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},SE=e=>e==null?"":""+e,kae=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Eae=/###/g,CE=e=>e&&e.indexOf("###")>-1?e.replace(Eae,"."):e,kE=e=>!e||typeof e=="string",rd=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let s=0;for(;s{const{obj:r,k:s}=rd(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),c=rd(e,a,Object);for(;c.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),c=rd(e,a,Object),c&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},jae=(e,t,n,r)=>{const{obj:s,k:o}=rd(e,t,Object);s[o]=s[o]||[],s[o].push(n)},sg=(e,t)=>{const{obj:n,k:r}=rd(e,t);if(n)return n[r]},Tae=(e,t,n)=>{const r=sg(e,n);return r!==void 0?r:sg(t,n)},RA=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):RA(e[r],t[r],n):e[r]=t[r]);return e},Sl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Nae={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const _ae=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Nae[t]):e;class Mae{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Rae=[" ",",","?","!",";"],Pae=new Mae(20),Oae=(e,t,n)=>{t=t||"",n=n||"";const r=Rae.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=Pae.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(e);if(!o){const a=e.indexOf(n);a>0&&!s.test(e.substring(0,a))&&(o=!0)}return o},mx=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o-1&&ue&&e.indexOf("_")>0?e.replace("_","-"):e;class jE extends Im{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&o?c.push(...r.split(o)):c.push(r)));const u=sg(this.data,c);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),u||!a||typeof r!="string"?u:mx(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(c=t.split("."),s=n,n=c[1]),this.addNamespaces(n),EE(this.data,c,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),s=r,r=n,n=c[1]),this.addNamespaces(n);let u=sg(this.data,c)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?RA(u,r,o):u={...u,...r},EE(this.data,c,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var PA={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const TE={};class ag extends Im{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),kae(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Hs.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Oae(t,r,s);if(a&&!c){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:o};const l=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),t=l.join(s)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(t[t.length-1],n),u=c[c.length-1],l=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&l.toLowerCase()==="cimode"){if(d){const S=n.nsSeparator||this.options.nsSeparator;return s?{res:`${u}${S}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${S}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a}const p=this.resolve(t,n);let f=p&&p.res;const h=p&&p.usedKey||a,g=p&&p.exactUsedKey||a,m=Object.prototype.toString.apply(f),x=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&x.indexOf(m)<0&&!(typeof b=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(p.res=S,p.usedParams=this.getUsedParamsDetails(n),p):S}if(o){const S=Array.isArray(f),k=S?[]:{},C=S?g:h;for(const T in f)if(Object.prototype.hasOwnProperty.call(f,T)){const E=`${C}${o}${T}`;k[T]=this.translate(E,{...n,joinArrays:!1,ns:c}),k[T]===E&&(k[T]=f[T])}f=k}}else if(y&&typeof b=="string"&&Array.isArray(f))f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let S=!1,k=!1;const C=n.count!==void 0&&typeof n.count!="string",T=ag.hasDefaultValue(n),E=C?this.pluralResolver.getSuffix(l,n.count,n):"",N=n.ordinal&&C?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):"",P=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),q=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${N}`]||n.defaultValue;!this.isValidLookup(f)&&T&&(S=!0,f=q),this.isValidLookup(f)||(k=!0,f=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&k?void 0:f,B=T&&q!==f&&this.options.updateMissing;if(k||S||B){if(this.logger.log(B?"updateKey":"missingKey",l,u,a,B?q:f),o){const A=this.resolve(a,{...n,keySeparator:!1});A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ee=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let A=0;A{const se=T&&X!==f?X:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(A,u,D,se,B,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(A,u,D,se,B,n),this.emit("missingKey",A,u,D,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?ee.forEach(A=>{const D=this.pluralResolver.getSuffixes(A,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&D.indexOf(`${this.options.pluralSeparator}zero`)<0&&D.push(`${this.options.pluralSeparator}zero`),D.forEach(X=>{V([A],a+X,n[`defaultValue${X}`]||q)})}):V(ee,a,q))}f=this.extendTranslation(f,t,n,p,r),k&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${u}:${a}`),(k||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,S?f:void 0):f=this.options.parseMissingKeyHandler(f))}return s?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(t,n,r,s,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(l){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let p=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||s.usedLng,r),l){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;d1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,c;return typeof t=="string"&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const l=this.extractFromKey(u,n),d=l.key;s=d;let p=l.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),g=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(x=>{this.isValidLookup(r)||(c=x,!TE[`${m[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(TE[`${m[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,d,b,x,n);else{let S;f&&(S=this.pluralResolver.getSuffix(b,n.count,n));const k=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(d+S),n.ordinal&&S.indexOf(C)===0&&y.push(d+S.replace(C,this.options.pluralSeparator)),h&&y.push(d+k)),g){const T=`${d}${this.options.contextSeparator}${n.context}`;y.push(T),f&&(y.push(T+S),n.ordinal&&S.indexOf(C)===0&&y.push(T+S.replace(C,this.options.pluralSeparator)),h&&y.push(T+k))}}let w;for(;w=y.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(b,x,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const iy=e=>e.charAt(0).toUpperCase()+e.slice(1);class NE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Hs.create("languageUtils")}getScriptPartFromCode(t){if(t=og(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=og(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=iy(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=iy(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=iy(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}let Iae=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Dae={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const Aae=["v1","v2","v3"],Fae=["v4"],_E={zero:0,one:1,two:2,few:3,many:4,other:5},Lae=()=>{const e={};return Iae.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Dae[t.fc]}})}),e};class $ae{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Hs.create("pluralResolver"),(!this.options.compatibilityJSON||Fae.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Lae(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=og(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const a=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=a,a}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>_E[s]-_E[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Aae.includes(this.options.compatibilityJSON)}}const ME=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Tae(e,t,n);return!o&&s&&typeof n=="string"&&(o=mx(e,n,r),o===void 0&&(o=mx(t,n,r))),o},ly=e=>e.replace(/\$/g,"$$$$");class Bae{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Hs.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:c,suffixEscaped:u,formatSeparator:l,unescapeSuffix:d,unescapePrefix:p,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:b,alwaysFormat:y}=t.interpolation;this.escape=n!==void 0?n:_ae,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Sl(o):a||"{{",this.suffix=c?Sl(c):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=d?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?Sl(f):h||Sl("$t("),this.nestingSuffix=g?Sl(g):m||Sl(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=b||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,a,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=h=>{if(h.indexOf(this.formatSeparator)<0){const b=ME(n,u,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...s,...n,interpolationkey:h}):b}const g=h.split(this.formatSeparator),m=g.shift().trim(),x=g.join(this.formatSeparator).trim();return this.format(ME(n,u,m,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>ly(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?ly(this.escape(h)):ly(h)}].forEach(h=>{for(c=0;o=h.regex.exec(t);){const g=o[1].trim();if(a=l(g),a===void 0)if(typeof d=="function"){const x=d(t,o,s);a=typeof x=="string"?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))a="";else if(p){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=SE(a));const m=h.safeValue(a);if(t=t.replace(o[0],m),p?(h.regex.lastIndex+=a.length,h.regex.lastIndex-=o[0].length):h.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const c=(u,l)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const p=u.split(new RegExp(`${d}[ ]*{`));let f=`{${p[1]}`;u=p[0],f=this.interpolate(f,a);const h=f.match(/'/g),g=f.match(/"/g);(h&&h.length%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),l&&(a={...l,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,m),`${u}${d}${f}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;s=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(p=>p.trim());s[1]=d.shift(),u=d,l=!0}if(o=n(c.call(this,s[1].trim(),a),a),o&&s[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=SE(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),l&&(o=u.reduce((d,p)=>this.format(d,p,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const zae=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[c,...u]=a.split(":"),l=u.join(":").trim().replace(/^'+|'+$/g,""),d=c.trim();n[d]||(n[d]=l),l==="false"&&(n[d]=!1),l==="true"&&(n[d]=!0),isNaN(l)||(n[d]=parseInt(l,10))}})}return{formatName:t,formatOptions:n}},Cl=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let c=t[a];return c||(c=e(og(r),s),t[a]=c),c(n)}};class Uae{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Hs.create("formatter"),this.options=t,this.formats={number:Cl((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:Cl((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:Cl((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:Cl((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:Cl((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Cl(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,u)=>{const{formatName:l,formatOptions:d}=zae(u);if(this.formats[l]){let p=c;try{const f=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},h=f.locale||f.lng||s.locale||s.lng||r;p=this.formats[l](c,h,{...d,...s,...f})}catch(f){this.logger.warn(f)}return p}else this.logger.warn(`there was no format function for ${l}`);return c},t)}}const Vae=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Hae extends Im{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Hs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},a={},c={},u={};return t.forEach(l=>{let d=!0;n.forEach(p=>{const f=`${l}|${p}`;!r.reload&&this.store.hasResourceBundle(l,p)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,d=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),u[p]===void 0&&(u[p]=!0)))}),d||(c[l]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const s=t.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(u=>{jae(u.loaded,[o],a),Vae(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{c[l]||(c[l]={});const d=u.loaded[l];d.length&&d.forEach(p=>{c[l][p]===void 0&&(c[l][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const c=(l,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(l&&d&&s{this.read.call(this,t,n,r,s+1,o*2,a)},o);return}a(l,d)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const l=u(t,n);l&&typeof l.then=="function"?l.then(d=>c(null,d)).catch(c):c(null,l)}catch(l){c(l)}return}return u(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,c)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,c),this.loaded(t,a,c)})}saveMissing(t,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let d;l.length===5?d=l(t,n,r,s,u):d=l(t,n,r,s),d&&typeof d.then=="function"?d.then(p=>c(null,p)).catch(c):c(null,d)}catch(d){c(d)}else l(t,n,r,s,c,u)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const RE=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),PE=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),vp=()=>{},qae=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Xd extends Im{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=PE(t),this.services={},this.logger=Hs,this.modules={external:[]},qae(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=RE();this.options={...s,...this.options,...PE(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Hs.init(o(this.modules.logger),this.options):Hs.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Uae);const p=new NE(this.options);this.store=new jE(this.options.resources,this.options);const f=this.services;f.logger=Hs,f.resourceStore=this.store,f.languageUtils=p,f.pluralResolver=new $ae(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=o(d),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Bae(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Hae(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var g=arguments.length,m=new Array(g>1?g-1:0),x=1;x1?g-1:0),x=1;x{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=vp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const u=Eu(),l=()=>{const d=(p,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(f),r(p,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vp;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(c=>a(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const s=Eu();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=vp),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&PA.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=Eu();this.emit("languageChanging",t);const o=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,l)=>{l?(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},c=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const l=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);l&&(this.language||o(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(l)),this.loadResources(l,d=>{a(d,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),s}getFixedT(t,n,r){var s=this;const o=function(a,c){let u;if(typeof c!="object"){for(var l=arguments.length,d=new Array(l>2?l-2:0),p=2;p`${u.keyPrefix}${f}${g}`):h=u.keyPrefix?`${u.keyPrefix}${f}${a}`:a,s.t(h,u)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(c,u)=>{const l=this.services.backendConnector.state[`${c}|${u}`];return l===-1||l===0||l===2};if(n.precheck){const c=n.precheck(this,a);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!s||a(o,t)))}loadNamespaces(t,n){const r=Eu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Eu();typeof t=="string"&&(t=[t]);const s=this.options.preload||[],o=t.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new NE(RE());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Xd(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vp;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Xd(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new jE(this.store.data,s),o.services.resourceStore=o.store),o.translator=new ag(o.services,s),o.translator.on("*",function(c){for(var u=arguments.length,l=new Array(u>1?u-1:0),d=1;d:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis,.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[16px\]{border-radius:16px}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-500\/20{border-color:#f59e0b33}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-black\/10{border-color:#0000001a}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-emerald-500\/20{border-color:#10b98133}.border-gray-600\/50{border-color:#4b556380}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-red-500\/20{border-color:#ef444433}.border-sky-500\/20{border-color:#0ea5e933}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-zinc-500\/20{border-color:#71717a33}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[\#b2ece0\]{--tw-bg-opacity: 1;background-color:rgb(178 236 224 / var(--tw-bg-opacity))}.bg-\[\#c8fff2\]{--tw-bg-opacity: 1;background-color:rgb(200 255 242 / var(--tw-bg-opacity))}.bg-\[\#d2e2e2\]{--tw-bg-opacity: 1;background-color:rgb(210 226 226 / var(--tw-bg-opacity))}.bg-\[\#e0f0f0\]{--tw-bg-opacity: 1;background-color:rgb(224 240 240 / var(--tw-bg-opacity))}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-amber-50\/50{background-color:#fffbeb80}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black\/10{background-color:#0000001a}.bg-black\/5{background-color:#0000000d}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-50\/50{background-color:#ecfdf580}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/30{background-color:hsl(var(--primary) / .3)}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity))}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-50\/50{background-color:#f0f9ff80}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity))}.bg-zinc-50\/50{background-color:#fafafa80}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[0\.375rem_1rem_0_1rem\]{padding:.375rem 1rem 0}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#008069\]{--tw-text-opacity: 1;color:rgb(0 128 105 / var(--tw-text-opacity))}.text-\[\#b03f3f\]{--tw-text-opacity: 1;color:rgb(176 63 63 / var(--tw-text-opacity))}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-900{--tw-text-opacity: 1;color:rgb(12 74 110 / var(--tw-text-opacity))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.caret-transparent{caret-color:transparent}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-muted-foreground{--tw-ring-color: hsl(var(--muted-foreground))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:bottom-\[12px\]:after{content:var(--tw-content);bottom:12px}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:border-\[8px\]:after{content:var(--tw-content);border-width:8px}.after\:border-solid:after{content:var(--tw-content);border-style:solid}.after\:bg-border:after{content:var(--tw-content);background-color:hsl(var(--border))}.hover\:bg-\[\#a4ecde\]:hover{--tw-bg-opacity: 1;background-color:rgb(164 236 222 / var(--tw-bg-opacity))}.hover\:bg-\[\#b2ece0\]:hover{--tw-bg-opacity: 1;background-color:rgb(178 236 224 / var(--tw-bg-opacity))}.hover\:bg-\[\#c2d2d2\]:hover{--tw-bg-opacity: 1;background-color:rgb(194 210 210 / var(--tw-bg-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-600\/80:hover{background-color:#d97706cc}.hover\:bg-amber-600\/90:hover{background-color:#d97706e6}.hover\:bg-black\/10:hover{background-color:#0000001a}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:stroke-destructive:hover{stroke:hsl(var(--destructive))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-transparent:focus-visible{--tw-ring-color: transparent}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.focus-visible\:ring-offset-transparent:focus-visible{--tw-ring-offset-color: transparent}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:opacity-100{opacity:1}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=active\]\:bg-primary[data-state=active],.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-slate-400[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=active\]\:text-primary-foreground[data-state=active]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-amber-500\/30:is(.dark *){border-color:#f59e0b4d}.dark\:border-emerald-500\/30:is(.dark *){border-color:#10b9814d}.dark\:border-red-500\/30:is(.dark *){border-color:#ef44444d}.dark\:border-sky-500\/30:is(.dark *){border-color:#0ea5e94d}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}.dark\:border-zinc-500\/30:is(.dark *){border-color:#71717a4d}.dark\:bg-\[\#082720\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 39 32 / var(--tw-bg-opacity))}.dark\:bg-\[\#0b332a\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 51 42 / var(--tw-bg-opacity))}.dark\:bg-\[\#0f1413\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 20 19 / var(--tw-bg-opacity))}.dark\:bg-\[\#1d2724\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(29 39 36 / var(--tw-bg-opacity))}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-blue-300:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(147 197 253 / var(--tw-bg-opacity))}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#10b9811a}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.dark\:bg-sky-500\/10:is(.dark *){background-color:#0ea5e91a}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}.dark\:bg-yellow-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(66 32 6 / var(--tw-bg-opacity))}.dark\:bg-zinc-500\/10:is(.dark *){background-color:#71717a1a}.dark\:text-\[\#00a884\]:is(.dark *){--tw-text-opacity: 1;color:rgb(0 168 132 / var(--tw-text-opacity))}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity))}.dark\:text-sky-200:is(.dark *){--tw-text-opacity: 1;color:rgb(186 230 253 / var(--tw-text-opacity))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.dark\:hover\:bg-\[\#071f19\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(7 31 25 / var(--tw-bg-opacity))}.dark\:hover\:bg-\[\#082720\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 39 32 / var(--tw-bg-opacity))}.dark\:hover\:bg-\[\#141a18\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(20 26 24 / var(--tw-bg-opacity))}.dark\:hover\:bg-white\/10:hover:is(.dark *){background-color:#ffffff1a}@media (min-width: 640px){.sm\:m-4{margin:1rem}.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-\[950px\]{max-width:950px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr_10rem\]{grid-template-columns:10rem 1fr 10rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:inline{display:inline}.md\:flex{display:flex}.md\:w-64{width:16rem}.md\:w-full{width:100%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-8{gap:2rem}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\*\]\:p-4>*{padding:1rem}.\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.\[\&\>\*\]\:py-2>*{padding-top:.5rem;padding-bottom:.5rem}.\[\&\>div\[style\]\]\:\!block>div[style]{display:block!important}.\[\&\>div\[style\]\]\:h-full>div[style]{height:100%}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:fill-rose-600>svg{fill:#e11d48}.\[\&\>svg\]\:text-amber-500>svg{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-emerald-600>svg{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-red-600>svg{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-sky-500>svg{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-zinc-400>svg{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.hover\:\[\&\>svg\]\:fill-rose-700>svg:hover{fill:#be123c}.dark\:\[\&\>svg\]\:text-emerald-400\/80>svg:is(.dark *){color:#34d399cc}.dark\:\[\&\>svg\]\:text-red-400\/80>svg:is(.dark *){color:#f87171cc}.dark\:\[\&\>svg\]\:text-zinc-300>svg:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_strong\]\:text-foreground strong{color:hsl(var(--foreground))}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: #e74c3c;--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient( to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55 );--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width : 480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}}.Toastify__toast{--y: 0;position:relative;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px #0000001a;display:flex;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;flex:1 1 auto;padding:6px;display:flex;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;flex:1}.Toastify__toast-icon{margin-inline-end:10px;width:20px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width : 480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.chat-item{display:flex;padding:10px;cursor:pointer;background-color:hsl(var(--background))}.chat-item:hover,.chat-item.active{background-color:#2f2f2f}.bubble{border-radius:16px;padding:12px;word-wrap:break-word;max-width:100%;overflow:hidden}.bubble-right .bubble{background-color:#0a0a0a;max-width:100%}.bubble-right .bubble>span{text-align:right;display:block}.bubble-left .bubble{background-color:#1b1b1b;max-width:100%}.bubble-right{align-self:flex-end;display:flex;justify-content:flex-end;width:80%}.bubble-left{align-self:flex-start;display:flex;justify-content:flex-start;width:80%}.input-message textarea{background-color:#2f2f2f;padding-left:48px}.input-message textarea:focus{outline:none;border:none;box-shadow:none}.message-container{flex:1;overflow-y:auto;max-height:calc(100vh - 110px);padding-top:50px}.tabs-chat{background-color:transparent;width:100%;border-radius:0}.contacts-container{height:calc(100vh - 180px);overflow-y:auto;display:flex;flex-direction:column}.chat-item{display:flex;padding:10px;cursor:pointer}.custom-scrollbar{scrollbar-width:none}.custom-scrollbar::-webkit-scrollbar{display:none}.input-container{position:sticky;bottom:0;display:flex;flex-direction:column;gap:.375rem;background-color:transparent;padding:.375rem 1rem;width:100%;max-width:48rem;margin:0 auto;box-sizing:border-box}.formatted-message{white-space:pre-wrap}.formatted-message p{margin-bottom:1em}.formatted-message strong{font-weight:700}.formatted-message em{font-style:italic}.formatted-message del{text-decoration:line-through}.formatted-message a{color:#170c96!important;text-decoration:underline!important}.highlight-quoted{animation:highlight 2s ease-out}@keyframes highlight{0%{background-color:#3b82f633}to{background-color:transparent}} diff --git a/manager/dist/index.html b/manager/dist/index.html index 286c2893..8a2e959e 100644 --- a/manager/dist/index.html +++ b/manager/dist/index.html @@ -5,8 +5,8 @@ Evolution Manager - - + +
diff --git a/src/api/integrations/channel/evolution/evolution.channel.service.ts b/src/api/integrations/channel/evolution/evolution.channel.service.ts index 820218b1..b5e12ca3 100644 --- a/src/api/integrations/channel/evolution/evolution.channel.service.ts +++ b/src/api/integrations/channel/evolution/evolution.channel.service.ts @@ -323,42 +323,45 @@ export class EvolutionStartupService extends ChannelStartupService { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'imageMessage', messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message?.mediaType === 'video') { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'videoMessage', messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message?.mediaType === 'audio') { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'audioMessage', messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; @@ -372,14 +375,15 @@ export class EvolutionStartupService extends ChannelStartupService { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'documentMessage', messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message.buttonMessage) { @@ -396,6 +400,7 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message.listMessage) { @@ -409,6 +414,7 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; } else { @@ -422,6 +428,7 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', + instanceName: this.instance.name, instanceId: this.instanceId, }; } @@ -449,7 +456,7 @@ export class EvolutionStartupService extends ChannelStartupService { } } - const base64 = messageRaw.message.base64; + const { base64 } = messageRaw.message; delete messageRaw.message.base64; if (base64 || file || audioFile) { From 407d254cf7031e7dd5c7788c619e23f56e591fc2 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 17:46:47 -0300 Subject: [PATCH 099/129] refactor(chatbot): streamline media message handling across chatbot services - Removed redundant instance name references in EvolutionStartupService to enhance data consistency. - Updated media message processing in various chatbot services to utilize base64 and mediaUrl more effectively, ensuring better handling of image messages. - Improved overall code readability and maintainability by simplifying media handling logic. --- .../evolution/evolution.channel.service.ts | 7 -- .../chatbot/chatbot.controller.ts | 14 +-- .../chatbot/dify/services/dify.service.ts | 106 +++++++++++++----- .../chatbot/evoai/services/evoai.service.ts | 49 +++++--- .../services/evolutionBot.service.ts | 29 +++-- .../flowise/services/flowise.service.ts | 32 ++++-- .../chatbot/openai/services/openai.service.ts | 74 ++++++++---- 7 files changed, 215 insertions(+), 96 deletions(-) diff --git a/src/api/integrations/channel/evolution/evolution.channel.service.ts b/src/api/integrations/channel/evolution/evolution.channel.service.ts index b5e12ca3..be88421a 100644 --- a/src/api/integrations/channel/evolution/evolution.channel.service.ts +++ b/src/api/integrations/channel/evolution/evolution.channel.service.ts @@ -331,7 +331,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message?.mediaType === 'video') { @@ -346,7 +345,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message?.mediaType === 'audio') { @@ -361,7 +359,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; @@ -383,7 +380,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message.buttonMessage) { @@ -400,7 +396,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; } else if (message.listMessage) { @@ -414,7 +409,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; } else { @@ -428,7 +422,6 @@ export class EvolutionStartupService extends ChannelStartupService { messageTimestamp: Math.round(new Date().getTime() / 1000), webhookUrl, source: 'unknown', - instanceName: this.instance.name, instanceId: this.instanceId, }; } diff --git a/src/api/integrations/chatbot/chatbot.controller.ts b/src/api/integrations/chatbot/chatbot.controller.ts index a2312f6e..74f1427a 100644 --- a/src/api/integrations/chatbot/chatbot.controller.ts +++ b/src/api/integrations/chatbot/chatbot.controller.ts @@ -91,19 +91,19 @@ export class ChatbotController { pushName, isIntegration, }; - await evolutionBotController.emit(emitData); + evolutionBotController.emit(emitData); - await typebotController.emit(emitData); + typebotController.emit(emitData); - await openaiController.emit(emitData); + openaiController.emit(emitData); - await difyController.emit(emitData); + difyController.emit(emitData); - await n8nController.emit(emitData); + n8nController.emit(emitData); - await evoaiController.emit(emitData); + evoaiController.emit(emitData); - await flowiseController.emit(emitData); + flowiseController.emit(emitData); } public processDebounce( diff --git a/src/api/integrations/chatbot/dify/services/dify.service.ts b/src/api/integrations/chatbot/dify/services/dify.service.ts index 773efe49..a0c2283e 100644 --- a/src/api/integrations/chatbot/dify/services/dify.service.ts +++ b/src/api/integrations/chatbot/dify/services/dify.service.ts @@ -4,6 +4,7 @@ import { Integration } from '@api/types/wa.types'; import { ConfigService, HttpServer } from '@config/env.config'; import { Dify, DifySetting, IntegrationSession } from '@prisma/client'; import axios from 'axios'; +import { isURL } from 'class-validator'; import { BaseChatbotService } from '../../base-chatbot.service'; import { OpenaiService } from '../../openai/services/openai.service'; @@ -78,15 +79,35 @@ export class DifyService extends BaseChatbotService { // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - payload.files = [ - { - type: 'image', - transfer_method: 'remote_url', - url: contentSplit[1].split('?')[0], - }, - ]; - payload.query = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: mediaBase64, + }, + ]; + } + } else { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: media[1].split('?')[0], + }, + ]; + } + payload.query = media[2] || content; } if (instance.integration === Integration.WHATSAPP_BAILEYS) { @@ -140,15 +161,35 @@ export class DifyService extends BaseChatbotService { // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - payload.files = [ - { - type: 'image', - transfer_method: 'remote_url', - url: contentSplit[1].split('?')[0], - }, - ]; - payload.inputs.query = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: mediaBase64, + }, + ]; + } + } else { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: media[1].split('?')[0], + }, + ]; + payload.inputs.query = media[2] || content; + } } if (instance.integration === Integration.WHATSAPP_BAILEYS) { @@ -202,15 +243,26 @@ export class DifyService extends BaseChatbotService { // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - payload.files = [ - { - type: 'image', - transfer_method: 'remote_url', - url: contentSplit[1].split('?')[0], - }, - ]; - payload.query = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: msg.message.mediaUrl || msg.message.base64, + }, + ]; + } else { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: media[1].split('?')[0], + }, + ]; + payload.query = media[2] || content; + } } if (instance.integration === Integration.WHATSAPP_BAILEYS) { diff --git a/src/api/integrations/chatbot/evoai/services/evoai.service.ts b/src/api/integrations/chatbot/evoai/services/evoai.service.ts index 173ebe34..4d04b85c 100644 --- a/src/api/integrations/chatbot/evoai/services/evoai.service.ts +++ b/src/api/integrations/chatbot/evoai/services/evoai.service.ts @@ -5,6 +5,7 @@ import { ConfigService, HttpServer } from '@config/env.config'; import { Evoai, EvoaiSetting, IntegrationSession } from '@prisma/client'; import axios from 'axios'; import { downloadMediaMessage } from 'baileys'; +import { isURL } from 'class-validator'; import { v4 as uuidv4 } from 'uuid'; import { BaseChatbotService } from '../../base-chatbot.service'; @@ -82,23 +83,43 @@ export class EvoaiService extends BaseChatbotService { // Handle image message if present if (this.isImageMessage(content) && msg) { - const contentSplit = content.split('|'); - parts[0].text = contentSplit[2] || content; + const media = content.split('|'); + parts[0].text = media[2] || content; try { - // Download the image - const mediaBuffer = await downloadMediaMessage(msg, 'buffer', {}); - const fileContent = Buffer.from(mediaBuffer).toString('base64'); - const fileName = contentSplit[2] || `${msg.key?.id || 'image'}.jpg`; + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; - parts.push({ - type: 'file', - file: { - name: fileName, - mimeType: 'image/jpeg', - bytes: fileContent, - }, - } as any); + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + parts.push({ + type: 'file', + file: { + name: msg.key.id + '.jpeg', + mimeType: 'image/jpeg', + bytes: mediaBase64, + }, + } as any); + } + } else { + // Download the image + const mediaBuffer = await downloadMediaMessage(msg, 'buffer', {}); + const fileContent = Buffer.from(mediaBuffer).toString('base64'); + const fileName = media[2] || `${msg.key?.id || 'image'}.jpg`; + + parts.push({ + type: 'file', + file: { + name: fileName, + mimeType: 'image/jpeg', + bytes: fileContent, + }, + } as any); + } } catch (fileErr) { this.logger.error(`[EvoAI] Failed to process image: ${fileErr}`); } diff --git a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts index b82e8fe1..2a0c547c 100644 --- a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts +++ b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts @@ -6,6 +6,7 @@ import { ConfigService, HttpServer } from '@config/env.config'; import { EvolutionBot, EvolutionBotSetting, IntegrationSession } from '@prisma/client'; import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; +import { isURL } from 'class-validator'; import { BaseChatbotService } from '../../base-chatbot.service'; import { OpenaiService } from '../../openai/services/openai.service'; @@ -71,16 +72,26 @@ export class EvolutionBotService extends BaseChatbotService { } if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); + const media = content.split('|'); - payload.uploads = [ - { - data: contentSplit[1].split('?')[0], - type: 'url', - name: 'Flowise.png', - mime: 'image/png', - }, - ]; - payload.question = contentSplit[2] || content; + if (msg.message.mediaUrl || msg.message.base64) { + payload.uploads = [ + { + data: msg.message.base64 || msg.message.mediaUrl, + type: 'url', + name: 'Flowise.png', + mime: 'image/png', + }, + ]; + } else { + payload.uploads = [ + { + data: media[1].split('?')[0], + type: 'url', + name: 'Flowise.png', + mime: 'image/png', + }, + ]; + payload.question = media[2] || content; + } } if (instance.integration === Integration.WHATSAPP_BAILEYS) { diff --git a/src/api/integrations/chatbot/openai/services/openai.service.ts b/src/api/integrations/chatbot/openai/services/openai.service.ts index dd00b04c..036f8259 100644 --- a/src/api/integrations/chatbot/openai/services/openai.service.ts +++ b/src/api/integrations/chatbot/openai/services/openai.service.ts @@ -6,6 +6,7 @@ import { IntegrationSession, OpenaiBot, OpenaiSetting } from '@prisma/client'; import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; import { downloadMediaMessage } from 'baileys'; +import { isURL } from 'class-validator'; import FormData from 'form-data'; import OpenAI from 'openai'; import P from 'pino'; @@ -173,7 +174,7 @@ export class OpenaiService extends BaseChatbotService } // Process with the appropriate API based on bot type - await this.sendMessageToBot(instance, session, settings, openaiBot, remoteJid, pushName || '', content); + await this.sendMessageToBot(instance, session, settings, openaiBot, remoteJid, pushName || '', content, msg); } catch (error) { this.logger.error(`Error in process: ${error.message || JSON.stringify(error)}`); return; @@ -191,6 +192,7 @@ export class OpenaiService extends BaseChatbotService remoteJid: string, pushName: string, content: string, + msg?: any, ): Promise { this.logger.log(`Sending message to bot for remoteJid: ${remoteJid}, bot type: ${openaiBot.botType}`); @@ -222,10 +224,11 @@ export class OpenaiService extends BaseChatbotService pushName, false, // Not fromMe content, + msg, ); } else { this.logger.log('Processing with ChatCompletion API'); - message = await this.processChatCompletionMessage(instance, openaiBot, remoteJid, content); + message = await this.processChatCompletionMessage(instance, openaiBot, remoteJid, content, msg); } this.logger.log(`Got response from OpenAI: ${message?.substring(0, 50)}${message?.length > 50 ? '...' : ''}`); @@ -268,6 +271,7 @@ export class OpenaiService extends BaseChatbotService pushName: string, fromMe: boolean, content: string, + msg?: any, ): Promise { const messageData: any = { role: fromMe ? 'assistant' : 'user', @@ -276,18 +280,35 @@ export class OpenaiService extends BaseChatbotService // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - const url = contentSplit[1].split('?')[0]; + const media = content.split('|'); - messageData.content = [ - { type: 'text', text: contentSplit[2] || content }, - { - type: 'image_url', - image_url: { - url: url, + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + messageData.content = [ + { type: 'text', text: media[2] || content }, + { type: 'image_url', image_url: { url: mediaBase64 } }, + ]; + } + } else { + const url = media[1].split('?')[0]; + + messageData.content = [ + { type: 'text', text: media[2] || content }, + { + type: 'image_url', + image_url: { + url: url, + }, }, - }, - ]; + ]; + } } // Get thread ID from session or create new thread @@ -376,6 +397,7 @@ export class OpenaiService extends BaseChatbotService openaiBot: OpenaiBot, remoteJid: string, content: string, + msg?: any, ): Promise { this.logger.log('Starting processChatCompletionMessage'); @@ -468,18 +490,26 @@ export class OpenaiService extends BaseChatbotService // Handle image messages if (this.isImageMessage(content)) { this.logger.log('Found image message'); - const contentSplit = content.split('|'); - const url = contentSplit[1].split('?')[0]; + const media = content.split('|'); - messageData.content = [ - { type: 'text', text: contentSplit[2] || content }, - { - type: 'image_url', - image_url: { - url: url, + if (msg.message.mediaUrl || msg.message.base64) { + messageData.content = [ + { type: 'text', text: media[2] || content }, + { type: 'image_url', image_url: { url: msg.message.base64 || msg.message.mediaUrl } }, + ]; + } else { + const url = media[1].split('?')[0]; + + messageData.content = [ + { type: 'text', text: media[2] || content }, + { + type: 'image_url', + image_url: { + url: url, + }, }, - }, - ]; + ]; + } } // Combine all messages: system messages, pre-defined messages, conversation history, and current message From 71eb189a6df60ccd8916461b023c86471f46f9ba Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 18 Sep 2025 17:47:54 -0300 Subject: [PATCH 100/129] chore(changelog): update CHANGELOG for recent enhancements and fixes - Fixed `instanceName` field error in message creation, resolving Prisma validation issues. - Enhanced media message processing across chatbot services, improving base64 conversion and media URL handling. - Resolved ESLint configuration conflicts in Evolution Manager v2, updating rules and fixing code formatting issues. - Streamlined media message handling and improved data consistency in database operations. --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d093fb8..a72ab4c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,36 @@ - Added missing relation fields (`N8n`, `N8nSetting`, `Evoai`, `EvoaiSetting`) in Instance model - Resolved Prisma schema validation errors for MySQL provider +* **Prisma Schema Validation**: Fixed `instanceName` field error in message creation + - Removed invalid `instanceName` field from message objects before database insertion + - Resolved `Unknown argument 'instanceName'` Prisma validation error + - Streamlined message data structure to match Prisma schema requirements + +* **Media Message Processing**: Enhanced media handling across chatbot services + - Fixed base64 conversion in EvoAI service for proper image processing + - Converted ArrayBuffer to base64 string using `Buffer.from().toString('base64')` + - Improved media URL handling and base64 encoding for better chatbot integration + - Enhanced image message detection and processing workflow + +* **Evolution Manager v2 Linting**: Resolved ESLint configuration conflicts + - Disabled conflicting Prettier rules in ESLint configuration + - Added comprehensive rule overrides for TypeScript and React patterns + - Fixed import ordering and code formatting issues + - Updated security vulnerabilities in dependencies (Vite, esbuild) + +### Code Quality & Refactoring + +* **Chatbot Services**: Streamlined media message handling across all chatbot integrations + - Standardized base64 and mediaUrl processing patterns + - Improved code readability and maintainability in media handling logic + - Enhanced error handling for media download and conversion processes + - Unified image message detection across different chatbot services + +* **Database Operations**: Improved data consistency and validation + - Enhanced Prisma schema compliance across all message operations + - Removed redundant instance name references for better data integrity + - Optimized message creation workflow with proper field validation + ### Environment Variables * Added comprehensive Kafka configuration options: From b0ca79cd116b483c153ed95176ec80d08169ebb0 Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Sat, 20 Sep 2025 10:57:03 -0300 Subject: [PATCH 101/129] fix(evolutionbot): implement splitMessages and linkPreview functionality - Replace instance.textMessage() with sendMessageWhatsApp() method - Enable message splitting by double line breaks (\n\n) - Add proper delay and typing indicators between split messages - Fix linkPreview parameter passing to base class methods - Support linkPreview: false/true from webhook response - Remove unnecessary debug logs for cleaner output Fixes: EvolutionBot was not respecting splitMessages and linkPreview configurations --- .../chatbot/base-chatbot.service.ts | 8 +++++-- .../services/evolutionBot.service.ts | 22 ++----------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/api/integrations/chatbot/base-chatbot.service.ts b/src/api/integrations/chatbot/base-chatbot.service.ts index f19cb9d4..616d7c57 100644 --- a/src/api/integrations/chatbot/base-chatbot.service.ts +++ b/src/api/integrations/chatbot/base-chatbot.service.ts @@ -180,6 +180,7 @@ export abstract class BaseChatbotService { remoteJid: string, message: string, settings: SettingsType, + linkPreview: boolean = true, ): Promise { if (!message) return; @@ -202,7 +203,7 @@ export abstract class BaseChatbotService { if (mediaType) { // Send accumulated text before sending media if (textBuffer.trim()) { - await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages); + await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages, linkPreview); textBuffer = ''; } @@ -252,7 +253,7 @@ export abstract class BaseChatbotService { // Send any remaining text if (textBuffer.trim()) { - await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages); + await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages, linkPreview); } } @@ -265,6 +266,7 @@ export abstract class BaseChatbotService { text: string, settings: any, splitMessages: boolean, + linkPreview: boolean = true, ): Promise { const timePerChar = settings?.timePerChar ?? 0; const minDelay = 1000; @@ -290,6 +292,7 @@ export abstract class BaseChatbotService { number: remoteJid.split('@')[0], delay: settings?.delayMessage || 1000, text: message, + linkPreview, }, false, ); @@ -316,6 +319,7 @@ export abstract class BaseChatbotService { number: remoteJid.split('@')[0], delay: settings?.delayMessage || 1000, text: text, + linkPreview, }, false, ); diff --git a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts index b82e8fe1..be7e8040 100644 --- a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts +++ b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts @@ -115,15 +115,10 @@ export class EvolutionBotService extends BaseChatbotService Date: Sat, 20 Sep 2025 11:35:15 -0300 Subject: [PATCH 102/129] refactor(chatbot): centralize split logic and ensure linkPreview consistency - Centralize double-line-break message splitting logic into dedicated helper methods - Add targeted debug logs for better observability without clutter - Ensure linkPreview parameter is consistently passed across all chatbot services - Extract splitMessageByDoubleLineBreaks() and sendSingleMessage() helpers - Update all chatbot services to explicitly pass linkPreview: true - Improve code testability and maintainability Services updated: - BaseChatbotService: Refactored split logic and added debug logs - TypebotService: Added linkPreview parameter to all sendMessageWhatsApp calls - OpenAIService: Added linkPreview parameter to all sendMessageWhatsApp calls - N8nService: Added linkPreview parameter to sendMessageWhatsApp call - FlowiseService: Added linkPreview parameter to sendMessageWhatsApp call - EvoaiService: Added linkPreview parameter to sendMessageWhatsApp call - DifyService: Added linkPreview parameter to all sendMessageWhatsApp calls --- env.example | 302 ++++++++++++++++++ .../chatbot/base-chatbot.service.ts | 115 +++---- .../chatbot/dify/services/dify.service.ts | 6 +- .../chatbot/evoai/services/evoai.service.ts | 2 +- .../flowise/services/flowise.service.ts | 2 +- .../chatbot/n8n/services/n8n.service.ts | 2 +- .../chatbot/openai/services/openai.service.ts | 3 +- .../typebot/services/typebot.service.ts | 70 ++-- 8 files changed, 413 insertions(+), 89 deletions(-) create mode 100644 env.example diff --git a/env.example b/env.example new file mode 100644 index 00000000..5fe448b8 --- /dev/null +++ b/env.example @@ -0,0 +1,302 @@ +# =========================================== +# EVOLUTION API - CONFIGURAÇÃO DE AMBIENTE +# =========================================== + +# =========================================== +# SERVIDOR +# =========================================== +SERVER_NAME=evolution +SERVER_TYPE=http +SERVER_PORT=8080 +SERVER_URL=http://localhost:8080 +SERVER_DISABLE_DOCS=false +SERVER_DISABLE_MANAGER=false + +# =========================================== +# CORS +# =========================================== +CORS_ORIGIN=* +CORS_METHODS=POST,GET,PUT,DELETE +CORS_CREDENTIALS=true + +# =========================================== +# SSL (opcional) +# =========================================== +SSL_CONF_PRIVKEY= +SSL_CONF_FULLCHAIN= + +# =========================================== +# BANCO DE DADOS +# =========================================== +DATABASE_PROVIDER=postgresql +DATABASE_CONNECTION_URI=postgresql://username:password@localhost:5432/evolution_api +DATABASE_CONNECTION_CLIENT_NAME=evolution + +# Configurações de salvamento de dados +DATABASE_SAVE_DATA_INSTANCE=true +DATABASE_SAVE_DATA_NEW_MESSAGE=true +DATABASE_SAVE_MESSAGE_UPDATE=true +DATABASE_SAVE_DATA_CONTACTS=true +DATABASE_SAVE_DATA_CHATS=true +DATABASE_SAVE_DATA_HISTORIC=true +DATABASE_SAVE_DATA_LABELS=true +DATABASE_SAVE_IS_ON_WHATSAPP=true +DATABASE_SAVE_IS_ON_WHATSAPP_DAYS=7 +DATABASE_DELETE_MESSAGE=false + +# =========================================== +# REDIS +# =========================================== +CACHE_REDIS_ENABLED=true +CACHE_REDIS_URI=redis://localhost:6379 +CACHE_REDIS_PREFIX_KEY=evolution-cache +CACHE_REDIS_TTL=604800 +CACHE_REDIS_SAVE_INSTANCES=true + +# Cache local (fallback) +CACHE_LOCAL_ENABLED=true +CACHE_LOCAL_TTL=86400 + +# =========================================== +# AUTENTICAÇÃO +# =========================================== +AUTHENTICATION_API_KEY=BQYHJGJHJ +AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=false + +# =========================================== +# LOGS +# =========================================== +LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKET +LOG_COLOR=true +LOG_BAILEYS=error + +# =========================================== +# INSTÂNCIAS +# =========================================== +DEL_INSTANCE=false +DEL_TEMP_INSTANCES=true + +# =========================================== +# IDIOMA +# =========================================== +LANGUAGE=pt-BR + +# =========================================== +# WEBHOOK +# =========================================== +WEBHOOK_GLOBAL_URL= +WEBHOOK_GLOBAL_ENABLED=false +WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false + +# Eventos de webhook +WEBHOOK_EVENTS_APPLICATION_STARTUP=false +WEBHOOK_EVENTS_INSTANCE_CREATE=false +WEBHOOK_EVENTS_INSTANCE_DELETE=false +WEBHOOK_EVENTS_QRCODE_UPDATED=false +WEBHOOK_EVENTS_MESSAGES_SET=false +WEBHOOK_EVENTS_MESSAGES_UPSERT=false +WEBHOOK_EVENTS_MESSAGES_EDITED=false +WEBHOOK_EVENTS_MESSAGES_UPDATE=false +WEBHOOK_EVENTS_MESSAGES_DELETE=false +WEBHOOK_EVENTS_SEND_MESSAGE=false +WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=false +WEBHOOK_EVENTS_CONTACTS_SET=false +WEBHOOK_EVENTS_CONTACTS_UPDATE=false +WEBHOOK_EVENTS_CONTACTS_UPSERT=false +WEBHOOK_EVENTS_PRESENCE_UPDATE=false +WEBHOOK_EVENTS_CHATS_SET=false +WEBHOOK_EVENTS_CHATS_UPDATE=false +WEBHOOK_EVENTS_CHATS_UPSERT=false +WEBHOOK_EVENTS_CHATS_DELETE=false +WEBHOOK_EVENTS_CONNECTION_UPDATE=false +WEBHOOK_EVENTS_LABELS_EDIT=false +WEBHOOK_EVENTS_LABELS_ASSOCIATION=false +WEBHOOK_EVENTS_GROUPS_UPSERT=false +WEBHOOK_EVENTS_GROUPS_UPDATE=false +WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=false +WEBHOOK_EVENTS_CALL=false +WEBHOOK_EVENTS_TYPEBOT_START=false +WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false +WEBHOOK_EVENTS_ERRORS=false +WEBHOOK_EVENTS_ERRORS_WEBHOOK= + +# Configurações de webhook +WEBHOOK_REQUEST_TIMEOUT_MS=30000 +WEBHOOK_RETRY_MAX_ATTEMPTS=10 +WEBHOOK_RETRY_INITIAL_DELAY_SECONDS=5 +WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF=true +WEBHOOK_RETRY_MAX_DELAY_SECONDS=300 +WEBHOOK_RETRY_JITTER_FACTOR=0.2 +WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES=400,401,403,404,422 + +# =========================================== +# WEBSOCKET +# =========================================== +WEBSOCKET_ENABLED=true +WEBSOCKET_GLOBAL_EVENTS=true +WEBSOCKET_ALLOWED_HOSTS= + +# =========================================== +# RABBITMQ +# =========================================== +RABBITMQ_ENABLED=false +RABBITMQ_GLOBAL_ENABLED=false +RABBITMQ_PREFIX_KEY= +RABBITMQ_EXCHANGE_NAME=evolution_exchange +RABBITMQ_URI= +RABBITMQ_FRAME_MAX=8192 + +# =========================================== +# NATS +# =========================================== +NATS_ENABLED=false +NATS_GLOBAL_ENABLED=false +NATS_PREFIX_KEY= +NATS_EXCHANGE_NAME=evolution_exchange +NATS_URI= + +# =========================================== +# SQS +# =========================================== +SQS_ENABLED=false +SQS_GLOBAL_ENABLED=false +SQS_GLOBAL_FORCE_SINGLE_QUEUE=false +SQS_GLOBAL_PREFIX_NAME=global +SQS_ACCESS_KEY_ID= +SQS_SECRET_ACCESS_KEY= +SQS_ACCOUNT_ID= +SQS_REGION= +SQS_MAX_PAYLOAD_SIZE=1048576 + +# =========================================== +# PUSHER +# =========================================== +PUSHER_ENABLED=false +PUSHER_GLOBAL_ENABLED=false +PUSHER_GLOBAL_APP_ID= +PUSHER_GLOBAL_KEY= +PUSHER_GLOBAL_SECRET= +PUSHER_GLOBAL_CLUSTER= +PUSHER_GLOBAL_USE_TLS=false + +# =========================================== +# WHATSAPP BUSINESS +# =========================================== +WA_BUSINESS_TOKEN_WEBHOOK=evolution +WA_BUSINESS_URL=https://graph.facebook.com +WA_BUSINESS_VERSION=v18.0 +WA_BUSINESS_LANGUAGE=en + +# =========================================== +# CONFIGURAÇÕES DE SESSÃO +# =========================================== +CONFIG_SESSION_PHONE_CLIENT=Evolution API +CONFIG_SESSION_PHONE_NAME=Chrome + +# =========================================== +# QR CODE +# =========================================== +QRCODE_LIMIT=30 +QRCODE_COLOR=#198754 + +# =========================================== +# INTEGRAÇÕES +# =========================================== + +# Typebot +TYPEBOT_ENABLED=false +TYPEBOT_API_VERSION=old +TYPEBOT_SEND_MEDIA_BASE64=false + +# Chatwoot +CHATWOOT_ENABLED=false +CHATWOOT_MESSAGE_DELETE=false +CHATWOOT_MESSAGE_READ=false +CHATWOOT_BOT_CONTACT=true +CHATWOOT_IMPORT_DATABASE_CONNECTION_URI= +CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=false + +# OpenAI +OPENAI_ENABLED=false +OPENAI_API_KEY_GLOBAL= + +# Dify +DIFY_ENABLED=false + +# N8N +N8N_ENABLED=false + +# EvoAI +EVOAI_ENABLED=false + +# Flowise +FLOWISE_ENABLED=false + +# =========================================== +# S3 / MINIO +# =========================================== +S3_ENABLED=false +S3_ACCESS_KEY= +S3_SECRET_KEY= +S3_ENDPOINT= +S3_BUCKET= +S3_PORT=9000 +S3_USE_SSL=false +S3_REGION= +S3_SKIP_POLICY=false +S3_SAVE_VIDEO=false + +# =========================================== +# MÉTRICAS +# =========================================== +PROMETHEUS_METRICS=false +METRICS_AUTH_REQUIRED=false +METRICS_USER= +METRICS_PASSWORD= +METRICS_ALLOWED_IPS= + +# =========================================== +# TELEMETRIA +# =========================================== +TELEMETRY_ENABLED=true +TELEMETRY_URL= + +# =========================================== +# PROXY +# =========================================== +PROXY_HOST= +PROXY_PORT= +PROXY_PROTOCOL= +PROXY_USERNAME= +PROXY_PASSWORD= + +# =========================================== +# CONVERSOR DE ÁUDIO +# =========================================== +API_AUDIO_CONVERTER= +API_AUDIO_CONVERTER_KEY= + +# =========================================== +# FACEBOOK +# =========================================== +FACEBOOK_APP_ID= +FACEBOOK_CONFIG_ID= +FACEBOOK_USER_TOKEN= + +# =========================================== +# SENTRY +# =========================================== +SENTRY_DSN= + +# =========================================== +# EVENT EMITTER +# =========================================== +EVENT_EMITTER_MAX_LISTENERS=50 + +# =========================================== +# PROVIDER +# =========================================== +PROVIDER_ENABLED=false +PROVIDER_HOST= +PROVIDER_PORT=5656 +PROVIDER_PREFIX=evolution diff --git a/src/api/integrations/chatbot/base-chatbot.service.ts b/src/api/integrations/chatbot/base-chatbot.service.ts index 616d7c57..5ae43ffa 100644 --- a/src/api/integrations/chatbot/base-chatbot.service.ts +++ b/src/api/integrations/chatbot/base-chatbot.service.ts @@ -257,6 +257,55 @@ export abstract class BaseChatbotService { } } + /** + * Split message by double line breaks and return array of message parts + */ + private splitMessageByDoubleLineBreaks(message: string): string[] { + return message.split('\n\n').filter((part) => part.trim().length > 0); + } + + /** + * Send a single message with proper typing indicators and delays + */ + private async sendSingleMessage( + instance: any, + remoteJid: string, + message: string, + settings: any, + linkPreview: boolean = true, + ): Promise { + const timePerChar = settings?.timePerChar ?? 0; + const minDelay = 1000; + const maxDelay = 20000; + const delay = Math.min(Math.max(message.length * timePerChar, minDelay), maxDelay); + + this.logger.debug(`[BaseChatbot] Sending single message with linkPreview: ${linkPreview}`); + + if (instance.integration === Integration.WHATSAPP_BAILEYS) { + await instance.client.presenceSubscribe(remoteJid); + await instance.client.sendPresenceUpdate('composing', remoteJid); + } + + await new Promise((resolve) => { + setTimeout(async () => { + await instance.textMessage( + { + number: remoteJid.split('@')[0], + delay: settings?.delayMessage || 1000, + text: message, + linkPreview, + }, + false, + ); + resolve(); + }, delay); + }); + + if (instance.integration === Integration.WHATSAPP_BAILEYS) { + await instance.client.sendPresenceUpdate('paused', remoteJid); + } + } + /** * Helper method to send formatted text with proper typing indicators and delays */ @@ -268,68 +317,22 @@ export abstract class BaseChatbotService { splitMessages: boolean, linkPreview: boolean = true, ): Promise { - const timePerChar = settings?.timePerChar ?? 0; - const minDelay = 1000; - const maxDelay = 20000; - if (splitMessages) { - const multipleMessages = text.split('\n\n'); - for (let index = 0; index < multipleMessages.length; index++) { - const message = multipleMessages[index]; - if (!message.trim()) continue; + const messageParts = this.splitMessageByDoubleLineBreaks(text); - const delay = Math.min(Math.max(message.length * timePerChar, minDelay), maxDelay); + this.logger.debug(`[BaseChatbot] Splitting message into ${messageParts.length} parts`); - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.presenceSubscribe(remoteJid); - await instance.client.sendPresenceUpdate('composing', remoteJid); - } + for (let index = 0; index < messageParts.length; index++) { + const message = messageParts[index]; - await new Promise((resolve) => { - setTimeout(async () => { - await instance.textMessage( - { - number: remoteJid.split('@')[0], - delay: settings?.delayMessage || 1000, - text: message, - linkPreview, - }, - false, - ); - resolve(); - }, delay); - }); - - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.sendPresenceUpdate('paused', remoteJid); - } + this.logger.debug(`[BaseChatbot] Sending message part ${index + 1}/${messageParts.length}`); + await this.sendSingleMessage(instance, remoteJid, message, settings, linkPreview); } + + this.logger.debug(`[BaseChatbot] All message parts sent successfully`); } else { - const delay = Math.min(Math.max(text.length * timePerChar, minDelay), maxDelay); - - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.presenceSubscribe(remoteJid); - await instance.client.sendPresenceUpdate('composing', remoteJid); - } - - await new Promise((resolve) => { - setTimeout(async () => { - await instance.textMessage( - { - number: remoteJid.split('@')[0], - delay: settings?.delayMessage || 1000, - text: text, - linkPreview, - }, - false, - ); - resolve(); - }, delay); - }); - - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.sendPresenceUpdate('paused', remoteJid); - } + this.logger.debug(`[BaseChatbot] Sending single message`); + await this.sendSingleMessage(instance, remoteJid, text, settings, linkPreview); } } diff --git a/src/api/integrations/chatbot/dify/services/dify.service.ts b/src/api/integrations/chatbot/dify/services/dify.service.ts index 773efe49..dbf46e8f 100644 --- a/src/api/integrations/chatbot/dify/services/dify.service.ts +++ b/src/api/integrations/chatbot/dify/services/dify.service.ts @@ -107,7 +107,7 @@ export class DifyService extends BaseChatbotService { const conversationId = response?.data?.conversation_id; if (message) { - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } await this.prismaRepository.integrationSession.update({ @@ -169,7 +169,7 @@ export class DifyService extends BaseChatbotService { const conversationId = response?.data?.conversation_id; if (message) { - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } await this.prismaRepository.integrationSession.update({ @@ -246,7 +246,7 @@ export class DifyService extends BaseChatbotService { await instance.client.sendPresenceUpdate('paused', remoteJid); if (answer) { - await this.sendMessageWhatsApp(instance, remoteJid, answer, settings); + await this.sendMessageWhatsApp(instance, remoteJid, answer, settings, true); } await this.prismaRepository.integrationSession.update({ diff --git a/src/api/integrations/chatbot/evoai/services/evoai.service.ts b/src/api/integrations/chatbot/evoai/services/evoai.service.ts index 173ebe34..f901964f 100644 --- a/src/api/integrations/chatbot/evoai/services/evoai.service.ts +++ b/src/api/integrations/chatbot/evoai/services/evoai.service.ts @@ -174,7 +174,7 @@ export class EvoaiService extends BaseChatbotService { this.logger.debug(`[EvoAI] Extracted message to send: ${message}`); if (message) { - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } } catch (error) { this.logger.error( diff --git a/src/api/integrations/chatbot/flowise/services/flowise.service.ts b/src/api/integrations/chatbot/flowise/services/flowise.service.ts index 5505189c..4ee8c2e5 100644 --- a/src/api/integrations/chatbot/flowise/services/flowise.service.ts +++ b/src/api/integrations/chatbot/flowise/services/flowise.service.ts @@ -130,7 +130,7 @@ export class FlowiseService extends BaseChatbotService { if (message) { // Use the base class method to send the message to WhatsApp - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } } diff --git a/src/api/integrations/chatbot/n8n/services/n8n.service.ts b/src/api/integrations/chatbot/n8n/services/n8n.service.ts index 5bb40890..f1a6c387 100644 --- a/src/api/integrations/chatbot/n8n/services/n8n.service.ts +++ b/src/api/integrations/chatbot/n8n/services/n8n.service.ts @@ -78,7 +78,7 @@ export class N8nService extends BaseChatbotService { const message = response?.data?.output || response?.data?.answer; // Use base class method instead of custom implementation - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); await this.prismaRepository.integrationSession.update({ where: { diff --git a/src/api/integrations/chatbot/openai/services/openai.service.ts b/src/api/integrations/chatbot/openai/services/openai.service.ts index dd00b04c..272d57fd 100644 --- a/src/api/integrations/chatbot/openai/services/openai.service.ts +++ b/src/api/integrations/chatbot/openai/services/openai.service.ts @@ -85,6 +85,7 @@ export class OpenaiService extends BaseChatbotService remoteJid, "Sorry, I couldn't transcribe your audio message. Could you please type your message instead?", settings, + true, ); return; } @@ -233,7 +234,7 @@ export class OpenaiService extends BaseChatbotService // Send the response if (message) { this.logger.log('Sending message to WhatsApp'); - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } else { this.logger.error('No message to send to WhatsApp'); } diff --git a/src/api/integrations/chatbot/typebot/services/typebot.service.ts b/src/api/integrations/chatbot/typebot/services/typebot.service.ts index 2e780dbf..68320367 100644 --- a/src/api/integrations/chatbot/typebot/services/typebot.service.ts +++ b/src/api/integrations/chatbot/typebot/services/typebot.service.ts @@ -318,7 +318,7 @@ export class TypebotService extends BaseChatbotService { } else if (formattedText.includes('[buttons]')) { await this.processButtonMessage(instance, formattedText, session.remoteJid); } else { - await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings); + await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings, true); } sendTelemetry('/message/sendText'); @@ -393,7 +393,7 @@ export class TypebotService extends BaseChatbotService { } else if (formattedText.includes('[buttons]')) { await this.processButtonMessage(instance, formattedText, session.remoteJid); } else { - await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings); + await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings, true); } sendTelemetry('/message/sendText'); @@ -642,15 +642,21 @@ export class TypebotService extends BaseChatbotService { if (!content) { if (unknownMessage) { - await this.sendMessageWhatsApp(waInstance, remoteJid, unknownMessage, { - delayMessage, - expire, - keywordFinish, - listeningFromMe, - stopBotFromMe, - keepOpen, + await this.sendMessageWhatsApp( + waInstance, + remoteJid, unknownMessage, - }); + { + delayMessage, + expire, + keywordFinish, + listeningFromMe, + stopBotFromMe, + keepOpen, + unknownMessage, + }, + true, + ); sendTelemetry('/message/sendText'); } return; @@ -801,15 +807,21 @@ export class TypebotService extends BaseChatbotService { if (!data?.messages || data.messages.length === 0) { if (!content) { if (unknownMessage) { - await this.sendMessageWhatsApp(waInstance, remoteJid, unknownMessage, { - delayMessage, - expire, - keywordFinish, - listeningFromMe, - stopBotFromMe, - keepOpen, + await this.sendMessageWhatsApp( + waInstance, + remoteJid, unknownMessage, - }); + { + delayMessage, + expire, + keywordFinish, + listeningFromMe, + stopBotFromMe, + keepOpen, + unknownMessage, + }, + true, + ); sendTelemetry('/message/sendText'); } return; @@ -903,15 +915,21 @@ export class TypebotService extends BaseChatbotService { if (!content) { if (unknownMessage) { - await this.sendMessageWhatsApp(waInstance, remoteJid, unknownMessage, { - delayMessage, - expire, - keywordFinish, - listeningFromMe, - stopBotFromMe, - keepOpen, + await this.sendMessageWhatsApp( + waInstance, + remoteJid, unknownMessage, - }); + { + delayMessage, + expire, + keywordFinish, + listeningFromMe, + stopBotFromMe, + keepOpen, + unknownMessage, + }, + true, + ); sendTelemetry('/message/sendText'); } return; From 878da12fa4d8e306aa21ad4d9286dc3cd1adbe57 Mon Sep 17 00:00:00 2001 From: "Jose A. Mendez Santiago" Date: Sat, 20 Sep 2025 22:02:25 -0600 Subject: [PATCH 103/129] fix(docker): change private image to public image in docker-compose --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index b4899797..b049f00f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ version: "3.8" services: api: container_name: evolution_api - image: evolution/api:metrics + image: evoapicloud/evolution-api:latest restart: always depends_on: - redis From 6c5b0566154abf8eff367ed4fe6265a866394913 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 23 Sep 2025 11:37:44 -0300 Subject: [PATCH 104/129] chore(changelog): remove empty line in CHANGELOG for consistency --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a72ab4c0..01c71d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,7 +65,6 @@ - `KAFKA_SASL_*` and `KAFKA_SSL_*` for authentication - `KAFKA_EVENTS_*` for event type configuration - # 2.3.3 (2025-09-18) ### Features From dfea584aa7eff7a50ec2881421eee689f05bbaf9 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 23 Sep 2025 11:41:51 -0300 Subject: [PATCH 105/129] chore(changelog): update CHANGELOG for version 2.3.4 release - Enhanced EvolutionBot functionality with splitMessages and linkPreview support - Centralized message splitting logic across chatbot services for consistency - Improved message formatting and delivery capabilities --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01c71d3f..1e3b92f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 2.3.4 (develop) +# 2.3.4 (2025-09-23) ### Features @@ -20,6 +20,12 @@ - Multi-language support (English, Portuguese, Spanish, French) - Modern React + TypeScript + Vite frontend with Tailwind CSS +* **EvolutionBot Enhancements**: Improved EvolutionBot functionality and message handling + - Implemented splitMessages functionality for better message segmentation + - Added linkPreview support for enhanced message presentation + - Centralized split logic across chatbot services for consistency + - Enhanced message formatting and delivery capabilities + ### Fixed * **MySQL Schema**: Fixed invalid default value errors for `createdAt` fields in `Evoai` and `EvoaiSetting` models From 6c150eed6db71bb2d461bcb254281fcf4c1f1557 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 23 Sep 2025 18:40:19 -0300 Subject: [PATCH 106/129] chore(docker): add Kafka and frontend services to Docker configurations - Introduced Kafka and Zookeeper services in a new docker-compose file for better message handling. - Added frontend service to both development and production docker-compose files for improved UI management. - Updated evolution-manager-v2 submodule to the latest commit. - Updated CHANGELOG for version 2.3.5 release. --- CHANGELOG.md | 4 + Docker/kafka/README.md | 139 +++++++++++++++++++++++++++++ Docker/kafka/docker-compose.yaml | 51 +++++++++++ Docker/swarm/evolution_api_v2.yaml | 2 +- docker-compose.dev.yaml | 10 +++ docker-compose.yaml | 9 ++ evolution-manager-v2 | 2 +- 7 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 Docker/kafka/README.md create mode 100644 Docker/kafka/docker-compose.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3b92f9..d1ada766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.3.5 (develop) + +### + # 2.3.4 (2025-09-23) ### Features diff --git a/Docker/kafka/README.md b/Docker/kafka/README.md new file mode 100644 index 00000000..6c17ab41 --- /dev/null +++ b/Docker/kafka/README.md @@ -0,0 +1,139 @@ +# Kafka Docker Setup for Evolution API + +This directory contains the Docker Compose configuration for running Apache Kafka locally for development and testing with Evolution API. + +## Services + +### Zookeeper +- **Container**: `zookeeper` +- **Image**: `confluentinc/cp-zookeeper:7.5.0` +- **Port**: `2181` +- **Purpose**: Coordination service for Kafka cluster + +### Kafka +- **Container**: `kafka` +- **Image**: `confluentinc/cp-kafka:7.5.0` +- **Ports**: + - `9092` - PLAINTEXT_HOST (localhost access) + - `29092` - PLAINTEXT (internal container access) + - `9094` - OUTSIDE (external Docker access) +- **Purpose**: Message broker for event streaming + +## Quick Start + +### 1. Start Kafka Services +```bash +cd Docker/kafka +docker-compose up -d +``` + +### 2. Verify Services +```bash +# Check if containers are running +docker-compose ps + +# Check Kafka logs +docker-compose logs kafka + +# Check Zookeeper logs +docker-compose logs zookeeper +``` + +### 3. Test Kafka Connection +```bash +# Create a test topic +docker exec kafka kafka-topics --create --topic test-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1 + +# List topics +docker exec kafka kafka-topics --list --bootstrap-server localhost:9092 + +# Produce messages +docker exec -it kafka kafka-console-producer --topic test-topic --bootstrap-server localhost:9092 + +# Consume messages (in another terminal) +docker exec -it kafka kafka-console-consumer --topic test-topic --from-beginning --bootstrap-server localhost:9092 +``` + +## Evolution API Integration + +### Environment Variables +Configure these variables in your Evolution API `.env` file: + +```bash +# Kafka Configuration +KAFKA_ENABLED=true +KAFKA_CLIENT_ID=evolution-api +KAFKA_BROKERS=localhost:9092 +KAFKA_GLOBAL_ENABLED=true +KAFKA_CONSUMER_GROUP_ID=evolution-api-consumers +KAFKA_TOPIC_PREFIX=evolution +KAFKA_AUTO_CREATE_TOPICS=true + +# Event Configuration +KAFKA_EVENTS_APPLICATION_STARTUP=true +KAFKA_EVENTS_INSTANCE_CREATE=true +KAFKA_EVENTS_MESSAGES_UPSERT=true +# ... other events as needed +``` + +### Connection Endpoints +- **From Evolution API**: `localhost:9092` +- **From other Docker containers**: `kafka:29092` +- **From external applications**: `host.docker.internal:9094` + +## Data Persistence + +Data is persisted in Docker volumes: +- `zookeeper_data`: Zookeeper data and logs +- `kafka_data`: Kafka topic data and logs + +## Network + +Services run on the `evolution-net` network, allowing integration with other Evolution API services. + +## Stopping Services + +```bash +# Stop services +docker-compose down + +# Stop and remove volumes (WARNING: This will delete all data) +docker-compose down -v +``` + +## Troubleshooting + +### Connection Issues +1. Ensure ports 2181, 9092, 29092, and 9094 are not in use +2. Check if Docker network `evolution-net` exists +3. Verify firewall settings allow connections to these ports + +### Performance Tuning +The configuration includes production-ready settings: +- Log retention: 7 days (168 hours) +- Compression: gzip +- Auto-topic creation enabled +- Optimized segment and retention settings + +### Logs +```bash +# View all logs +docker-compose logs + +# Follow logs in real-time +docker-compose logs -f + +# View specific service logs +docker-compose logs kafka +docker-compose logs zookeeper +``` + +## Integration with Evolution API + +Once Kafka is running, Evolution API will automatically: +1. Connect to Kafka on startup (if `KAFKA_ENABLED=true`) +2. Create topics based on `KAFKA_TOPIC_PREFIX` +3. Start producing events to configured topics +4. Handle consumer groups for reliable message processing + +For more details on Kafka integration, see the main Evolution API documentation. diff --git a/Docker/kafka/docker-compose.yaml b/Docker/kafka/docker-compose.yaml new file mode 100644 index 00000000..dc1c794e --- /dev/null +++ b/Docker/kafka/docker-compose.yaml @@ -0,0 +1,51 @@ +version: '3.3' + +services: + zookeeper: + container_name: zookeeper + image: confluentinc/cp-zookeeper:7.5.0 + environment: + - ZOOKEEPER_CLIENT_PORT=2181 + - ZOOKEEPER_TICK_TIME=2000 + - ZOOKEEPER_SYNC_LIMIT=2 + volumes: + - zookeeper_data:/var/lib/zookeeper/ + ports: + - 2181:2181 + + kafka: + container_name: kafka + image: confluentinc/cp-kafka:7.5.0 + depends_on: + - zookeeper + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 + - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,OUTSIDE:PLAINTEXT + - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092,OUTSIDE://host.docker.internal:9094 + - KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT + - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 + - KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 + - KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 + - KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 + - KAFKA_AUTO_CREATE_TOPICS_ENABLE=true + - KAFKA_LOG_RETENTION_HOURS=168 + - KAFKA_LOG_SEGMENT_BYTES=1073741824 + - KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS=300000 + - KAFKA_COMPRESSION_TYPE=gzip + ports: + - 29092:29092 + - 9092:9092 + - 9094:9094 + volumes: + - kafka_data:/var/lib/kafka/data + +volumes: + zookeeper_data: + kafka_data: + + +networks: + evolution-net: + name: evolution-net + driver: bridge \ No newline at end of file diff --git a/Docker/swarm/evolution_api_v2.yaml b/Docker/swarm/evolution_api_v2.yaml index 4055dfa3..f28163cc 100644 --- a/Docker/swarm/evolution_api_v2.yaml +++ b/Docker/swarm/evolution_api_v2.yaml @@ -2,7 +2,7 @@ version: "3.7" services: evolution_v2: - image: evoapicloud/evolution-api:v2.3.1 + image: evoapicloud/evolution-api:v2.3.5 volumes: - evolution_instances:/evolution/instances networks: diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 2ca3424e..35868ab7 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -15,6 +15,16 @@ services: expose: - 8080 + frontend: + container_name: evolution_frontend + image: evolution/manager:local + build: ./evolution-manager-v2 + restart: always + ports: + - "3000:80" + networks: + - evolution-net + volumes: evolution_instances: diff --git a/docker-compose.yaml b/docker-compose.yaml index b049f00f..e0edee65 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,6 +20,15 @@ services: expose: - "8080" + frontend: + container_name: evolution_frontend + image: evoapicloud/evolution-manager:latest + restart: always + ports: + - "3000:80" + networks: + - evolution-net + redis: container_name: evolution_redis image: redis:latest diff --git a/evolution-manager-v2 b/evolution-manager-v2 index fcb38dd4..e510b5f1 160000 --- a/evolution-manager-v2 +++ b/evolution-manager-v2 @@ -1 +1 @@ -Subproject commit fcb38dd407b89697b7a7154cfd873f76729e6ece +Subproject commit e510b5f17fc75cbddeaaba102ddd568e4b127455 From 45858507418c14ddfbe9312317210f1e418a97f7 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 23 Sep 2025 18:42:07 -0300 Subject: [PATCH 107/129] chore(release): bump version to 2.3.5 and update bug report template - Updated package and lock files to version 2.3.5. - Modified bug report template to reflect the new version number. - Removed outdated Kafka Docker README file. --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- Docker/kafka/README.md | 139 -------------------------- package-lock.json | 4 +- package.json | 2 +- 4 files changed, 4 insertions(+), 143 deletions(-) delete mode 100644 Docker/kafka/README.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 92531b7e..e2b7d185 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -59,7 +59,7 @@ body: value: | - OS: [e.g. Ubuntu 20.04, Windows 10, macOS 12.0] - Node.js version: [e.g. 18.17.0] - - Evolution API version: [e.g. 2.3.4] + - Evolution API version: [e.g. 2.3.5] - Database: [e.g. PostgreSQL 14, MySQL 8.0] - Connection type: [e.g. Baileys, WhatsApp Business API] validations: diff --git a/Docker/kafka/README.md b/Docker/kafka/README.md deleted file mode 100644 index 6c17ab41..00000000 --- a/Docker/kafka/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# Kafka Docker Setup for Evolution API - -This directory contains the Docker Compose configuration for running Apache Kafka locally for development and testing with Evolution API. - -## Services - -### Zookeeper -- **Container**: `zookeeper` -- **Image**: `confluentinc/cp-zookeeper:7.5.0` -- **Port**: `2181` -- **Purpose**: Coordination service for Kafka cluster - -### Kafka -- **Container**: `kafka` -- **Image**: `confluentinc/cp-kafka:7.5.0` -- **Ports**: - - `9092` - PLAINTEXT_HOST (localhost access) - - `29092` - PLAINTEXT (internal container access) - - `9094` - OUTSIDE (external Docker access) -- **Purpose**: Message broker for event streaming - -## Quick Start - -### 1. Start Kafka Services -```bash -cd Docker/kafka -docker-compose up -d -``` - -### 2. Verify Services -```bash -# Check if containers are running -docker-compose ps - -# Check Kafka logs -docker-compose logs kafka - -# Check Zookeeper logs -docker-compose logs zookeeper -``` - -### 3. Test Kafka Connection -```bash -# Create a test topic -docker exec kafka kafka-topics --create --topic test-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1 - -# List topics -docker exec kafka kafka-topics --list --bootstrap-server localhost:9092 - -# Produce messages -docker exec -it kafka kafka-console-producer --topic test-topic --bootstrap-server localhost:9092 - -# Consume messages (in another terminal) -docker exec -it kafka kafka-console-consumer --topic test-topic --from-beginning --bootstrap-server localhost:9092 -``` - -## Evolution API Integration - -### Environment Variables -Configure these variables in your Evolution API `.env` file: - -```bash -# Kafka Configuration -KAFKA_ENABLED=true -KAFKA_CLIENT_ID=evolution-api -KAFKA_BROKERS=localhost:9092 -KAFKA_GLOBAL_ENABLED=true -KAFKA_CONSUMER_GROUP_ID=evolution-api-consumers -KAFKA_TOPIC_PREFIX=evolution -KAFKA_AUTO_CREATE_TOPICS=true - -# Event Configuration -KAFKA_EVENTS_APPLICATION_STARTUP=true -KAFKA_EVENTS_INSTANCE_CREATE=true -KAFKA_EVENTS_MESSAGES_UPSERT=true -# ... other events as needed -``` - -### Connection Endpoints -- **From Evolution API**: `localhost:9092` -- **From other Docker containers**: `kafka:29092` -- **From external applications**: `host.docker.internal:9094` - -## Data Persistence - -Data is persisted in Docker volumes: -- `zookeeper_data`: Zookeeper data and logs -- `kafka_data`: Kafka topic data and logs - -## Network - -Services run on the `evolution-net` network, allowing integration with other Evolution API services. - -## Stopping Services - -```bash -# Stop services -docker-compose down - -# Stop and remove volumes (WARNING: This will delete all data) -docker-compose down -v -``` - -## Troubleshooting - -### Connection Issues -1. Ensure ports 2181, 9092, 29092, and 9094 are not in use -2. Check if Docker network `evolution-net` exists -3. Verify firewall settings allow connections to these ports - -### Performance Tuning -The configuration includes production-ready settings: -- Log retention: 7 days (168 hours) -- Compression: gzip -- Auto-topic creation enabled -- Optimized segment and retention settings - -### Logs -```bash -# View all logs -docker-compose logs - -# Follow logs in real-time -docker-compose logs -f - -# View specific service logs -docker-compose logs kafka -docker-compose logs zookeeper -``` - -## Integration with Evolution API - -Once Kafka is running, Evolution API will automatically: -1. Connect to Kafka on startup (if `KAFKA_ENABLED=true`) -2. Create topics based on `KAFKA_TOPIC_PREFIX` -3. Start producing events to configured topics -4. Handle consumer groups for reliable message processing - -For more details on Kafka integration, see the main Evolution API documentation. diff --git a/package-lock.json b/package-lock.json index 5b558ca0..c5a78a76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "evolution-api", - "version": "2.3.4", + "version": "2.3.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "evolution-api", - "version": "2.3.4", + "version": "2.3.5", "license": "Apache-2.0", "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", diff --git a/package.json b/package.json index 748439d6..c48b2275 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "2.3.4", + "version": "2.3.5", "description": "Rest api for communication with WhatsApp", "main": "./dist/main.js", "type": "commonjs", From d8268b0eb15bc517895d056f2220ef4693ad6eab Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 24 Sep 2025 13:59:23 -0300 Subject: [PATCH 108/129] fix(migration): resolve PostgreSQL migration error for Kafka integration - Corrected table reference in migration SQL to align with naming conventions. - Fixed foreign key constraint issue that caused migration failure. - Ensured successful setup of Kafka integration by addressing database migration errors. --- CHANGELOG.md | 8 ++++++++ .../20250918182355_add_kafka_integration/migration.sql | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1ada766..a3b617ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # 2.3.5 (develop) +### Fixed + +* **Kafka Migration**: Fixed PostgreSQL migration error for Kafka integration + - Corrected table reference from `"public"."Instance"` to `"Instance"` in foreign key constraint + - Fixed `ERROR: relation "public.Instance" does not exist` issue in migration `20250918182355_add_kafka_integration` + - Aligned table naming convention with other Evolution API migrations for consistency + - Resolved database migration failure that prevented Kafka integration setup + ### # 2.3.4 (2025-09-23) diff --git a/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql b/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql index 16ef2d7c..2985c550 100644 --- a/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql +++ b/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql @@ -1,5 +1,5 @@ -- CreateTable -CREATE TABLE "public"."Kafka" ( +CREATE TABLE "Kafka" ( "id" TEXT NOT NULL, "enabled" BOOLEAN NOT NULL DEFAULT false, "events" JSONB NOT NULL, @@ -11,7 +11,7 @@ CREATE TABLE "public"."Kafka" ( ); -- CreateIndex -CREATE UNIQUE INDEX "Kafka_instanceId_key" ON "public"."Kafka"("instanceId"); +CREATE UNIQUE INDEX "Kafka_instanceId_key" ON "Kafka"("instanceId"); -- AddForeignKey -ALTER TABLE "public"."Kafka" ADD CONSTRAINT "Kafka_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "public"."Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "Kafka" ADD CONSTRAINT "Kafka_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE; From 093515555d25fe2eaf0cb06732e70570ff3a7a76 Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Thu, 25 Sep 2025 17:08:40 -0300 Subject: [PATCH 109/129] =?UTF-8?q?refactor(chatbot):=20refatorar=20conex?= =?UTF-8?q?=C3=A3o=20com=20PostgreSQL=20e=20melhorar=20tratamento=20de=20m?= =?UTF-8?q?ensagens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Alterado método de obtenção da conexão PostgreSQL para ser assíncrono, melhorando a gestão de conexões. - Implementada lógica de retry para criação de mensagens e conversas, garantindo maior robustez em caso de falhas. - Ajustadas chamadas de consulta ao banco de dados para utilizar a nova abordagem de conexão. - Adicionada nova propriedade `messageBodyForRetry` para facilitar o reenvio de mensagens em caso de erro. --- .../chatwoot/services/chatwoot.service.ts | 210 ++++++++++++------ 1 file changed, 144 insertions(+), 66 deletions(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 5020bfa6..bca90082 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -53,7 +53,9 @@ export class ChatwootService { private readonly cache: CacheService, ) {} - private pgClient = postgresClient.getChatwootConnection(); + private async getPgClient() { + return postgresClient.getChatwootConnection(); + } private async getProvider(instance: InstanceDto): Promise { const cacheKey = `${instance.instanceName}:getProvider`; @@ -382,7 +384,8 @@ export class ChatwootService { if (!uri) return false; const sqlTags = `SELECT id, taggings_count FROM tags WHERE name = $1 LIMIT 1`; - const tagData = (await this.pgClient.query(sqlTags, [nameInbox]))?.rows[0]; + const pgClient = await this.getPgClient(); + const tagData = (await pgClient.query(sqlTags, [nameInbox]))?.rows[0]; let tagId = tagData?.id; const taggingsCount = tagData?.taggings_count || 0; @@ -392,18 +395,18 @@ export class ChatwootService { DO UPDATE SET taggings_count = tags.taggings_count + 1 RETURNING id`; - tagId = (await this.pgClient.query(sqlTag, [nameInbox, taggingsCount + 1]))?.rows[0]?.id; + tagId = (await pgClient.query(sqlTag, [nameInbox, taggingsCount + 1]))?.rows[0]?.id; const sqlCheckTagging = `SELECT 1 FROM taggings WHERE tag_id = $1 AND taggable_type = 'Contact' AND taggable_id = $2 AND context = 'labels' LIMIT 1`; - const taggingExists = (await this.pgClient.query(sqlCheckTagging, [tagId, contactId]))?.rowCount > 0; + const taggingExists = (await pgClient.query(sqlCheckTagging, [tagId, contactId]))?.rowCount > 0; if (!taggingExists) { const sqlInsertLabel = `INSERT INTO taggings (tag_id, taggable_type, taggable_id, context, created_at) VALUES ($1, 'Contact', $2, 'labels', NOW())`; - await this.pgClient.query(sqlInsertLabel, [tagId, contactId]); + await pgClient.query(sqlInsertLabel, [tagId, contactId]); } return true; @@ -861,6 +864,7 @@ export class ChatwootService { messageBody?: any, sourceId?: string, quotedMsg?: MessageModel, + messageBodyForRetry?: any, ) { const client = await this.clientCw(instance); @@ -869,32 +873,66 @@ export class ChatwootService { return null; } - const replyToIds = await this.getReplyToIds(messageBody, instance); + const doCreateMessage = async (convId: number) => { + const replyToIds = await this.getReplyToIds(messageBody, instance); - const sourceReplyId = quotedMsg?.chatwootMessageId || null; + const sourceReplyId = quotedMsg?.chatwootMessageId || null; - const message = await client.messages.create({ - accountId: this.provider.accountId, - conversationId: conversationId, - data: { - content: content, - message_type: messageType, - attachments: attachments, - private: privateMessage || false, - source_id: sourceId, - content_attributes: { - ...replyToIds, + const message = await client.messages.create({ + accountId: this.provider.accountId, + conversationId: convId, + data: { + content: content, + message_type: messageType, + attachments: attachments, + private: privateMessage || false, + source_id: sourceId, + content_attributes: { + ...replyToIds, + }, + source_reply_id: sourceReplyId ? sourceReplyId.toString() : null, }, - source_reply_id: sourceReplyId ? sourceReplyId.toString() : null, - }, - }); + }); - if (!message) { - this.logger.warn('message not found'); - return null; + if (!message) { + this.logger.warn('message not found'); + return null; + } + + return message; + }; + + try { + return await doCreateMessage(conversationId); + } catch (error) { + const errorMessage = error.toString().toLowerCase(); + const status = error.response?.status; + if (errorMessage.includes('not found') || status === 404) { + this.logger.warn(`Conversation ${conversationId} not found. Retrying...`); + const bodyForRetry = messageBodyForRetry || messageBody; + + if (!bodyForRetry) { + this.logger.error('Cannot retry createMessage without a message body for context.'); + return null; + } + + const remoteJid = bodyForRetry.key.remoteJid; + const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; + await this.cache.delete(cacheKey); + + const newConversationId = await this.createConversation(instance, bodyForRetry); + if (!newConversationId) { + this.logger.error(`Failed to create new conversation for ${remoteJid}`); + return null; + } + + this.logger.log(`Retrying message creation for ${remoteJid} with new conversation ${newConversationId}`); + return await doCreateMessage(newConversationId); + } else { + this.logger.error(`Error creating message: ${error}`); + throw error; + } } - - return message; } public async getOpenConversationByContact( @@ -987,6 +1025,7 @@ export class ChatwootService { messageBody?: any, sourceId?: string, quotedMsg?: MessageModel, + messageBodyForRetry?: any, ) { if (sourceId && this.isImportHistoryAvailable()) { const messageAlreadySaved = await chatwootImport.getExistingSourceIds([sourceId], conversationId); @@ -997,54 +1036,84 @@ export class ChatwootService { } } } - const data = new FormData(); + const doSendData = async (convId: number) => { + const data = new FormData(); - if (content) { - data.append('content', content); - } - - data.append('message_type', messageType); - - data.append('attachments[]', fileStream, { filename: fileName }); - - const sourceReplyId = quotedMsg?.chatwootMessageId || null; - - if (messageBody && instance) { - const replyToIds = await this.getReplyToIds(messageBody, instance); - - if (replyToIds.in_reply_to || replyToIds.in_reply_to_external_id) { - const content = JSON.stringify({ - ...replyToIds, - }); - data.append('content_attributes', content); + if (content) { + data.append('content', content); } - } - if (sourceReplyId) { - data.append('source_reply_id', sourceReplyId.toString()); - } + data.append('message_type', messageType); - if (sourceId) { - data.append('source_id', sourceId); - } + data.append('attachments[]', fileStream, { filename: fileName }); - const config = { - method: 'post', - maxBodyLength: Infinity, - url: `${this.provider.url}/api/v1/accounts/${this.provider.accountId}/conversations/${conversationId}/messages`, - headers: { - api_access_token: this.provider.token, - ...data.getHeaders(), - }, - data: data, + const sourceReplyId = quotedMsg?.chatwootMessageId || null; + + if (messageBody && instance) { + const replyToIds = await this.getReplyToIds(messageBody, instance); + + if (replyToIds.in_reply_to || replyToIds.in_reply_to_external_id) { + const content = JSON.stringify({ + ...replyToIds, + }); + data.append('content_attributes', content); + } + } + + if (sourceReplyId) { + data.append('source_reply_id', sourceReplyId.toString()); + } + + if (sourceId) { + data.append('source_id', sourceId); + } + + const config = { + method: 'post', + maxBodyLength: Infinity, + url: `${this.provider.url}/api/v1/accounts/${this.provider.accountId}/conversations/${convId}/messages`, + headers: { + api_access_token: this.provider.token, + ...data.getHeaders(), + }, + data: data, + }; + + const { data: responseData } = await axios.request(config); + return responseData; }; try { - const { data } = await axios.request(config); - - return data; + return await doSendData(conversationId); } catch (error) { - this.logger.error(error); + const errorMessage = error.toString().toLowerCase(); + const status = error.response?.status; + + if (errorMessage.includes('not found') || status === 404) { + this.logger.warn(`Conversation ${conversationId} not found. Retrying...`); + const bodyForRetry = messageBodyForRetry || messageBody; + + if (!bodyForRetry) { + this.logger.error('Cannot retry sendData without a message body for context.'); + return null; + } + + const remoteJid = bodyForRetry.key.remoteJid; + const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; + await this.cache.delete(cacheKey); + + const newConversationId = await this.createConversation(instance, bodyForRetry); + if (!newConversationId) { + this.logger.error(`Failed to create new conversation for ${remoteJid}`); + return null; + } + + this.logger.log(`Retrying sendData for ${remoteJid} with new conversation ${newConversationId}`); + return await doSendData(newConversationId); + } else { + this.logger.error(error); + return null; + } } } @@ -2032,6 +2101,7 @@ export class ChatwootService { body, 'WAID:' + body.key.id, quotedMsg, + null, ); if (!send) { @@ -2051,6 +2121,7 @@ export class ChatwootService { body, 'WAID:' + body.key.id, quotedMsg, + null, ); if (!send) { @@ -2076,6 +2147,7 @@ export class ChatwootService { }, 'WAID:' + body.key.id, quotedMsg, + body, ); if (!send) { this.logger.warn('message not sent'); @@ -2132,6 +2204,8 @@ export class ChatwootService { instance, body, 'WAID:' + body.key.id, + quotedMsg, + null, ); if (!send) { @@ -2173,6 +2247,7 @@ export class ChatwootService { body, 'WAID:' + body.key.id, quotedMsg, + null, ); if (!send) { @@ -2192,6 +2267,7 @@ export class ChatwootService { body, 'WAID:' + body.key.id, quotedMsg, + null, ); if (!send) { @@ -2262,6 +2338,7 @@ export class ChatwootService { }, 'WAID:' + body.key.id, null, + body, ); if (!send) { this.logger.warn('edited message not sent'); @@ -2515,7 +2592,8 @@ export class ChatwootService { and created_at >= now() - interval '6h' order by created_at desc`; - const messagesData = (await this.pgClient.query(sqlMessages))?.rows; + const pgClient = await this.getPgClient(); + const messagesData = (await pgClient.query(sqlMessages))?.rows; const ids: string[] = messagesData .filter((message) => !!message.source_id) .map((message) => message.source_id.replace('WAID:', '')); From 58b5561f72e20a729733b66b406b68899f4d7fd8 Mon Sep 17 00:00:00 2001 From: Vitor Manoel Santos Moura <72520858+Vitordotpy@users.noreply.github.com> Date: Thu, 25 Sep 2025 17:30:30 -0300 Subject: [PATCH 110/129] Update src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aplicação de desestruturação de objetos que é uma boa prática do ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .../integrations/chatbot/chatwoot/services/chatwoot.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index bca90082..e44ea86e 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -916,7 +916,7 @@ export class ChatwootService { return null; } - const remoteJid = bodyForRetry.key.remoteJid; + const {remoteJid} = bodyForRetry.key; const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; await this.cache.delete(cacheKey); From 8697329f7197a41be3898b2bfe4d9c9be06792aa Mon Sep 17 00:00:00 2001 From: Vitor Manoel Santos Moura <72520858+Vitordotpy@users.noreply.github.com> Date: Thu, 25 Sep 2025 17:30:43 -0300 Subject: [PATCH 111/129] Update src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aplicação de desestruturação de objetos que é uma boa prática do ts Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .../integrations/chatbot/chatwoot/services/chatwoot.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index e44ea86e..058ccd7b 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -1098,7 +1098,7 @@ export class ChatwootService { return null; } - const remoteJid = bodyForRetry.key.remoteJid; + const {remoteJid} = bodyForRetry.key; const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; await this.cache.delete(cacheKey); From 5dc1d02d0aa885e3839424221dbfc9062a3d7646 Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Thu, 25 Sep 2025 17:38:10 -0300 Subject: [PATCH 112/129] refactor(chatbot): melhorar tratamento de erros em mensagens no Chatwoot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implementada a função `handleStaleConversationError` para centralizar a lógica de tratamento de erros relacionados a conversas não encontradas. - A lógica de retry foi aprimorada para as funções `createMessage` e `sendData`, garantindo que as operações sejam reprocessadas corretamente em caso de falhas. - Removido código duplicado e melhorada a legibilidade do serviço Chatwoot. --- .../chatwoot/services/chatwoot.service.ts | 105 +++++++++--------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 058ccd7b..fd31da84 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -905,33 +905,53 @@ export class ChatwootService { try { return await doCreateMessage(conversationId); } catch (error) { - const errorMessage = error.toString().toLowerCase(); - const status = error.response?.status; - if (errorMessage.includes('not found') || status === 404) { - this.logger.warn(`Conversation ${conversationId} not found. Retrying...`); - const bodyForRetry = messageBodyForRetry || messageBody; + return this.handleStaleConversationError( + error, + instance, + conversationId, + messageBody, + messageBodyForRetry, + 'createMessage', + (newConvId) => doCreateMessage(newConvId), + ); + } + } - if (!bodyForRetry) { - this.logger.error('Cannot retry createMessage without a message body for context.'); - return null; - } + private async handleStaleConversationError( + error: any, + instance: InstanceDto, + conversationId: number, + messageBody: any, + messageBodyForRetry: any, + functionName: string, + originalFunction: (newConversationId: number) => Promise, + ) { + if (axios.isAxiosError(error) && error.response?.status === 404) { + this.logger.warn( + `Conversation ${conversationId} not found in Chatwoot. Retrying operation from ${functionName}...`, + ); + const bodyForRetry = messageBodyForRetry || messageBody; - const {remoteJid} = bodyForRetry.key; - const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; - await this.cache.delete(cacheKey); - - const newConversationId = await this.createConversation(instance, bodyForRetry); - if (!newConversationId) { - this.logger.error(`Failed to create new conversation for ${remoteJid}`); - return null; - } - - this.logger.log(`Retrying message creation for ${remoteJid} with new conversation ${newConversationId}`); - return await doCreateMessage(newConversationId); - } else { - this.logger.error(`Error creating message: ${error}`); - throw error; + if (!bodyForRetry || !bodyForRetry.key?.remoteJid) { + this.logger.error(`Cannot retry ${functionName} without a message body for context.`); + return null; } + + const { remoteJid } = bodyForRetry.key; + const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; + await this.cache.delete(cacheKey); + + const newConversationId = await this.createConversation(instance, bodyForRetry); + if (!newConversationId) { + this.logger.error(`Failed to create new conversation for ${remoteJid} during retry.`); + return null; + } + + this.logger.log(`Retrying ${functionName} for ${remoteJid} with new conversation ${newConversationId}`); + return await originalFunction(newConversationId); + } else { + this.logger.error(`Error in ${functionName}: ${error}`); + throw error; } } @@ -1086,34 +1106,15 @@ export class ChatwootService { try { return await doSendData(conversationId); } catch (error) { - const errorMessage = error.toString().toLowerCase(); - const status = error.response?.status; - - if (errorMessage.includes('not found') || status === 404) { - this.logger.warn(`Conversation ${conversationId} not found. Retrying...`); - const bodyForRetry = messageBodyForRetry || messageBody; - - if (!bodyForRetry) { - this.logger.error('Cannot retry sendData without a message body for context.'); - return null; - } - - const {remoteJid} = bodyForRetry.key; - const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; - await this.cache.delete(cacheKey); - - const newConversationId = await this.createConversation(instance, bodyForRetry); - if (!newConversationId) { - this.logger.error(`Failed to create new conversation for ${remoteJid}`); - return null; - } - - this.logger.log(`Retrying sendData for ${remoteJid} with new conversation ${newConversationId}`); - return await doSendData(newConversationId); - } else { - this.logger.error(error); - return null; - } + return this.handleStaleConversationError( + error, + instance, + conversationId, + messageBody, + messageBodyForRetry, + 'sendData', + (newConvId) => doSendData(newConvId), + ); } } From 069786b9fecded1f5ea9dabdb0d79b7a96fdcc5b Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Fri, 26 Sep 2025 12:56:34 -0300 Subject: [PATCH 113/129] chore(deps): update baileys package to version 7.0.0-rc.4 - Bumped baileys dependency version in package.json and package-lock.json to 7.0.0-rc.4 for improved functionality and bug fixes. --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c5a78a76..466a4ef9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "^7.0.0-rc.3", + "baileys": "^7.0.0-rc.4", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", @@ -5993,9 +5993,9 @@ } }, "node_modules/baileys": { - "version": "7.0.0-rc.3", - "resolved": "https://registry.npmjs.org/baileys/-/baileys-7.0.0-rc.3.tgz", - "integrity": "sha512-SVRLTDMKnWhX2P+bANVO1s/IigmGsN2UMbR69ftwsj+DtHxmSn8qjWftVZ//dTOhkncU7xZhTEOWtsOrPoemvQ==", + "version": "7.0.0-rc.4", + "resolved": "https://registry.npmjs.org/baileys/-/baileys-7.0.0-rc.4.tgz", + "integrity": "sha512-mmXWTRYg3lcs20s/qHYZ5PQP6/qwID8Kgft7m2nMaHdAF13GbRSq59IcZolcbQSJ9UIrw26HPCFA2xYdBHUcqA==", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index c48b2275..b3b14121 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "^7.0.0-rc.3", + "baileys": "^7.0.0-rc.4", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", From da6f1bd54062c1e6ece23c167eb810cbbacd954e Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Fri, 26 Sep 2025 12:58:36 -0300 Subject: [PATCH 114/129] chore(changelog): update CHANGELOG for Baileys v7.0.0-rc.4 and PostgreSQL connection improvements - Added entry for Baileys version update to v7.0.0-rc.4. - Refactored PostgreSQL connection handling and enhanced message processing capabilities. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3b617ea..9dfb834c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ - Fixed `ERROR: relation "public.Instance" does not exist` issue in migration `20250918182355_add_kafka_integration` - Aligned table naming convention with other Evolution API migrations for consistency - Resolved database migration failure that prevented Kafka integration setup +* **Update Baileys Version**: v7.0.0-rc.4 +* Refactor connection with PostgreSQL and improve message handling + ### From 22465c0a56ffd7f3bf4b17e7caf4b3d9b88209bb Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Fri, 26 Sep 2025 13:00:52 -0300 Subject: [PATCH 115/129] fix: corrigido incompatibilidade no use voise call da wavoip com versao nova da baileys --- .../channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts | 2 +- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts index 951be1a0..cb667f9c 100644 --- a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts +++ b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts @@ -71,7 +71,7 @@ export const useVoiceCallsBaileys = async ( socket.on('assertSessions', async (jids, force, callback) => { try { - const response = await baileys_sock.assertSessions(jids, force); + const response = await baileys_sock.assertSessions(jids); callback(response); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 34ef1366..02dfd560 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4561,8 +4561,8 @@ export class BaileysStartupService extends ChannelStartupService { return response; } - public async baileysAssertSessions(jids: string[], force: boolean) { - const response = await this.client.assertSessions(jids, force); + public async baileysAssertSessions(jids: string[]) { + const response = await this.client.assertSessions(jids); return response; } From c31b62fb3dfadf12233f336f15bb2bcc42579b25 Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Fri, 26 Sep 2025 16:00:39 -0300 Subject: [PATCH 116/129] =?UTF-8?q?fix(baileys):=20corrigir=20verifica?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20mensagem=20no=20servi=C3=A7o=20Baileys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajustada a lógica de verificação para garantir que o ID da mensagem seja definido apenas quando disponível, evitando possíveis erros de referência. - Atualizada a definição do caminho de traduções para suportar a estrutura de diretórios em produção. --- .../channel/whatsapp/whatsapp.baileys.service.ts | 5 ++++- src/utils/i18n.ts | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 02dfd560..ccb594f2 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1498,7 +1498,10 @@ export class BaileysStartupService extends ChannelStartupService { `) as any[]; findMessage = messages[0] || null; - if (findMessage) message.messageId = findMessage.id; + if (!findMessage?.id) { + continue; + } + message.messageId = findMessage.id; } if (update.message === null && update.status === undefined) { diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index af737ed0..09b9feb0 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -3,10 +3,11 @@ import fs from 'fs'; import i18next from 'i18next'; import path from 'path'; -const __dirname = path.resolve(process.cwd(), 'src', 'utils'); +const translationsPath = fs.existsSync(path.resolve(process.cwd(), 'dist')) + ? path.resolve(process.cwd(), 'dist', 'translations') + : path.resolve(process.cwd(), 'src', 'utils', 'translations'); const languages = ['en', 'pt-BR', 'es']; -const translationsPath = path.join(__dirname, 'translations'); const configService: ConfigService = new ConfigService(); const resources: any = {}; From eeb324227b55c9f9b1a37013438d57294d3e083b Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Fri, 26 Sep 2025 16:12:40 -0300 Subject: [PATCH 117/129] =?UTF-8?q?fix(baileys):=20adicionar=20log=20de=20?= =?UTF-8?q?aviso=20para=20mensagens=20n=C3=A3o=20encontradas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implementada uma mensagem de aviso no serviço Baileys quando a mensagem original não é encontrada durante a atualização, melhorando a rastreabilidade de erros. - Ajustada a lógica de verificação do caminho de traduções para garantir que o diretório correto seja utilizado, com tratamento de erro caso não seja encontrado. --- .../whatsapp/whatsapp.baileys.service.ts | 1 + src/utils/i18n.ts | 37 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index ccb594f2..82252dcb 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1499,6 +1499,7 @@ export class BaileysStartupService extends ChannelStartupService { findMessage = messages[0] || null; if (!findMessage?.id) { + this.logger.warn(`Original message not found for update. Skipping. Key: ${JSON.stringify(key)}`); continue; } message.messageId = findMessage.id; diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index 09b9feb0..e8aea42b 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -3,24 +3,37 @@ import fs from 'fs'; import i18next from 'i18next'; import path from 'path'; -const translationsPath = fs.existsSync(path.resolve(process.cwd(), 'dist')) - ? path.resolve(process.cwd(), 'dist', 'translations') - : path.resolve(process.cwd(), 'src', 'utils', 'translations'); +const distPath = path.resolve(process.cwd(), 'dist', 'translations'); +const srcPath = path.resolve(process.cwd(), 'src', 'utils', 'translations'); + +let translationsPath; + +if (fs.existsSync(distPath)) { + translationsPath = distPath; +} else if (fs.existsSync(srcPath)) { + translationsPath = srcPath; +} else { + console.error('Translations directory not found in dist or src.'); + // Fallback to a non-existent path or handle error appropriately + translationsPath = ''; +} const languages = ['en', 'pt-BR', 'es']; const configService: ConfigService = new ConfigService(); const resources: any = {}; -languages.forEach((language) => { - const languagePath = path.join(translationsPath, `${language}.json`); - if (fs.existsSync(languagePath)) { - const translationContent = fs.readFileSync(languagePath, 'utf8'); - resources[language] = { - translation: JSON.parse(translationContent), - }; - } -}); +if (translationsPath) { + languages.forEach((language) => { + const languagePath = path.join(translationsPath, `${language}.json`); + if (fs.existsSync(languagePath)) { + const translationContent = fs.readFileSync(languagePath, 'utf8'); + resources[language] = { + translation: JSON.parse(translationContent), + }; + } + }); +} i18next.init({ resources, From 0d8e8bc0fb7ee331437cf313e4220cdf590b7176 Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Sun, 28 Sep 2025 22:19:36 -0300 Subject: [PATCH 118/129] =?UTF-8?q?fix(chatwoot):=20corrige=20reabertura?= =?UTF-8?q?=20de=20conversas=20e=20loop=20de=20conex=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Este commit aborda duas questões críticas na integração com o Chatwoot para melhorar a estabilidade e a experiência do agente. Primeiro, as conversas que já estavam marcadas como "resolvidas" no Chatwoot não eram reabertas automaticamente quando o cliente enviava uma nova mensagem. Isso foi corrigido para que o sistema verifique o status da conversa e a reabra, garantindo que nenhuma nova interação seja perdida. Segundo, um bug no tratamento do evento de conexão fazia com que a mensagem de status "Conexão estabelecida com sucesso" fosse enviada repetidamente, poluindo o histórico da conversa. A lógica foi ajustada para garantir que esta notificação seja enviada apenas uma vez por evento de conexão. --- .../chatwoot/services/chatwoot.service.ts | 82 +++++++++++++------ 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index fd31da84..5025da31 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -747,34 +747,49 @@ export class ChatwootService { return null; } - let inboxConversation = contactConversations.payload.find( - (conversation) => conversation.inbox_id == filterInbox.id, - ); - if (inboxConversation) { - if (this.provider.reopenConversation) { - this.logger.verbose(`Found conversation in reopenConversation mode: ${JSON.stringify(inboxConversation)}`); - if (inboxConversation && this.provider.conversationPending && inboxConversation.status !== 'open') { - await client.conversations.toggleStatus({ - accountId: this.provider.accountId, - conversationId: inboxConversation.id, - data: { - status: 'pending', - }, - }); - } - } else { - inboxConversation = contactConversations.payload.find( - (conversation) => - conversation && conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, - ); - this.logger.verbose(`Found conversation: ${JSON.stringify(inboxConversation)}`); - } + let inboxConversation = null; + + if (this.provider.reopenConversation) { + inboxConversation = contactConversations.payload.find( + (conversation) => + conversation && conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, + ); if (inboxConversation) { - this.logger.verbose(`Returning existing conversation ID: ${inboxConversation.id}`); - this.cache.set(cacheKey, inboxConversation.id); - return inboxConversation.id; + this.logger.verbose( + `Found open conversation in reopenConversation mode: ${JSON.stringify(inboxConversation)}`, + ); + } else { + inboxConversation = contactConversations.payload.find( + (conversation) => conversation.inbox_id == filterInbox.id, + ); + + if (inboxConversation) { + this.logger.verbose(`Found resolved conversation to reopen: ${JSON.stringify(inboxConversation)}`); + if (this.provider.conversationPending && inboxConversation.status !== 'open') { + await client.conversations.toggleStatus({ + accountId: this.provider.accountId, + conversationId: inboxConversation.id, + data: { + status: 'pending', + }, + }); + this.logger.verbose(`Reopened resolved conversation ID: ${inboxConversation.id}`); + } + } } + } else { + inboxConversation = contactConversations.payload.find( + (conversation) => + conversation && conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, + ); + this.logger.verbose(`Found conversation: ${JSON.stringify(inboxConversation)}`); + } + + if (inboxConversation) { + this.logger.verbose(`Returning existing conversation ID: ${inboxConversation.id}`); + this.cache.set(cacheKey, inboxConversation.id); + return inboxConversation.id; } const data = { @@ -2407,12 +2422,25 @@ export class ChatwootService { if (event === 'connection.update') { if (body.status === 'open') { + const waInstance = this.waMonitor.waInstances[instance.instanceName]; // if we have qrcode count then we understand that a new connection was established - if (this.waMonitor.waInstances[instance.instanceName].qrCode.count > 0) { + if (waInstance && waInstance.qrCode.count > 0) { const msgConnection = i18next.t('cw.inbox.connected'); await this.createBotMessage(instance, msgConnection, 'incoming'); - this.waMonitor.waInstances[instance.instanceName].qrCode.count = 0; + waInstance.qrCode.count = 0; + + waInstance.lastConnectionNotification = Date.now(); + chatwootImport.clearAll(instance); + } else if (waInstance) { + const timeSinceLastNotification = Date.now() - (waInstance.lastConnectionNotification || 0); + const minIntervalMs = 30000; // 30 seconds + + if (timeSinceLastNotification < minIntervalMs) { + this.logger.warn( + `Connection notification skipped for ${instance.instanceName} - too frequent (${timeSinceLastNotification}ms since last)`, + ); + } } } } From f7862637b164c1e625b8bdfa4bd1ac27cc6c4c6e Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Sun, 28 Sep 2025 22:38:45 -0300 Subject: [PATCH 119/129] =?UTF-8?q?fix(chatwoot):=20otimizar=20l=C3=B3gica?= =?UTF-8?q?=20de=20reabertura=20de=20conversas=20e=20notifica=C3=A7=C3=A3o?= =?UTF-8?q?=20de=20conex=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Este commit introduz melhorias na integração com o Chatwoot, focando na reabertura de conversas e na notificação de conexão. A lógica foi refatorada para centralizar a busca por conversas abertas e a reabertura de conversas resolvidas, garantindo que interações não sejam perdidas. Além disso, foi implementado um intervalo mínimo para notificações de conexão, evitando mensagens excessivas e melhorando a experiência do usuário. --- .../chatwoot/services/chatwoot.service.ts | 124 ++++++++++-------- 1 file changed, 69 insertions(+), 55 deletions(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 5025da31..5e53b2ee 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -33,6 +33,8 @@ import mimeTypes from 'mime-types'; import path from 'path'; import { Readable } from 'stream'; +const MIN_CONNECTION_NOTIFICATION_INTERVAL_MS = 30000; // 30 seconds + interface ChatwootMessage { messageId?: number; inboxId?: number; @@ -747,43 +749,14 @@ export class ChatwootService { return null; } - let inboxConversation = null; + let inboxConversation = this.findOpenConversation(contactConversations.payload, filterInbox.id); - if (this.provider.reopenConversation) { - inboxConversation = contactConversations.payload.find( - (conversation) => - conversation && conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, + if (!inboxConversation && this.provider.reopenConversation) { + inboxConversation = await this.findAndReopenResolvedConversation( + client, + contactConversations.payload, + filterInbox.id, ); - - if (inboxConversation) { - this.logger.verbose( - `Found open conversation in reopenConversation mode: ${JSON.stringify(inboxConversation)}`, - ); - } else { - inboxConversation = contactConversations.payload.find( - (conversation) => conversation.inbox_id == filterInbox.id, - ); - - if (inboxConversation) { - this.logger.verbose(`Found resolved conversation to reopen: ${JSON.stringify(inboxConversation)}`); - if (this.provider.conversationPending && inboxConversation.status !== 'open') { - await client.conversations.toggleStatus({ - accountId: this.provider.accountId, - conversationId: inboxConversation.id, - data: { - status: 'pending', - }, - }); - this.logger.verbose(`Reopened resolved conversation ID: ${inboxConversation.id}`); - } - } - } - } else { - inboxConversation = contactConversations.payload.find( - (conversation) => - conversation && conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, - ); - this.logger.verbose(`Found conversation: ${JSON.stringify(inboxConversation)}`); } if (inboxConversation) { @@ -832,6 +805,45 @@ export class ChatwootService { } } + private findOpenConversation(conversations: any[], inboxId: number): any | null { + const openConversation = conversations.find( + (conversation) => conversation && conversation.status !== 'resolved' && conversation.inbox_id == inboxId, + ); + + if (openConversation) { + this.logger.verbose(`Found open conversation: ${JSON.stringify(openConversation)}`); + } + + return openConversation || null; + } + + private async findAndReopenResolvedConversation( + client: any, + conversations: any[], + inboxId: number, + ): Promise { + const resolvedConversation = conversations.find( + (conversation) => conversation && conversation.status === 'resolved' && conversation.inbox_id == inboxId, + ); + + if (resolvedConversation) { + this.logger.verbose(`Found resolved conversation to reopen: ${JSON.stringify(resolvedConversation)}`); + if (this.provider.conversationPending && resolvedConversation.status !== 'open') { + await client.conversations.toggleStatus({ + accountId: this.provider.accountId, + conversationId: resolvedConversation.id, + data: { + status: 'pending', + }, + }); + this.logger.verbose(`Reopened resolved conversation ID: ${resolvedConversation.id}`); + } + return resolvedConversation; + } + + return null; + } + public async getInbox(instance: InstanceDto): Promise { const cacheKey = `${instance.instanceName}:getInbox`; if (await this.cache.has(cacheKey)) { @@ -2420,28 +2432,30 @@ export class ChatwootService { await this.createBotMessage(instance, msgStatus, 'incoming'); } - if (event === 'connection.update') { - if (body.status === 'open') { - const waInstance = this.waMonitor.waInstances[instance.instanceName]; - // if we have qrcode count then we understand that a new connection was established - if (waInstance && waInstance.qrCode.count > 0) { - const msgConnection = i18next.t('cw.inbox.connected'); - await this.createBotMessage(instance, msgConnection, 'incoming'); - waInstance.qrCode.count = 0; + if (event === 'connection.update' && body.status === 'open') { + const waInstance = this.waMonitor.waInstances[instance.instanceName]; + if (!waInstance) return; - waInstance.lastConnectionNotification = Date.now(); + const now = Date.now(); + const timeSinceLastNotification = now - (waInstance.lastConnectionNotification || 0); - chatwootImport.clearAll(instance); - } else if (waInstance) { - const timeSinceLastNotification = Date.now() - (waInstance.lastConnectionNotification || 0); - const minIntervalMs = 30000; // 30 seconds - - if (timeSinceLastNotification < minIntervalMs) { - this.logger.warn( - `Connection notification skipped for ${instance.instanceName} - too frequent (${timeSinceLastNotification}ms since last)`, - ); - } - } + // Se a conexão foi estabelecida via QR code, notifica imediatamente. + if (waInstance.qrCode && waInstance.qrCode.count > 0) { + const msgConnection = i18next.t('cw.inbox.connected'); + await this.createBotMessage(instance, msgConnection, 'incoming'); + waInstance.qrCode.count = 0; + waInstance.lastConnectionNotification = now; + chatwootImport.clearAll(instance); + } + // Se não foi via QR code, verifica o throttling. + else if (timeSinceLastNotification >= MIN_CONNECTION_NOTIFICATION_INTERVAL_MS) { + const msgConnection = i18next.t('cw.inbox.connected'); + await this.createBotMessage(instance, msgConnection, 'incoming'); + waInstance.lastConnectionNotification = now; + } else { + this.logger.warn( + `Connection notification skipped for ${instance.instanceName} - too frequent (${timeSinceLastNotification}ms since last)`, + ); } } From c132379b3ab0cbd501f0b5881c61b0291d967a54 Mon Sep 17 00:00:00 2001 From: Vitordotpy Date: Mon, 29 Sep 2025 15:26:24 -0300 Subject: [PATCH 120/129] =?UTF-8?q?fix(chatwoot):=20ajustar=20l=C3=B3gica?= =?UTF-8?q?=20de=20verifica=C3=A7=C3=A3o=20de=20conversas=20e=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Este commit modifica a lógica de verificação de conversas no serviço Chatwoot, garantindo que a busca por conversas ativas seja priorizada em relação ao uso de cache. A verificação de cache foi removida em pontos críticos para evitar que conversas desatualizadas sejam utilizadas, melhorando a precisão na recuperação de dados. Além disso, a lógica de reabertura de conversas foi refinada para garantir que as interações sejam tratadas corretamente, mantendo a experiência do usuário mais fluida. --- .../chatwoot/services/chatwoot.service.ts | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 5e53b2ee..f439faed 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -606,12 +606,7 @@ export class ChatwootService { this.logger.verbose(`--- Start createConversation ---`); this.logger.verbose(`Instance: ${JSON.stringify(instance)}`); - // If it already exists in the cache, return conversationId - if (await this.cache.has(cacheKey)) { - const conversationId = (await this.cache.get(cacheKey)) as number; - this.logger.verbose(`Found conversation to: ${remoteJid}, conversation ID: ${conversationId}`); - return conversationId; - } + // Always check Chatwoot first, cache only as fallback // If lock already exists, wait until release or timeout if (await this.cache.has(lockKey)) { @@ -623,11 +618,7 @@ export class ChatwootService { break; } await new Promise((res) => setTimeout(res, 300)); - if (await this.cache.has(cacheKey)) { - const conversationId = (await this.cache.get(cacheKey)) as number; - this.logger.verbose(`Resolves creation of: ${remoteJid}, conversation ID: ${conversationId}`); - return conversationId; - } + // Removed cache check here to ensure we always check Chatwoot } } @@ -637,12 +628,9 @@ export class ChatwootService { try { /* - Double check after lock - Utilizei uma nova verificação para evitar que outra thread execute entre o terminio do while e o set lock + Double check after lock - REMOVED + This was causing the system to use cached conversations instead of checking Chatwoot */ - if (await this.cache.has(cacheKey)) { - return (await this.cache.get(cacheKey)) as number; - } const client = await this.clientCw(instance); if (!client) return null; @@ -749,14 +737,25 @@ export class ChatwootService { return null; } - let inboxConversation = this.findOpenConversation(contactConversations.payload, filterInbox.id); + let inboxConversation = null; - if (!inboxConversation && this.provider.reopenConversation) { - inboxConversation = await this.findAndReopenResolvedConversation( - client, - contactConversations.payload, - filterInbox.id, - ); + if (this.provider.reopenConversation) { + inboxConversation = this.findOpenConversation(contactConversations.payload, filterInbox.id); + + if (inboxConversation) { + this.logger.verbose( + `Found open conversation in reopenConversation mode: ${JSON.stringify(inboxConversation)}`, + ); + } else { + inboxConversation = await this.findAndReopenResolvedConversation( + client, + contactConversations.payload, + filterInbox.id, + ); + } + } else { + inboxConversation = this.findOpenConversation(contactConversations.payload, filterInbox.id); + this.logger.verbose(`Found conversation: ${JSON.stringify(inboxConversation)}`); } if (inboxConversation) { @@ -765,6 +764,14 @@ export class ChatwootService { return inboxConversation.id; } + if (await this.cache.has(cacheKey)) { + const conversationId = (await this.cache.get(cacheKey)) as number; + this.logger.warn( + `No active conversations found in Chatwoot, using cached conversation ID: ${conversationId} as fallback`, + ); + return conversationId; + } + const data = { contact_id: contactId.toString(), inbox_id: filterInbox.id.toString(), From 57ea6707bc882b28fe93cb5bb408f7cc5766c83b Mon Sep 17 00:00:00 2001 From: Spiller Date: Mon, 29 Sep 2025 20:50:39 -0300 Subject: [PATCH 121/129] feat: convert LID to phoneNumber on GROUP_PARTICIPANTS_UPDATE --- .../whatsapp/whatsapp.baileys.service.ts | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 34ef1366..3e39db2d 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1591,12 +1591,38 @@ export class BaileysStartupService extends ChannelStartupService { }); }, - 'group-participants.update': (participantsUpdate: { + 'group-participants.update': async (participantsUpdate: { id: string; participants: string[]; action: ParticipantAction; }) => { - this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); + try { + // Usa o mesmo método que o endpoint /group/participants + const groupParticipants = await this.findParticipants({ groupJid: participantsUpdate.id }); + + // Filtra apenas os participantes que estão no evento + const resolvedParticipants = participantsUpdate.participants.map((participantId) => { + const participantData = groupParticipants.participants.find(p => p.id === participantId); + + return { + jid: participantId, + phoneNumber: participantData?.phoneNumber || participantId, + name: participantData?.name, + imgUrl: participantData?.imgUrl, + }; + }); + + const enhancedParticipantsUpdate = { + ...participantsUpdate, + participants: resolvedParticipants + }; + + this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, enhancedParticipantsUpdate); + } catch (error) { + console.log('Erro ao buscar dados dos participantes para webhook:', error); + // Fallback - envia sem conversão + this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); + } this.updateGroupMetadataCache(participantsUpdate.id); }, From fb1fa4d91ad8845dc4ee4aa85d16c6dc137e7b26 Mon Sep 17 00:00:00 2001 From: Spiller Date: Tue, 30 Sep 2025 10:12:14 -0300 Subject: [PATCH 122/129] feat: add participantsData field maintaining backward compatibility - Keep original participants array (string[]) for backward compatibility - Add new participantsData field with resolved phone numbers and metadata - Consumers can migrate gradually from participants to participantsData - No breaking changes to existing webhook integrations Payload structure: - participants: string[] (original JID strings) - participantsData: object[] (enhanced with phoneNumber, name, imgUrl) --- .../whatsapp/whatsapp.baileys.service.ts | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 3e39db2d..ea695212 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1596,30 +1596,57 @@ export class BaileysStartupService extends ChannelStartupService { participants: string[]; action: ParticipantAction; }) => { + // ENHANCEMENT: Adds participantsData field while maintaining backward compatibility + // MAINTAINS: participants: string[] (original JID strings) + // ADDS: participantsData: { jid: string, phoneNumber: string, name?: string, imgUrl?: string }[] + // This enables LID to phoneNumber conversion without breaking existing webhook consumers + + // Helper to normalize participantId as phone number + const normalizePhoneNumber = (id: string): string => { + // Remove @lid, @s.whatsapp.net suffixes and extract just the number part + return id.split('@')[0]; + }; + try { // Usa o mesmo método que o endpoint /group/participants const groupParticipants = await this.findParticipants({ groupJid: participantsUpdate.id }); + // Validação para garantir que temos dados válidos + if (!groupParticipants?.participants || !Array.isArray(groupParticipants.participants)) { + throw new Error('Invalid participant data received from findParticipants'); + } + // Filtra apenas os participantes que estão no evento const resolvedParticipants = participantsUpdate.participants.map((participantId) => { const participantData = groupParticipants.participants.find(p => p.id === participantId); + let phoneNumber: string; + if (participantData?.phoneNumber) { + phoneNumber = participantData.phoneNumber; + } else { + phoneNumber = normalizePhoneNumber(participantId); + } + return { jid: participantId, - phoneNumber: participantData?.phoneNumber || participantId, + phoneNumber, name: participantData?.name, imgUrl: participantData?.imgUrl, }; }); + // Mantém formato original + adiciona dados resolvidos const enhancedParticipantsUpdate = { ...participantsUpdate, - participants: resolvedParticipants + participants: participantsUpdate.participants, // Mantém array original de strings + participantsData: resolvedParticipants // Adiciona dados resolvidos em campo separado }; this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, enhancedParticipantsUpdate); } catch (error) { - console.log('Erro ao buscar dados dos participantes para webhook:', error); + this.logger.error( + `Failed to resolve participant data for GROUP_PARTICIPANTS_UPDATE webhook: ${error.message} | Group: ${participantsUpdate.id} | Participants: ${participantsUpdate.participants.length}` + ); // Fallback - envia sem conversão this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); } From 6e1d027750641fa90555f2076a3f6172dcd8a641 Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Fri, 3 Oct 2025 14:47:24 -0300 Subject: [PATCH 123/129] feat(chatwoot): comprehensive improvements to message handling, editing, deletion and i18n - Fix bidirectional message deletion between Chatwoot and WhatsApp - Support deletion of multiple attachments sent together - Implement proper message editing with 'Edited Message:' prefix format - Enable deletion of edited messages by updating chatwootMessageId - Skip cache for deleted messages (messageStubType === 1) to prevent duplicates - Fix i18n translation path detection for production environment - Add automatic dev/prod path resolution for translation files - Improve error handling and logging for message operations Technical improvements: - Changed Chatwoot deletion query from findFirst to findMany for multiple attachments - Fixed instanceId override issue in message deletion payload - Added retry logic with Prisma MessageUpdate validation - Implemented cache bypass for revoked messages to ensure proper processing - Enhanced i18n to detect dist/ folder in production vs src/ in development Resolves issues with: - Message deletion not working from Chatwoot to WhatsApp - Multiple attachments causing incomplete deletion - Edited messages showing raw i18n keys instead of translated text - Cache collision preventing deletion of edited messages - Production environment not loading translation files correctly Note: Tested and validated with Chatwoot v4.1 in production environment --- .../whatsapp/whatsapp.baileys.service.ts | 32 +- .../chatwoot/services/chatwoot.service.ts | 466 ++++++++++++++---- src/utils/i18n.ts | 6 +- 3 files changed, 407 insertions(+), 97 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 34ef1366..cf80e30f 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1065,6 +1065,11 @@ export class BaileysStartupService extends ChannelStartupService { settings: any, ) => { try { + // Garantir que localChatwoot está carregado antes de processar mensagens + if (this.configService.get('CHATWOOT').ENABLED && !this.localChatwoot?.enabled) { + await this.loadChatwoot(); + } + for (const received of messages) { if (received.key.remoteJid?.includes('@lid') && (received.key as ExtendedMessageKey).senderPn) { (received.key as ExtendedMessageKey).previousRemoteJid = received.key.remoteJid; @@ -1445,12 +1450,17 @@ export class BaileysStartupService extends ChannelStartupService { const cached = await this.baileysCache.get(updateKey); - if (cached) { + // Não ignorar mensagens deletadas (messageStubType === 1) mesmo que estejam em cache + const isDeletedMessage = update.messageStubType === 1; + + if (cached && !isDeletedMessage) { this.logger.info(`Message duplicated ignored [avoid deadlock]: ${updateKey}`); continue; } - await this.baileysCache.set(updateKey, true, 30 * 60); + if (!isDeletedMessage) { + await this.baileysCache.set(updateKey, true, 30 * 60); + } if (status[update.status] === 'READ' && key.fromMe) { if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { @@ -1550,8 +1560,22 @@ export class BaileysStartupService extends ChannelStartupService { this.sendDataWebhook(Events.MESSAGES_UPDATE, message); - if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) - await this.prismaRepository.messageUpdate.create({ data: message }); + if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) { + // Verificar se a mensagem ainda existe antes de criar o update + const messageExists = await this.prismaRepository.message.findFirst({ + where: { + instanceId: message.instanceId, + key: { + path: ['id'], + equals: message.keyId, + }, + }, + }); + + if (messageExists) { + await this.prismaRepository.messageUpdate.create({ data: message }); + } + } const existingChat = await this.prismaRepository.chat.findFirst({ where: { instanceId: this.instanceId, remoteJid: message.remoteJid }, diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 5020bfa6..9d4e05f0 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -979,7 +979,7 @@ export class ChatwootService { private async sendData( conversationId: number, - fileStream: Readable, + fileData: Buffer | Readable, fileName: string, messageType: 'incoming' | 'outgoing' | undefined, content?: string, @@ -1005,7 +1005,7 @@ export class ChatwootService { data.append('message_type', messageType); - data.append('attachments[]', fileStream, { filename: fileName }); + data.append('attachments[]', fileData, { filename: fileName }); const sourceReplyId = quotedMsg?.chatwootMessageId || null; @@ -1123,20 +1123,135 @@ export class ChatwootService { public async sendAttachment(waInstance: any, number: string, media: any, caption?: string, options?: Options) { try { - const parsedMedia = path.parse(decodeURIComponent(media)); - let mimeType = mimeTypes.lookup(parsedMedia?.ext) || ''; - let fileName = parsedMedia?.name + parsedMedia?.ext; + // Sempre baixar o arquivo do MinIO/S3 antes de enviar + // URLs presigned podem expirar, então convertemos para base64 + let mediaBuffer: Buffer; + let mimeType: string; + let fileName: string; - if (!mimeType) { - const parts = media.split('/'); - fileName = decodeURIComponent(parts[parts.length - 1]); + try { + this.logger.verbose(`Downloading media from: ${media}`); + // Tentar fazer download do arquivo com autenticação do Chatwoot + // maxRedirects: 0 para não seguir redirects automaticamente const response = await axios.get(media, { responseType: 'arraybuffer', + timeout: 60000, // 60 segundos de timeout para arquivos grandes + headers: { + api_access_token: this.provider.token, + }, + maxRedirects: 0, // Não seguir redirects automaticamente + validateStatus: (status) => status < 500, // Aceitar redirects (301, 302, 307) }); - mimeType = response.headers['content-type']; + + this.logger.verbose(`Initial response status: ${response.status}`); + + // Se for redirect, pegar a URL de destino e fazer novo request + if (response.status >= 300 && response.status < 400) { + const redirectUrl = response.headers.location; + this.logger.verbose(`Redirect to: ${redirectUrl}`); + + if (redirectUrl) { + // Fazer novo request para a URL do S3/MinIO (sem autenticação, pois é presigned URL) + // IMPORTANTE: Chatwoot pode gerar a URL presigned ANTES de fazer upload + // Vamos tentar com retry se receber 404 (arquivo ainda não disponível) + this.logger.verbose('Downloading from S3/MinIO...'); + + let s3Response; + let retryCount = 0; + const maxRetries = 3; + const retryDelay = 2000; // 2 segundos entre tentativas + + while (retryCount <= maxRetries) { + s3Response = await axios.get(redirectUrl, { + responseType: 'arraybuffer', + timeout: 60000, // 60 segundos para arquivos grandes + validateStatus: (status) => status < 500, + }); + + this.logger.verbose( + `S3 response status: ${s3Response.status}, size: ${s3Response.data?.byteLength || 0} bytes (attempt ${retryCount + 1}/${maxRetries + 1})`, + ); + + // Se não for 404, sair do loop + if (s3Response.status !== 404) { + break; + } + + // Se for 404 e ainda tem tentativas, aguardar e tentar novamente + if (retryCount < maxRetries) { + const errorBody = s3Response.data?.toString ? s3Response.data.toString('utf-8') : s3Response.data; + this.logger.warn( + `File not yet available in S3/MinIO (attempt ${retryCount + 1}/${maxRetries + 1}). Retrying in ${retryDelay}ms...`, + ); + this.logger.verbose(`MinIO Response: ${errorBody}`); + await new Promise((resolve) => setTimeout(resolve, retryDelay)); + retryCount++; + } else { + // Última tentativa falhou + break; + } + } + + // Após todas as tentativas, verificar o status final + if (s3Response.status === 404) { + const errorBody = s3Response.data?.toString ? s3Response.data.toString('utf-8') : s3Response.data; + this.logger.error(`File not found in S3/MinIO after ${maxRetries + 1} attempts. URL: ${redirectUrl}`); + this.logger.error(`MinIO Error Response: ${errorBody}`); + throw new Error( + 'File not found in S3/MinIO (404). The file may have been deleted, the URL is incorrect, or Chatwoot has not finished uploading yet.', + ); + } + + if (s3Response.status === 403) { + this.logger.error(`Access denied to S3/MinIO. URL may have expired: ${redirectUrl}`); + throw new Error( + 'Access denied to S3/MinIO (403). Presigned URL may have expired. Check S3_PRESIGNED_EXPIRATION setting.', + ); + } + + if (s3Response.status >= 400) { + this.logger.error(`S3/MinIO error ${s3Response.status}: ${s3Response.statusText}`); + throw new Error(`S3/MinIO error ${s3Response.status}: ${s3Response.statusText}`); + } + + mediaBuffer = Buffer.from(s3Response.data); + mimeType = s3Response.headers['content-type'] || 'application/octet-stream'; + this.logger.verbose(`Downloaded ${mediaBuffer.length} bytes from S3, type: ${mimeType}`); + } else { + this.logger.error('Redirect response without Location header'); + throw new Error('Redirect without Location header'); + } + } else if (response.status === 404) { + this.logger.error(`File not found (404) at: ${media}`); + throw new Error('File not found (404). The attachment may not exist in Chatwoot storage.'); + } else if (response.status >= 400) { + this.logger.error(`HTTP ${response.status}: ${response.statusText} for URL: ${media}`); + throw new Error(`HTTP ${response.status}: ${response.statusText}`); + } else { + // Download direto sem redirect + mediaBuffer = Buffer.from(response.data); + mimeType = response.headers['content-type'] || 'application/octet-stream'; + this.logger.verbose(`Downloaded ${mediaBuffer.length} bytes directly, type: ${mimeType}`); + } + + // Extrair nome do arquivo da URL ou usar o content-disposition + const parsedMedia = path.parse(decodeURIComponent(media)); + if (parsedMedia?.name && parsedMedia?.ext) { + fileName = parsedMedia.name + parsedMedia.ext; + } else { + const parts = media.split('/'); + fileName = decodeURIComponent(parts[parts.length - 1].split('?')[0]); + } + + this.logger.verbose(`File name: ${fileName}, size: ${mediaBuffer.length} bytes`); + } catch (downloadError) { + this.logger.error('Error downloading media from: ' + media); + this.logger.error(downloadError); + throw new Error(`Failed to download media: ${downloadError.message}`); } + // Determinar o tipo de mídia pelo mimetype let type = 'document'; switch (mimeType.split('/')[0]) { @@ -1154,10 +1269,12 @@ export class ChatwootService { break; } + // Para áudio, usar base64 com data URI if (type === 'audio') { + const base64Audio = `data:${mimeType};base64,${mediaBuffer.toString('base64')}`; const data: SendAudioDto = { number: number, - audio: media, + audio: base64Audio, delay: 1200, quoted: options?.quoted, }; @@ -1169,8 +1286,12 @@ export class ChatwootService { return messageSent; } + // Para outros tipos, converter para base64 puro (sem prefixo data URI) + const base64Media = mediaBuffer.toString('base64'); + const documentExtensions = ['.gif', '.svg', '.tiff', '.tif']; - if (type === 'image' && parsedMedia && documentExtensions.includes(parsedMedia?.ext)) { + const parsedExt = path.parse(fileName)?.ext; + if (type === 'image' && parsedExt && documentExtensions.includes(parsedExt)) { type = 'document'; } @@ -1178,7 +1299,7 @@ export class ChatwootService { number: number, mediatype: type as any, fileName: fileName, - media: media, + media: base64Media, // Base64 puro, sem prefixo delay: 1200, quoted: options?.quoted, }; @@ -1194,6 +1315,7 @@ export class ChatwootService { return messageSent; } catch (error) { this.logger.error(error); + throw error; // Re-throw para que o erro seja tratado pelo caller } } @@ -1254,6 +1376,61 @@ export class ChatwootService { this.cache.delete(keyToDelete); } + // Log para debug de mensagens deletadas + if (body.event === 'message_updated') { + this.logger.verbose( + `Message updated event - deleted: ${body.content_attributes?.deleted}, messageId: ${body.id}`, + ); + } + + // Processar deleção de mensagem ANTES das outras validações + if (body.event === 'message_updated' && body.content_attributes?.deleted) { + this.logger.verbose(`Processing message deletion from Chatwoot - messageId: ${body.id}`); + const waInstance = this.waMonitor.waInstances[instance.instanceName]; + + // Buscar TODAS as mensagens com esse chatwootMessageId (pode ser múltiplos anexos) + const messages = await this.prismaRepository.message.findMany({ + where: { + chatwootMessageId: body.id, + instanceId: instance.instanceId, + }, + }); + + if (messages && messages.length > 0) { + this.logger.verbose(`Found ${messages.length} message(s) to delete from Chatwoot message ${body.id}`); + + // Deletar cada mensagem no WhatsApp + for (const message of messages) { + const key = message.key as ExtendedMessageKey; + this.logger.verbose(`Deleting WhatsApp message - keyId: ${key?.id}`); + + try { + await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); + this.logger.verbose(`Message ${key.id} deleted in WhatsApp successfully`); + } catch (error) { + this.logger.error(`Error deleting message ${key.id} in WhatsApp: ${error}`); + } + } + + // Remover todas as mensagens do banco de dados + await this.prismaRepository.message.deleteMany({ + where: { + instanceId: instance.instanceId, + chatwootMessageId: body.id, + }, + }); + this.logger.verbose(`${messages.length} message(s) removed from database`); + } else { + // Mensagem não encontrada - pode ser uma mensagem antiga que foi substituída por edição + // Nesse caso, ignoramos silenciosamente pois o ID já foi atualizado no banco + this.logger.verbose( + `Message not found for chatwootMessageId: ${body.id} - may have been replaced by an edited message`, + ); + } + + return { message: 'deleted' }; + } + if ( !body?.conversation || body.private || @@ -1276,29 +1453,6 @@ export class ChatwootService { const senderName = body?.conversation?.messages[0]?.sender?.available_name || body?.sender?.name; const waInstance = this.waMonitor.waInstances[instance.instanceName]; - if (body.event === 'message_updated' && body.content_attributes?.deleted) { - const message = await this.prismaRepository.message.findFirst({ - where: { - chatwootMessageId: body.id, - instanceId: instance.instanceId, - }, - }); - - if (message) { - const key = message.key as ExtendedMessageKey; - - await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); - - await this.prismaRepository.message.deleteMany({ - where: { - instanceId: instance.instanceId, - chatwootMessageId: body.id, - }, - }); - } - return { message: 'bot' }; - } - const cwBotContact = this.configService.get('CHATWOOT').BOT_CONTACT; if (chatId === '123456' && body.message_type === 'outgoing') { @@ -1394,40 +1548,58 @@ export class ChatwootService { for (const message of body.conversation.messages) { if (message.attachments && message.attachments.length > 0) { - for (const attachment of message.attachments) { - if (!messageReceived) { - formatText = null; + // Processa anexos de forma assíncrona para não bloquear o webhook + const processAttachments = async () => { + for (const attachment of message.attachments) { + if (!messageReceived) { + formatText = null; + } + + const options: Options = { + quoted: await this.getQuotedMessage(body, instance), + }; + + try { + const messageSent = await this.sendAttachment( + waInstance, + chatId, + attachment.data_url, + formatText, + options, + ); + + if (!messageSent && body.conversation?.id) { + this.onSendMessageError(instance, body.conversation?.id); + } + + if (messageSent) { + await this.updateChatwootMessageId( + { + ...messageSent, + owner: instance.instanceName, + }, + { + messageId: body.id, + inboxId: body.inbox?.id, + conversationId: body.conversation?.id, + contactInboxSourceId: body.conversation?.contact_inbox?.source_id, + }, + instance, + ); + } + } catch (error) { + this.logger.error(error); + if (body.conversation?.id) { + this.onSendMessageError(instance, body.conversation?.id, error); + } + } } + }; - const options: Options = { - quoted: await this.getQuotedMessage(body, instance), - }; - - const messageSent = await this.sendAttachment( - waInstance, - chatId, - attachment.data_url, - formatText, - options, - ); - if (!messageSent && body.conversation?.id) { - this.onSendMessageError(instance, body.conversation?.id); - } - - await this.updateChatwootMessageId( - { - ...messageSent, - owner: instance.instanceName, - }, - { - messageId: body.id, - inboxId: body.inbox?.id, - conversationId: body.conversation?.id, - contactInboxSourceId: body.conversation?.contact_inbox?.source_id, - }, - instance, - ); - } + // Executa em background sem bloquear + processAttachments().catch((error) => { + this.logger.error(error); + }); } else { const data: SendTextDto = { number: chatId, @@ -1450,10 +1622,7 @@ export class ChatwootService { } await this.updateChatwootMessageId( - { - ...messageSent, - instanceId: instance.instanceId, - }, + messageSent, // Já tem instanceId { messageId: body.id, inboxId: body.inbox?.id, @@ -1544,11 +1713,55 @@ export class ChatwootService { const key = message.key as ExtendedMessageKey; if (!chatwootMessageIds.messageId || !key?.id) { + this.logger.verbose( + `Skipping updateChatwootMessageId - messageId: ${chatwootMessageIds.messageId}, keyId: ${key?.id}`, + ); + return; + } + + // Use instanceId from message or fallback to instance + const instanceId = message.instanceId || instance.instanceId; + + this.logger.verbose( + `Updating message with chatwootMessageId: ${chatwootMessageIds.messageId}, keyId: ${key.id}, instanceId: ${instanceId}`, + ); + + // Aguarda um pequeno delay para garantir que a mensagem foi criada no banco + await new Promise((resolve) => setTimeout(resolve, 100)); + + // Verifica se a mensagem existe antes de atualizar + let retries = 0; + const maxRetries = 5; + let messageExists = false; + + while (retries < maxRetries && !messageExists) { + const existingMessage = await this.prismaRepository.message.findFirst({ + where: { + instanceId: instanceId, + key: { + path: ['id'], + equals: key.id, + }, + }, + }); + + if (existingMessage) { + messageExists = true; + this.logger.verbose(`Message found in database after ${retries} retries`); + } else { + retries++; + this.logger.verbose(`Message not found, retry ${retries}/${maxRetries}`); + await new Promise((resolve) => setTimeout(resolve, 200)); + } + } + + if (!messageExists) { + this.logger.warn(`Message not found in database after ${maxRetries} retries, keyId: ${key.id}`); return; } // Use raw SQL to avoid JSON path issues - await this.prismaRepository.$executeRaw` + const result = await this.prismaRepository.$executeRaw` UPDATE "Message" SET "chatwootMessageId" = ${chatwootMessageIds.messageId}, @@ -1556,10 +1769,12 @@ export class ChatwootService { "chatwootInboxId" = ${chatwootMessageIds.inboxId}, "chatwootContactInboxSourceId" = ${chatwootMessageIds.contactInboxSourceId}, "chatwootIsRead" = ${chatwootMessageIds.isRead || false} - WHERE "instanceId" = ${instance.instanceId} + WHERE "instanceId" = ${instanceId} AND "key"->>'id' = ${key.id} `; + this.logger.verbose(`Update result: ${result} rows affected`); + if (this.isImportHistoryAvailable()) { chatwootImport.updateMessageSourceID(chatwootMessageIds.messageId, key.id); } @@ -1996,11 +2211,6 @@ export class ChatwootService { const fileData = Buffer.from(downloadBase64.base64, 'base64'); - const fileStream = new Readable(); - fileStream._read = () => {}; - fileStream.push(fileData); - fileStream.push(null); - if (body.key.remoteJid.includes('@g.us')) { const participantName = body.pushName; const rawPhoneNumber = body.key.participant.split('@')[0]; @@ -2024,7 +2234,7 @@ export class ChatwootService { const send = await this.sendData( getConversation, - fileStream, + fileData, nameFile, messageType, content, @@ -2043,7 +2253,7 @@ export class ChatwootService { } else { const send = await this.sendData( getConversation, - fileStream, + fileData, nameFile, messageType, bodyMessage, @@ -2109,11 +2319,6 @@ export class ChatwootService { }); const processedBuffer = await img.getBuffer(JimpMime.png); - const fileStream = new Readable(); - fileStream._read = () => {}; // _read is required but you can noop it - fileStream.push(processedBuffer); - fileStream.push(null); - const truncStr = (str: string, len: number) => { if (!str) return ''; @@ -2125,7 +2330,7 @@ export class ChatwootService { const send = await this.sendData( getConversation, - fileStream, + processedBuffer, nameFile, messageType, `${bodyMessage}\n\n\n**${title}**\n${description}\n${adsMessage.sourceUrl}`, @@ -2235,9 +2440,53 @@ export class ChatwootService { } if (event === 'messages.edit' || event === 'send.message.update') { - const editedText = `${ - body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text - }\n\n_\`${i18next.t('cw.message.edited')}.\`_`; + const editedMessageContent = + body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text; + + // Se não houver conteúdo editado, verificar se é uma deleção + if (!editedMessageContent || editedMessageContent.trim() === '') { + // Verificar se é uma mensagem revogada (messageStubType: 1) + const messageStubType = body?.update?.messageStubType || body?.messageStubType; + this.logger.verbose( + `No edited content found - messageStubType: ${messageStubType}, body.update: ${JSON.stringify(body?.update)}`, + ); + + if (messageStubType === 1) { + // É uma mensagem deletada - processar exclusão no Chatwoot + this.logger.verbose('Message revoked detected, processing deletion in Chatwoot'); + + const message = await this.getMessageByKeyId(instance, body?.key?.id); + + if (message?.chatwootMessageId && message?.chatwootConversationId) { + try { + await client.messages.delete({ + accountId: this.provider.accountId, + conversationId: message.chatwootConversationId, + messageId: message.chatwootMessageId, + }); + this.logger.verbose(`Deleted revoked message ${message.chatwootMessageId} in Chatwoot`); + + // Remover do banco de dados + await this.prismaRepository.message.deleteMany({ + where: { + key: { + path: ['id'], + equals: body.key.id, + }, + instanceId: instance.instanceId, + }, + }); + this.logger.verbose(`Removed revoked message from database`); + } catch (error) { + this.logger.error(`Error deleting revoked message: ${error}`); + } + } + } else { + this.logger.verbose('Message deleted, skipping edit notification'); + } + return; + } + const message = await this.getMessageByKeyId(instance, body?.key?.id); if (!message) { @@ -2246,10 +2495,24 @@ export class ChatwootService { } const key = message.key as ExtendedMessageKey; - const messageType = key?.fromMe ? 'outgoing' : 'incoming'; - if (message && message.chatwootConversationId) { + if (message && message.chatwootConversationId && message.chatwootMessageId) { + // Deletar a mensagem original no Chatwoot + try { + await client.messages.delete({ + accountId: this.provider.accountId, + conversationId: message.chatwootConversationId, + messageId: message.chatwootMessageId, + }); + this.logger.verbose(`Deleted original message ${message.chatwootMessageId} for edit`); + } catch (error) { + this.logger.error(`Error deleting original message for edit: ${error}`); + } + + // Criar nova mensagem com formato: "Mensagem editada:\n\nteste1" + const editedText = `${i18next.t('cw.message.edited')}:\n\n${editedMessageContent}`; + const send = await this.createMessage( instance, message.chatwootConversationId, @@ -2263,10 +2526,31 @@ export class ChatwootService { 'WAID:' + body.key.id, null, ); + if (!send) { this.logger.warn('edited message not sent'); return; } + + this.logger.verbose(`Created edited message in Chatwoot with ID: ${send.id}`); + + // Atualizar o chatwootMessageId no banco para apontar para a nova mensagem + // Isso permite que a exclusão funcione após a edição + try { + await this.prismaRepository.message.update({ + where: { + id: message.id, + }, + data: { + chatwootMessageId: send.id, + }, + }); + this.logger.verbose( + `Updated chatwootMessageId from ${message.chatwootMessageId} to ${send.id} for message ${body.key.id}`, + ); + } catch (error) { + this.logger.error(`Error updating chatwootMessageId after edit: ${error}`); + } } return; } diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index af737ed0..aef9308a 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -3,10 +3,12 @@ import fs from 'fs'; import i18next from 'i18next'; import path from 'path'; -const __dirname = path.resolve(process.cwd(), 'src', 'utils'); +// Detect if running from dist/ (production) or src/ (development) +const isProduction = fs.existsSync(path.join(process.cwd(), 'dist')); +const baseDir = isProduction ? 'dist' : 'src/utils'; +const translationsPath = path.join(process.cwd(), baseDir, 'translations'); const languages = ['en', 'pt-BR', 'es']; -const translationsPath = path.join(__dirname, 'translations'); const configService: ConfigService = new ConfigService(); const resources: any = {}; From bedfb019aa8eb0efbc31275117d51314eeff43e2 Mon Sep 17 00:00:00 2001 From: Spiller Date: Mon, 6 Oct 2025 11:53:50 -0300 Subject: [PATCH 124/129] fix lint --- .../whatsapp/whatsapp.baileys.service.ts | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index ea695212..44b0122c 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -500,8 +500,8 @@ export class BaileysStartupService extends ChannelStartupService { try { // Use raw SQL to avoid JSON path issues const webMessageInfo = (await this.prismaRepository.$queryRaw` - SELECT * FROM "Message" - WHERE "instanceId" = ${this.instanceId} + SELECT * FROM "Message" + WHERE "instanceId" = ${this.instanceId} AND "key"->>'id' = ${key.id} `) as proto.IWebMessageInfo[]; @@ -1491,8 +1491,8 @@ export class BaileysStartupService extends ChannelStartupService { if (configDatabaseData.HISTORIC || configDatabaseData.NEW_MESSAGE) { // Use raw SQL to avoid JSON path issues const messages = (await this.prismaRepository.$queryRaw` - SELECT * FROM "Message" - WHERE "instanceId" = ${this.instanceId} + SELECT * FROM "Message" + WHERE "instanceId" = ${this.instanceId} AND "key"->>'id' = ${key.id} LIMIT 1 `) as any[]; @@ -1600,33 +1600,33 @@ export class BaileysStartupService extends ChannelStartupService { // MAINTAINS: participants: string[] (original JID strings) // ADDS: participantsData: { jid: string, phoneNumber: string, name?: string, imgUrl?: string }[] // This enables LID to phoneNumber conversion without breaking existing webhook consumers - + // Helper to normalize participantId as phone number const normalizePhoneNumber = (id: string): string => { // Remove @lid, @s.whatsapp.net suffixes and extract just the number part return id.split('@')[0]; }; - + try { - // Usa o mesmo método que o endpoint /group/participants + // Usa o mesmo método que o endpoint /group/participants const groupParticipants = await this.findParticipants({ groupJid: participantsUpdate.id }); - + // Validação para garantir que temos dados válidos if (!groupParticipants?.participants || !Array.isArray(groupParticipants.participants)) { throw new Error('Invalid participant data received from findParticipants'); } - + // Filtra apenas os participantes que estão no evento const resolvedParticipants = participantsUpdate.participants.map((participantId) => { - const participantData = groupParticipants.participants.find(p => p.id === participantId); - + const participantData = groupParticipants.participants.find((p) => p.id === participantId); + let phoneNumber: string; if (participantData?.phoneNumber) { phoneNumber = participantData.phoneNumber; } else { phoneNumber = normalizePhoneNumber(participantId); } - + return { jid: participantId, phoneNumber, @@ -1639,13 +1639,14 @@ export class BaileysStartupService extends ChannelStartupService { const enhancedParticipantsUpdate = { ...participantsUpdate, participants: participantsUpdate.participants, // Mantém array original de strings - participantsData: resolvedParticipants // Adiciona dados resolvidos em campo separado + // Adiciona dados resolvidos em campo separado + participantsData: resolvedParticipants, }; - + this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, enhancedParticipantsUpdate); } catch (error) { this.logger.error( - `Failed to resolve participant data for GROUP_PARTICIPANTS_UPDATE webhook: ${error.message} | Group: ${participantsUpdate.id} | Participants: ${participantsUpdate.participants.length}` + `Failed to resolve participant data for GROUP_PARTICIPANTS_UPDATE webhook: ${error.message} | Group: ${participantsUpdate.id} | Participants: ${participantsUpdate.participants.length}`, ); // Fallback - envia sem conversão this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); @@ -4514,7 +4515,7 @@ export class BaileysStartupService extends ChannelStartupService { // Use raw SQL to avoid JSON path issues const result = await this.prismaRepository.$executeRaw` - UPDATE "Message" + UPDATE "Message" SET "status" = ${status[4]} WHERE "instanceId" = ${this.instanceId} AND "key"->>'remoteJid' = ${remoteJid} @@ -4539,7 +4540,7 @@ export class BaileysStartupService extends ChannelStartupService { this.prismaRepository.chat.findFirst({ where: { remoteJid } }), // Use raw SQL to avoid JSON path issues this.prismaRepository.$queryRaw` - SELECT COUNT(*)::int as count FROM "Message" + SELECT COUNT(*)::int as count FROM "Message" WHERE "instanceId" = ${this.instanceId} AND "key"->>'remoteJid' = ${remoteJid} AND ("key"->>'fromMe')::boolean = false From 53cd7d5d1319f29c60485b6a9d35f76c9ae90378 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 6 Oct 2025 14:28:24 -0300 Subject: [PATCH 125/129] chore(deps): update baileys package to version 7.0.0-rc.5 - Bumped baileys dependency version in package.json and package-lock.json to 7.0.0-rc.5 for improved functionality and bug fixes. - Added p-queue and p-timeout packages for enhanced performance and timeout management. --- package-lock.json | 38 ++++++++++++++++--- package.json | 2 +- .../whatsapp/whatsapp.baileys.service.ts | 14 +++---- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 466a4ef9..815b9775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "^7.0.0-rc.4", + "baileys": "^7.0.0-rc.5", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", @@ -5993,19 +5993,19 @@ } }, "node_modules/baileys": { - "version": "7.0.0-rc.4", - "resolved": "https://registry.npmjs.org/baileys/-/baileys-7.0.0-rc.4.tgz", - "integrity": "sha512-mmXWTRYg3lcs20s/qHYZ5PQP6/qwID8Kgft7m2nMaHdAF13GbRSq59IcZolcbQSJ9UIrw26HPCFA2xYdBHUcqA==", + "version": "7.0.0-rc.5", + "resolved": "https://registry.npmjs.org/baileys/-/baileys-7.0.0-rc.5.tgz", + "integrity": "sha512-y95gW7UtKbD4dQb46G75rnr0U0LtnBItA002ARggDiCgm92Z8wnM+wxqC8OI/sDFanz3TgzqE4t7MPwNusUqUQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { "@cacheable/node-cache": "^1.4.0", "@hapi/boom": "^9.1.3", "async-mutex": "^0.5.0", - "axios": "^1.6.0", "libsignal": "git+https://github.com/whiskeysockets/libsignal-node.git", "lru-cache": "^11.1.0", "music-metadata": "^11.7.0", + "p-queue": "^9.0.0", "pino": "^9.6", "protobufjs": "^7.2.4", "ws": "^8.13.0" @@ -12169,6 +12169,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.0.0.tgz", + "integrity": "sha512-KO1RyxstL9g1mK76530TExamZC/S2Glm080Nx8PE5sTd7nlduDQsAfEl4uXX+qZjLiwvDauvzXavufy3+rJ9zQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^7.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-7.0.0.tgz", + "integrity": "sha512-DhZ7ydOE3JXtXzDf2wz/KEamkKAD7Il5So09I2tOz4i+9pLcdghDKKmODkkoHKJ0TyczmhcHNxyTeTrsENT81A==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", diff --git a/package.json b/package.json index b3b14121..bff453fb 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "^7.0.0-rc.4", + "baileys": "^7.0.0-rc.5", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 82252dcb..d60b6bab 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -3371,18 +3371,18 @@ export class BaileysStartupService extends ChannelStartupService { } const numberJid = numberVerified?.jid || user.jid; - const lid = - typeof numberVerified?.lid === 'string' - ? numberVerified.lid - : numberJid.includes('@lid') - ? numberJid.split('@')[1] - : undefined; + // const lid = + // typeof numberVerified?.lid === 'string' + // ? numberVerified.lid + // : numberJid.includes('@lid') + // ? numberJid.split('@')[1] + // : undefined; return new OnWhatsAppDto( numberJid, !!numberVerified?.exists, user.number, contacts.find((c) => c.remoteJid === numberJid)?.pushName, - lid, + // lid, ); }), ); From e13434804c17edbd54b296cd5e559e15704a0aba Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Mon, 6 Oct 2025 15:10:38 -0300 Subject: [PATCH 126/129] refactor: implement exponential backoff patterns and extract magic numbers to constants - Extract HTTP timeout constant (60s for large file downloads) - Extract S3/MinIO retry configuration (3 retries, 1s-8s exponential backoff) - Extract database polling retry configuration (5 retries, 100ms-2s exponential backoff) - Extract webhook and lock polling delays to named constants - Extract cache TTL values (5min for messages, 30min for updates) in Baileys service - Implement exponential backoff for S3/MinIO downloads following webhook controller pattern - Implement exponential backoff for database polling removing fixed delays - Add deletion event lock to prevent race conditions with duplicate webhooks - Process deletion events immediately (no delay) to fix Chatwoot local storage red error - Make i18n translations path configurable via TRANSLATIONS_BASE_DIR env variable - Add detailed logging for deletion events debugging Addresses code review suggestions from Sourcery AI and Copilot AI: - Magic numbers extracted to well-documented constants - Retry configurations consolidated and clearly separated by use case - S3/MinIO retry uses longer delays (external storage) - Database polling uses shorter delays (internal operations) - Fixes Chatwoot local storage deletion error (red message issue) - Maintains full compatibility with S3/MinIO storage (tested) Breaking changes: None - all changes are internal improvements --- .../whatsapp/whatsapp.baileys.service.ts | 12 +- .../chatwoot/services/chatwoot.service.ts | 118 +++++++++++++----- src/utils/i18n.ts | 16 ++- 3 files changed, 111 insertions(+), 35 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index cf80e30f..a3f70062 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -254,6 +254,10 @@ export class BaileysStartupService extends ChannelStartupService { private endSession = false; private logBaileys = this.configService.get('LOG').BAILEYS; + // Cache TTL constants (in seconds) + private readonly MESSAGE_CACHE_TTL_SECONDS = 5 * 60; // 5 minutes - avoid duplicate message processing + private readonly UPDATE_CACHE_TTL_SECONDS = 30 * 60; // 30 minutes - avoid duplicate status updates + public stateConnection: wa.StateConnection = { state: 'close' }; public phoneNumber: string; @@ -1155,7 +1159,7 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - await this.baileysCache.set(messageKey, true, 5 * 60); + await this.baileysCache.set(messageKey, true, this.MESSAGE_CACHE_TTL_SECONDS); if ( (type !== 'notify' && type !== 'append') || @@ -1275,7 +1279,7 @@ export class BaileysStartupService extends ChannelStartupService { await this.updateMessagesReadedByTimestamp(remoteJid, timestamp); } - await this.baileysCache.set(messageKey, true, 5 * 60); + await this.baileysCache.set(messageKey, true, this.MESSAGE_CACHE_TTL_SECONDS); } else { this.logger.info(`Update readed messages duplicated ignored [avoid deadlock]: ${messageKey}`); } @@ -1459,7 +1463,7 @@ export class BaileysStartupService extends ChannelStartupService { } if (!isDeletedMessage) { - await this.baileysCache.set(updateKey, true, 30 * 60); + await this.baileysCache.set(updateKey, true, this.UPDATE_CACHE_TTL_SECONDS); } if (status[update.status] === 'READ' && key.fromMe) { @@ -1543,7 +1547,7 @@ export class BaileysStartupService extends ChannelStartupService { if (status[update.status] === status[4]) { this.logger.log(`Update as read in message.update ${remoteJid} - ${timestamp}`); await this.updateMessagesReadedByTimestamp(remoteJid, timestamp); - await this.baileysCache.set(messageKey, true, 5 * 60); + await this.baileysCache.set(messageKey, true, this.MESSAGE_CACHE_TTL_SECONDS); } await this.prismaRepository.message.update({ diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 9d4e05f0..e5a0bc07 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -44,6 +44,25 @@ interface ChatwootMessage { export class ChatwootService { private readonly logger = new Logger('ChatwootService'); + // HTTP timeout constants + private readonly MEDIA_DOWNLOAD_TIMEOUT_MS = 60000; // 60 seconds for large files + + // S3/MinIO retry configuration (external storage - longer delays, fewer retries) + private readonly S3_MAX_RETRIES = 3; + private readonly S3_BASE_DELAY_MS = 1000; // Base delay: 1 second + private readonly S3_MAX_DELAY_MS = 8000; // Max delay: 8 seconds + + // Database polling retry configuration (internal DB - shorter delays, more retries) + private readonly DB_POLLING_MAX_RETRIES = 5; + private readonly DB_POLLING_BASE_DELAY_MS = 100; // Base delay: 100ms + private readonly DB_POLLING_MAX_DELAY_MS = 2000; // Max delay: 2 seconds + + // Webhook processing delay + private readonly WEBHOOK_INITIAL_DELAY_MS = 500; // Initial delay before processing webhook + + // Lock polling delay + private readonly LOCK_POLLING_DELAY_MS = 300; // Delay between lock status checks + private provider: any; constructor( @@ -617,7 +636,7 @@ export class ChatwootService { this.logger.warn(`Timeout aguardando lock para ${remoteJid}`); break; } - await new Promise((res) => setTimeout(res, 300)); + await new Promise((res) => setTimeout(res, this.LOCK_POLLING_DELAY_MS)); if (await this.cache.has(cacheKey)) { const conversationId = (await this.cache.get(cacheKey)) as number; this.logger.verbose(`Resolves creation of: ${remoteJid}, conversation ID: ${conversationId}`); @@ -1136,7 +1155,7 @@ export class ChatwootService { // maxRedirects: 0 para não seguir redirects automaticamente const response = await axios.get(media, { responseType: 'arraybuffer', - timeout: 60000, // 60 segundos de timeout para arquivos grandes + timeout: this.MEDIA_DOWNLOAD_TIMEOUT_MS, headers: { api_access_token: this.provider.token, }, @@ -1154,18 +1173,19 @@ export class ChatwootService { if (redirectUrl) { // Fazer novo request para a URL do S3/MinIO (sem autenticação, pois é presigned URL) // IMPORTANTE: Chatwoot pode gerar a URL presigned ANTES de fazer upload - // Vamos tentar com retry se receber 404 (arquivo ainda não disponível) + // Vamos tentar com retry usando exponential backoff se receber 404 (arquivo ainda não disponível) this.logger.verbose('Downloading from S3/MinIO...'); let s3Response; let retryCount = 0; - const maxRetries = 3; - const retryDelay = 2000; // 2 segundos entre tentativas + const maxRetries = this.S3_MAX_RETRIES; + const baseDelay = this.S3_BASE_DELAY_MS; + const maxDelay = this.S3_MAX_DELAY_MS; while (retryCount <= maxRetries) { s3Response = await axios.get(redirectUrl, { responseType: 'arraybuffer', - timeout: 60000, // 60 segundos para arquivos grandes + timeout: this.MEDIA_DOWNLOAD_TIMEOUT_MS, validateStatus: (status) => status < 500, }); @@ -1178,14 +1198,16 @@ export class ChatwootService { break; } - // Se for 404 e ainda tem tentativas, aguardar e tentar novamente + // Se for 404 e ainda tem tentativas, aguardar com exponential backoff e tentar novamente if (retryCount < maxRetries) { + // Exponential backoff com max delay (seguindo padrão do webhook controller) + const backoffDelay = Math.min(baseDelay * Math.pow(2, retryCount), maxDelay); const errorBody = s3Response.data?.toString ? s3Response.data.toString('utf-8') : s3Response.data; this.logger.warn( - `File not yet available in S3/MinIO (attempt ${retryCount + 1}/${maxRetries + 1}). Retrying in ${retryDelay}ms...`, + `File not yet available in S3/MinIO (attempt ${retryCount + 1}/${maxRetries + 1}). Retrying in ${backoffDelay}ms with exponential backoff...`, ); this.logger.verbose(`MinIO Response: ${errorBody}`); - await new Promise((resolve) => setTimeout(resolve, retryDelay)); + await new Promise((resolve) => setTimeout(resolve, backoffDelay)); retryCount++; } else { // Última tentativa falhou @@ -1246,8 +1268,10 @@ export class ChatwootService { this.logger.verbose(`File name: ${fileName}, size: ${mediaBuffer.length} bytes`); } catch (downloadError) { - this.logger.error('Error downloading media from: ' + media); - this.logger.error(downloadError); + this.logger.error('[MEDIA DOWNLOAD] ❌ Error downloading media from: ' + media); + this.logger.error(`[MEDIA DOWNLOAD] Error message: ${downloadError.message}`); + this.logger.error(`[MEDIA DOWNLOAD] Error stack: ${downloadError.stack}`); + this.logger.error(`[MEDIA DOWNLOAD] Full error: ${JSON.stringify(downloadError, null, 2)}`); throw new Error(`Failed to download media: ${downloadError.message}`); } @@ -1357,7 +1381,32 @@ export class ChatwootService { public async receiveWebhook(instance: InstanceDto, body: any) { try { - await new Promise((resolve) => setTimeout(resolve, 500)); + // IMPORTANTE: Verificar lock de deleção ANTES do delay inicial + // para evitar race condition com webhooks duplicados + let isDeletionEvent = false; + if (body.event === 'message_updated' && body.content_attributes?.deleted) { + isDeletionEvent = true; + const deleteLockKey = `${instance.instanceName}:deleteMessage-${body.id}`; + + // Verificar se já está processando esta deleção + if (await this.cache.has(deleteLockKey)) { + this.logger.warn(`[DELETE] ⏭️ SKIPPING: Deletion already in progress for messageId: ${body.id}`); + return { message: 'already_processing' }; + } + + // Adquirir lock IMEDIATAMENTE por 30 segundos + await this.cache.set(deleteLockKey, true, 30); + + this.logger.warn( + `[WEBHOOK-DELETE] Event: ${body.event}, messageId: ${body.id}, conversation: ${body.conversation?.id}`, + ); + } + + // Para deleções, processar IMEDIATAMENTE (sem delay) + // Para outros eventos, aguardar delay inicial + if (!isDeletionEvent) { + await new Promise((resolve) => setTimeout(resolve, this.WEBHOOK_INITIAL_DELAY_MS)); + } const client = await this.clientCw(instance); @@ -1385,7 +1434,10 @@ export class ChatwootService { // Processar deleção de mensagem ANTES das outras validações if (body.event === 'message_updated' && body.content_attributes?.deleted) { - this.logger.verbose(`Processing message deletion from Chatwoot - messageId: ${body.id}`); + // Lock já foi adquirido no início do método (antes do delay) + const deleteLockKey = `${instance.instanceName}:deleteMessage-${body.id}`; + + this.logger.warn(`[DELETE] 🗑️ Processing deletion - messageId: ${body.id}`); const waInstance = this.waMonitor.waInstances[instance.instanceName]; // Buscar TODAS as mensagens com esse chatwootMessageId (pode ser múltiplos anexos) @@ -1397,18 +1449,22 @@ export class ChatwootService { }); if (messages && messages.length > 0) { - this.logger.verbose(`Found ${messages.length} message(s) to delete from Chatwoot message ${body.id}`); + this.logger.warn(`[DELETE] Found ${messages.length} message(s) to delete from Chatwoot message ${body.id}`); + this.logger.verbose(`[DELETE] Messages keys: ${messages.map((m) => (m.key as any)?.id).join(', ')}`); // Deletar cada mensagem no WhatsApp for (const message of messages) { const key = message.key as ExtendedMessageKey; - this.logger.verbose(`Deleting WhatsApp message - keyId: ${key?.id}`); + this.logger.warn( + `[DELETE] Attempting to delete WhatsApp message - keyId: ${key?.id}, remoteJid: ${key?.remoteJid}`, + ); try { await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); - this.logger.verbose(`Message ${key.id} deleted in WhatsApp successfully`); + this.logger.warn(`[DELETE] ✅ Message ${key.id} deleted in WhatsApp successfully`); } catch (error) { - this.logger.error(`Error deleting message ${key.id} in WhatsApp: ${error}`); + this.logger.error(`[DELETE] ❌ Error deleting message ${key.id} in WhatsApp: ${error}`); + this.logger.error(`[DELETE] Error details: ${JSON.stringify(error, null, 2)}`); } } @@ -1419,15 +1475,16 @@ export class ChatwootService { chatwootMessageId: body.id, }, }); - this.logger.verbose(`${messages.length} message(s) removed from database`); + this.logger.warn(`[DELETE] ✅ SUCCESS: ${messages.length} message(s) deleted from WhatsApp and database`); } else { // Mensagem não encontrada - pode ser uma mensagem antiga que foi substituída por edição // Nesse caso, ignoramos silenciosamente pois o ID já foi atualizado no banco - this.logger.verbose( - `Message not found for chatwootMessageId: ${body.id} - may have been replaced by an edited message`, - ); + this.logger.warn(`[DELETE] ⚠️ WARNING: Message not found in DB - chatwootMessageId: ${body.id}`); } + // Liberar lock após processar + await this.cache.delete(deleteLockKey); + return { message: 'deleted' }; } @@ -1726,12 +1783,11 @@ export class ChatwootService { `Updating message with chatwootMessageId: ${chatwootMessageIds.messageId}, keyId: ${key.id}, instanceId: ${instanceId}`, ); - // Aguarda um pequeno delay para garantir que a mensagem foi criada no banco - await new Promise((resolve) => setTimeout(resolve, 100)); - - // Verifica se a mensagem existe antes de atualizar + // Verifica se a mensagem existe antes de atualizar usando polling com exponential backoff let retries = 0; - const maxRetries = 5; + const maxRetries = this.DB_POLLING_MAX_RETRIES; + const baseDelay = this.DB_POLLING_BASE_DELAY_MS; + const maxDelay = this.DB_POLLING_MAX_DELAY_MS; let messageExists = false; while (retries < maxRetries && !messageExists) { @@ -1750,8 +1806,14 @@ export class ChatwootService { this.logger.verbose(`Message found in database after ${retries} retries`); } else { retries++; - this.logger.verbose(`Message not found, retry ${retries}/${maxRetries}`); - await new Promise((resolve) => setTimeout(resolve, 200)); + if (retries < maxRetries) { + // Exponential backoff com max delay (seguindo padrão do sistema) + const backoffDelay = Math.min(baseDelay * Math.pow(2, retries - 1), maxDelay); + this.logger.verbose(`Message not found, retry ${retries}/${maxRetries} in ${backoffDelay}ms`); + await new Promise((resolve) => setTimeout(resolve, backoffDelay)); + } else { + this.logger.verbose(`Message not found after ${retries} attempts`); + } } } diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index aef9308a..e02abd91 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -3,9 +3,19 @@ import fs from 'fs'; import i18next from 'i18next'; import path from 'path'; -// Detect if running from dist/ (production) or src/ (development) -const isProduction = fs.existsSync(path.join(process.cwd(), 'dist')); -const baseDir = isProduction ? 'dist' : 'src/utils'; +// Make translations base directory configurable via environment variable +const envBaseDir = process.env.TRANSLATIONS_BASE_DIR; +let baseDir: string; + +if (envBaseDir) { + // Use explicitly configured base directory + baseDir = envBaseDir; +} else { + // Fallback to auto-detection if env variable is not set + const isProduction = fs.existsSync(path.join(process.cwd(), 'dist')); + baseDir = isProduction ? 'dist' : 'src/utils'; +} + const translationsPath = path.join(process.cwd(), baseDir, 'translations'); const languages = ['en', 'pt-BR', 'es']; From d4b0cfd2ba40db8337a6e70232c615141a33ec79 Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Mon, 6 Oct 2025 16:14:26 -0300 Subject: [PATCH 127/129] fix(chatwoot): resolve webhook timeout on deletion with 5+ images Problem: - Chatwoot shows red error when deleting messages with 5+ images - Cause: Chatwoot webhook timeout of 5 seconds - Processing 5 images takes ~9 seconds - Duplicate webhooks arrive during processing Solution: - Implemented async processing with setImmediate() - Webhook responds immediately (< 100ms) - Deletion processes in background without blocking - Maintains idempotency with cache (1 hour TTL) - Maintains lock mechanism (60 seconds TTL) Benefits: - Scales infinitely (10, 20, 100+ images) - No timeout regardless of quantity - No error messages in Chatwoot - Reliable background processing Tested: - 5 images: 9s background processing - Webhook response: < 100ms - No red error in Chatwoot - Deletion completes successfully BREAKING CHANGE: Fixed assertSessions signature to accept force parameter --- .../voiceCalls/useVoiceCallsBaileys.ts | 2 +- .../whatsapp/whatsapp.baileys.service.ts | 4 +- .../chatwoot/services/chatwoot.service.ts | 119 +++++++++++------- 3 files changed, 75 insertions(+), 50 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts index cb667f9c..951be1a0 100644 --- a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts +++ b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts @@ -71,7 +71,7 @@ export const useVoiceCallsBaileys = async ( socket.on('assertSessions', async (jids, force, callback) => { try { - const response = await baileys_sock.assertSessions(jids); + const response = await baileys_sock.assertSessions(jids, force); callback(response); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 3d463079..ed2226ee 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4593,8 +4593,8 @@ export class BaileysStartupService extends ChannelStartupService { return response; } - public async baileysAssertSessions(jids: string[]) { - const response = await this.client.assertSessions(jids); + public async baileysAssertSessions(jids: string[], force?: boolean) { + const response = await this.client.assertSessions(jids, force); return response; } diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index f1e217f5..fd78fb96 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -1122,7 +1122,9 @@ export class ChatwootService { data.append('message_type', messageType); - data.append('attachments[]', fileStream, { filename: fileName }); + if (fileData && fileName) { + data.append('attachments[]', fileData, { filename: fileName }); + } const sourceReplyId = quotedMsg?.chatwootMessageId || null; @@ -1487,6 +1489,59 @@ export class ChatwootService { }); } + /** + * Processa deleção de mensagem em background + * Método assíncrono chamado via setImmediate para não bloquear resposta do webhook + */ + private async processDeletion(instance: InstanceDto, body: any, deleteLockKey: string) { + this.logger.warn(`[DELETE] 🗑️ Processing deletion - messageId: ${body.id}`); + const waInstance = this.waMonitor.waInstances[instance.instanceName]; + + // Buscar TODAS as mensagens com esse chatwootMessageId (pode ser múltiplos anexos) + const messages = await this.prismaRepository.message.findMany({ + where: { + chatwootMessageId: body.id, + instanceId: instance.instanceId, + }, + }); + + if (messages && messages.length > 0) { + this.logger.warn(`[DELETE] Found ${messages.length} message(s) to delete from Chatwoot message ${body.id}`); + this.logger.verbose(`[DELETE] Messages keys: ${messages.map((m) => (m.key as any)?.id).join(', ')}`); + + // Deletar cada mensagem no WhatsApp + for (const message of messages) { + const key = message.key as ExtendedMessageKey; + this.logger.warn( + `[DELETE] Attempting to delete WhatsApp message - keyId: ${key?.id}, remoteJid: ${key?.remoteJid}`, + ); + + try { + await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); + this.logger.warn(`[DELETE] ✅ Message ${key.id} deleted in WhatsApp successfully`); + } catch (error) { + this.logger.error(`[DELETE] ❌ Error deleting message ${key.id} in WhatsApp: ${error}`); + this.logger.error(`[DELETE] Error details: ${JSON.stringify(error, null, 2)}`); + } + } + + // Remover todas as mensagens do banco de dados + await this.prismaRepository.message.deleteMany({ + where: { + instanceId: instance.instanceId, + chatwootMessageId: body.id, + }, + }); + this.logger.warn(`[DELETE] ✅ SUCCESS: ${messages.length} message(s) deleted from WhatsApp and database`); + } else { + // Mensagem não encontrada - pode ser uma mensagem antiga que foi substituída por edição + this.logger.warn(`[DELETE] ⚠️ WARNING: Message not found in DB - chatwootMessageId: ${body.id}`); + } + + // Liberar lock após processar + await this.cache.delete(deleteLockKey); + } + public async receiveWebhook(instance: InstanceDto, body: any) { try { // IMPORTANTE: Verificar lock de deleção ANTES do delay inicial @@ -1545,55 +1600,25 @@ export class ChatwootService { // Lock já foi adquirido no início do método (antes do delay) const deleteLockKey = `${instance.instanceName}:deleteMessage-${body.id}`; - this.logger.warn(`[DELETE] 🗑️ Processing deletion - messageId: ${body.id}`); - const waInstance = this.waMonitor.waInstances[instance.instanceName]; + // ESTRATÉGIA: Processar em background e responder IMEDIATAMENTE + // Isso evita timeout do Chatwoot (5s) quando há muitas imagens (> 5s de processamento) + this.logger.warn(`[DELETE] 🚀 Starting background deletion - messageId: ${body.id}`); - // Buscar TODAS as mensagens com esse chatwootMessageId (pode ser múltiplos anexos) - const messages = await this.prismaRepository.message.findMany({ - where: { - chatwootMessageId: body.id, - instanceId: instance.instanceId, - }, + // Executar em background (sem await) - não bloqueia resposta do webhook + setImmediate(async () => { + try { + await this.processDeletion(instance, body, deleteLockKey); + } catch (error) { + this.logger.error(`[DELETE] ❌ Background deletion failed for messageId ${body.id}: ${error}`); + } }); - if (messages && messages.length > 0) { - this.logger.warn(`[DELETE] Found ${messages.length} message(s) to delete from Chatwoot message ${body.id}`); - this.logger.verbose(`[DELETE] Messages keys: ${messages.map((m) => (m.key as any)?.id).join(', ')}`); - - // Deletar cada mensagem no WhatsApp - for (const message of messages) { - const key = message.key as ExtendedMessageKey; - this.logger.warn( - `[DELETE] Attempting to delete WhatsApp message - keyId: ${key?.id}, remoteJid: ${key?.remoteJid}`, - ); - - try { - await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); - this.logger.warn(`[DELETE] ✅ Message ${key.id} deleted in WhatsApp successfully`); - } catch (error) { - this.logger.error(`[DELETE] ❌ Error deleting message ${key.id} in WhatsApp: ${error}`); - this.logger.error(`[DELETE] Error details: ${JSON.stringify(error, null, 2)}`); - } - } - - // Remover todas as mensagens do banco de dados - await this.prismaRepository.message.deleteMany({ - where: { - instanceId: instance.instanceId, - chatwootMessageId: body.id, - }, - }); - this.logger.warn(`[DELETE] ✅ SUCCESS: ${messages.length} message(s) deleted from WhatsApp and database`); - } else { - // Mensagem não encontrada - pode ser uma mensagem antiga que foi substituída por edição - // Nesse caso, ignoramos silenciosamente pois o ID já foi atualizado no banco - this.logger.warn(`[DELETE] ⚠️ WARNING: Message not found in DB - chatwootMessageId: ${body.id}`); - } - - // Liberar lock após processar - await this.cache.delete(deleteLockKey); - - return { message: 'deleted' }; + // RESPONDER IMEDIATAMENTE ao Chatwoot (< 50ms) + return { + message: 'deletion_accepted', + messageId: body.id, + note: 'Deletion is being processed in background', + }; } if ( From 94ddc0dfbe49e8df936074e11c48b4040417ee5b Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Mon, 6 Oct 2025 19:12:32 -0300 Subject: [PATCH 128/129] fix(baileys): use type assertion for assertSessions compatibility Problem: - GitHub Actions shows: Expected 1 arguments, but got 2 - Local environment shows: Expected 2 arguments, but got 1 - Different Baileys versions/definitions between environments Solution: - Use 'as any' type assertion for force parameter - Maintains compatibility with both signature variations - Allows code to work in all environments Technical notes: - Local: baileys@7.0.0-rc.5 expects 2 arguments (jids, force) - GitHub Actions: May have different version/cache expecting 1 argument - Type assertion bypasses strict type checking for cross-version compatibility --- .../channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts | 2 +- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts index 951be1a0..6f7c292a 100644 --- a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts +++ b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts @@ -71,7 +71,7 @@ export const useVoiceCallsBaileys = async ( socket.on('assertSessions', async (jids, force, callback) => { try { - const response = await baileys_sock.assertSessions(jids, force); + const response = await baileys_sock.assertSessions(jids, force as any); callback(response); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index ed2226ee..2613ee4b 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4594,7 +4594,7 @@ export class BaileysStartupService extends ChannelStartupService { } public async baileysAssertSessions(jids: string[], force?: boolean) { - const response = await this.client.assertSessions(jids, force); + const response = await this.client.assertSessions(jids, force as any); return response; } From 98b7f15a439ffd686cd339645d9969d7a72ed79d Mon Sep 17 00:00:00 2001 From: Anderson Silva Date: Mon, 6 Oct 2025 19:30:13 -0300 Subject: [PATCH 129/129] fix(baileys): update to 7.0.0-rc.5 and fix assertSessions signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - GitHub Actions failing: Expected 1 arguments, but got 2 - Local had outdated Baileys 7.0.0-rc.3 in node_modules - assertSessions signature changed between versions Solution: - Fresh npm install with Baileys 7.0.0-rc.5 - Updated assertSessions to pass only jids (no force param) - Regenerated Prisma Client after reinstall - Updated package-lock.json for version consistency Changes: - assertSessions now receives 1 argument (jids only) - Kept force param in method signature for API compatibility - Removed @ts-expect-error directives (no longer needed) Tested: - ✅ Server starts successfully - ✅ Build passes without errors - ✅ Lint passes --- package-lock.json | 4133 +++++++++-------- .../voiceCalls/useVoiceCallsBaileys.ts | 2 +- .../whatsapp/whatsapp.baileys.service.ts | 6 +- 3 files changed, 2216 insertions(+), 1925 deletions(-) diff --git a/package-lock.json b/package-lock.json index 815b9775..1cc17228 100644 --- a/package-lock.json +++ b/package-lock.json @@ -229,51 +229,51 @@ } }, "node_modules/@aws-sdk/client-sqs": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.891.0.tgz", - "integrity": "sha512-+c/A8Rqa2pTMR4ZljJ8GRWJc9kI0oBQCRelPDLkDLamGEH8EKJksIaDTw15TvJr+Mg6FZrnIRyDWhSRX57RyYQ==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.901.0.tgz", + "integrity": "sha512-rbBmLQrwjJ9o9qMJe/jMYnGZFgkKMYM9+EAIljxS/J2EkNMUlfbRrNjTI0r8NjtMNo8wRnY3Gf7CcYIA+gDFNw==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.890.0", - "@aws-sdk/credential-provider-node": "3.891.0", - "@aws-sdk/middleware-host-header": "3.891.0", - "@aws-sdk/middleware-logger": "3.891.0", - "@aws-sdk/middleware-recursion-detection": "3.891.0", - "@aws-sdk/middleware-sdk-sqs": "3.891.0", - "@aws-sdk/middleware-user-agent": "3.891.0", - "@aws-sdk/region-config-resolver": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.891.0", - "@aws-sdk/util-user-agent-browser": "3.887.0", - "@aws-sdk/util-user-agent-node": "3.891.0", - "@smithy/config-resolver": "^4.2.2", - "@smithy/core": "^3.11.0", - "@smithy/fetch-http-handler": "^5.2.1", - "@smithy/hash-node": "^4.1.1", - "@smithy/invalid-dependency": "^4.1.1", - "@smithy/md5-js": "^4.1.1", - "@smithy/middleware-content-length": "^4.1.1", - "@smithy/middleware-endpoint": "^4.2.2", - "@smithy/middleware-retry": "^4.2.3", - "@smithy/middleware-serde": "^4.1.1", - "@smithy/middleware-stack": "^4.1.1", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/node-http-handler": "^4.2.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.2", - "@smithy/types": "^4.5.0", - "@smithy/url-parser": "^4.1.1", - "@smithy/util-base64": "^4.1.0", - "@smithy/util-body-length-browser": "^4.1.0", - "@smithy/util-body-length-node": "^4.1.0", - "@smithy/util-defaults-mode-browser": "^4.1.2", - "@smithy/util-defaults-mode-node": "^4.1.2", - "@smithy/util-endpoints": "^3.1.2", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.2", - "@smithy/util-utf8": "^4.1.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/credential-provider-node": "3.901.0", + "@aws-sdk/middleware-host-header": "3.901.0", + "@aws-sdk/middleware-logger": "3.901.0", + "@aws-sdk/middleware-recursion-detection": "3.901.0", + "@aws-sdk/middleware-sdk-sqs": "3.901.0", + "@aws-sdk/middleware-user-agent": "3.901.0", + "@aws-sdk/region-config-resolver": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@aws-sdk/util-endpoints": "3.901.0", + "@aws-sdk/util-user-agent-browser": "3.901.0", + "@aws-sdk/util-user-agent-node": "3.901.0", + "@smithy/config-resolver": "^4.3.0", + "@smithy/core": "^3.14.0", + "@smithy/fetch-http-handler": "^5.3.0", + "@smithy/hash-node": "^4.2.0", + "@smithy/invalid-dependency": "^4.2.0", + "@smithy/md5-js": "^4.2.0", + "@smithy/middleware-content-length": "^4.2.0", + "@smithy/middleware-endpoint": "^4.3.0", + "@smithy/middleware-retry": "^4.4.0", + "@smithy/middleware-serde": "^4.2.0", + "@smithy/middleware-stack": "^4.2.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/node-http-handler": "^4.3.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/url-parser": "^4.2.0", + "@smithy/util-base64": "^4.2.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.0", + "@smithy/util-defaults-mode-browser": "^4.2.0", + "@smithy/util-defaults-mode-node": "^4.2.0", + "@smithy/util-endpoints": "^3.2.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-retry": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -281,48 +281,48 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.891.0.tgz", - "integrity": "sha512-QMDaD9GhJe7l0KQp3Tt7dzqFCz/H2XuyNjQgvi10nM1MfI1RagmLtmEhZveQxMPhZ/AtohLSK0Tisp/I5tR8RQ==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.901.0.tgz", + "integrity": "sha512-sGyDjjkJ7ppaE+bAKL/Q5IvVCxtoyBIzN+7+hWTS/mUxWJ9EOq9238IqmVIIK6sYNIzEf9yhobfMARasPYVTNg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.890.0", - "@aws-sdk/middleware-host-header": "3.891.0", - "@aws-sdk/middleware-logger": "3.891.0", - "@aws-sdk/middleware-recursion-detection": "3.891.0", - "@aws-sdk/middleware-user-agent": "3.891.0", - "@aws-sdk/region-config-resolver": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.891.0", - "@aws-sdk/util-user-agent-browser": "3.887.0", - "@aws-sdk/util-user-agent-node": "3.891.0", - "@smithy/config-resolver": "^4.2.2", - "@smithy/core": "^3.11.0", - "@smithy/fetch-http-handler": "^5.2.1", - "@smithy/hash-node": "^4.1.1", - "@smithy/invalid-dependency": "^4.1.1", - "@smithy/middleware-content-length": "^4.1.1", - "@smithy/middleware-endpoint": "^4.2.2", - "@smithy/middleware-retry": "^4.2.3", - "@smithy/middleware-serde": "^4.1.1", - "@smithy/middleware-stack": "^4.1.1", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/node-http-handler": "^4.2.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.2", - "@smithy/types": "^4.5.0", - "@smithy/url-parser": "^4.1.1", - "@smithy/util-base64": "^4.1.0", - "@smithy/util-body-length-browser": "^4.1.0", - "@smithy/util-body-length-node": "^4.1.0", - "@smithy/util-defaults-mode-browser": "^4.1.2", - "@smithy/util-defaults-mode-node": "^4.1.2", - "@smithy/util-endpoints": "^3.1.2", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.2", - "@smithy/util-utf8": "^4.1.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/middleware-host-header": "3.901.0", + "@aws-sdk/middleware-logger": "3.901.0", + "@aws-sdk/middleware-recursion-detection": "3.901.0", + "@aws-sdk/middleware-user-agent": "3.901.0", + "@aws-sdk/region-config-resolver": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@aws-sdk/util-endpoints": "3.901.0", + "@aws-sdk/util-user-agent-browser": "3.901.0", + "@aws-sdk/util-user-agent-node": "3.901.0", + "@smithy/config-resolver": "^4.3.0", + "@smithy/core": "^3.14.0", + "@smithy/fetch-http-handler": "^5.3.0", + "@smithy/hash-node": "^4.2.0", + "@smithy/invalid-dependency": "^4.2.0", + "@smithy/middleware-content-length": "^4.2.0", + "@smithy/middleware-endpoint": "^4.3.0", + "@smithy/middleware-retry": "^4.4.0", + "@smithy/middleware-serde": "^4.2.0", + "@smithy/middleware-stack": "^4.2.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/node-http-handler": "^4.3.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/url-parser": "^4.2.0", + "@smithy/util-base64": "^4.2.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.0", + "@smithy/util-defaults-mode-browser": "^4.2.0", + "@smithy/util-defaults-mode-node": "^4.2.0", + "@smithy/util-endpoints": "^3.2.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-retry": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -330,25 +330,23 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.890.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.890.0.tgz", - "integrity": "sha512-CT+yjhytHdyKvV3Nh/fqBjnZ8+UiQZVz4NMm4LrPATgVSOdfygXHqrWxrPTVgiBtuJWkotg06DF7+pTd5ekLBw==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.901.0.tgz", + "integrity": "sha512-brKAc3y64tdhyuEf+OPIUln86bRTqkLgb9xkd6kUdIeA5+qmp/N6amItQz+RN4k4O3kqkCPYnAd3LonTKluobw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@aws-sdk/xml-builder": "3.887.0", - "@smithy/core": "^3.11.0", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/property-provider": "^4.1.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/signature-v4": "^5.2.1", - "@smithy/smithy-client": "^4.6.2", - "@smithy/types": "^4.5.0", - "@smithy/util-base64": "^4.1.0", - "@smithy/util-body-length-browser": "^4.1.0", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-utf8": "^4.1.0", - "fast-xml-parser": "5.2.5", + "@aws-sdk/types": "3.901.0", + "@aws-sdk/xml-builder": "3.901.0", + "@smithy/core": "^3.14.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/signature-v4": "^5.3.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/util-base64": "^4.2.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -356,15 +354,15 @@ } }, "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.890.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.890.0.tgz", - "integrity": "sha512-BtsUa2y0Rs8phmB2ScZ5RuPqZVmxJJXjGfeiXctmLFTxTwoayIK1DdNzOWx6SRMPVc3s2RBGN4vO7T1TwN+ajA==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.901.0.tgz", + "integrity": "sha512-5hAdVl3tBuARh3zX5MLJ1P/d+Kr5kXtDU3xm1pxUEF4xt2XkEEpwiX5fbkNkz2rbh3BCt2gOHsAbh6b3M7n+DA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.1.1", - "@smithy/types": "^4.5.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -372,20 +370,20 @@ } }, "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.890.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.890.0.tgz", - "integrity": "sha512-0sru3LVwsuGYyzbD90EC/d5HnCZ9PL4O9BA2LYT6b9XceC005Oj86uzE47LXb+mDhTAt3T6ZO0+ZcVQe0DDi8w==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.901.0.tgz", + "integrity": "sha512-Ggr7+0M6QZEsrqRkK7iyJLf4LkIAacAxHz9c4dm9hnDdU7vqrlJm6g73IxMJXWN1bIV7IxfpzB11DsRrB/oNjQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@smithy/fetch-http-handler": "^5.2.1", - "@smithy/node-http-handler": "^4.2.1", - "@smithy/property-provider": "^4.1.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.2", - "@smithy/types": "^4.5.0", - "@smithy/util-stream": "^4.3.1", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/fetch-http-handler": "^5.3.0", + "@smithy/node-http-handler": "^4.3.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/util-stream": "^4.4.0", "tslib": "^2.6.2" }, "engines": { @@ -393,23 +391,23 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.891.0.tgz", - "integrity": "sha512-9LOfm97oy2d2frwCQjl53XLkoEYG6/rsNM3Y6n8UtRU3bzGAEjixdIuv3b6Z/Mk/QLeikcQEJ9FMC02DuQh2Yw==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.901.0.tgz", + "integrity": "sha512-zxadcDS0hNJgv8n4hFYJNOXyfjaNE1vvqIiF/JzZSQpSSYXzCd+WxXef5bQh+W3giDtRUmkvP5JLbamEFjZKyw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/credential-provider-env": "3.890.0", - "@aws-sdk/credential-provider-http": "3.890.0", - "@aws-sdk/credential-provider-process": "3.890.0", - "@aws-sdk/credential-provider-sso": "3.891.0", - "@aws-sdk/credential-provider-web-identity": "3.891.0", - "@aws-sdk/nested-clients": "3.891.0", - "@aws-sdk/types": "3.887.0", - "@smithy/credential-provider-imds": "^4.1.2", - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/credential-provider-env": "3.901.0", + "@aws-sdk/credential-provider-http": "3.901.0", + "@aws-sdk/credential-provider-process": "3.901.0", + "@aws-sdk/credential-provider-sso": "3.901.0", + "@aws-sdk/credential-provider-web-identity": "3.901.0", + "@aws-sdk/nested-clients": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/credential-provider-imds": "^4.2.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -417,22 +415,22 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.891.0.tgz", - "integrity": "sha512-IjGvQJhpCN512xlT1DFGaPeE1q0YEm/X62w7wHsRpBindW//M+heSulJzP4KPkoJvmJNVu1NxN26/p4uH+M8TQ==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.901.0.tgz", + "integrity": "sha512-dPuFzMF7L1s/lQyT3wDxqLe82PyTH+5o1jdfseTEln64LJMl0ZMWaKX/C1UFNDxaTd35Cgt1bDbjjAWHMiKSFQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.890.0", - "@aws-sdk/credential-provider-http": "3.890.0", - "@aws-sdk/credential-provider-ini": "3.891.0", - "@aws-sdk/credential-provider-process": "3.890.0", - "@aws-sdk/credential-provider-sso": "3.891.0", - "@aws-sdk/credential-provider-web-identity": "3.891.0", - "@aws-sdk/types": "3.887.0", - "@smithy/credential-provider-imds": "^4.1.2", - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/credential-provider-env": "3.901.0", + "@aws-sdk/credential-provider-http": "3.901.0", + "@aws-sdk/credential-provider-ini": "3.901.0", + "@aws-sdk/credential-provider-process": "3.901.0", + "@aws-sdk/credential-provider-sso": "3.901.0", + "@aws-sdk/credential-provider-web-identity": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/credential-provider-imds": "^4.2.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -440,16 +438,16 @@ } }, "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.890.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.890.0.tgz", - "integrity": "sha512-dWZ54TI1Q+UerF5YOqGiCzY+x2YfHsSQvkyM3T4QDNTJpb/zjiVv327VbSOULOlI7gHKWY/G3tMz0D9nWI7YbA==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.901.0.tgz", + "integrity": "sha512-/IWgmgM3Cl1wTdJA5HqKMAojxLkYchh5kDuphApxKhupLu6Pu0JBOHU8A5GGeFvOycyaVwosod6zDduINZxe+A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -457,18 +455,18 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.891.0.tgz", - "integrity": "sha512-RtF9BwUIZqc/7sFbK6n6qhe0tNaWJQwin89nSeZ1HOsA0Z7TfTOelX8Otd0L5wfeVBMVcgiN3ofqrcZgjFjQjA==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.901.0.tgz", + "integrity": "sha512-SjmqZQHmqFSET7+6xcZgtH7yEyh5q53LN87GqwYlJZ6KJ5oNw11acUNEhUOL1xTSJEvaWqwTIkS2zqrzLcM9bw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.891.0", - "@aws-sdk/core": "3.890.0", - "@aws-sdk/token-providers": "3.891.0", - "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/client-sso": "3.901.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/token-providers": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -476,17 +474,17 @@ } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.891.0.tgz", - "integrity": "sha512-yq7kzm1sHZ0GZrtS+qpjMUp4ES66UoT1+H2xxrOuAZkvUnkpQq1iSjOgBgJJ9FW1EsDUEmlgn94i4hJTNvm7fg==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.901.0.tgz", + "integrity": "sha512-NYjy/6NLxH9m01+pfpB4ql8QgAorJcu8tw69kzHwUd/ql6wUDTbC7HcXqtKlIwWjzjgj2BKL7j6SyFapgCuafA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/nested-clients": "3.891.0", - "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/nested-clients": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -494,14 +492,14 @@ } }, "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.891.0.tgz", - "integrity": "sha512-OYaxbqNDeo/noE7MfYWWQDu86cF/R/bMXdZ2QZwpWpX2yjy8xMwxSg7c/4tEK/OtiDZTKRXXrvPxRxG2+1bnJw==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.901.0.tgz", + "integrity": "sha512-yWX7GvRmqBtbNnUW7qbre3GvZmyYwU0WHefpZzDTYDoNgatuYq6LgUIQ+z5C04/kCRoFkAFrHag8a3BXqFzq5A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", + "@aws-sdk/types": "3.901.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -509,13 +507,13 @@ } }, "node_modules/@aws-sdk/middleware-logger": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.891.0.tgz", - "integrity": "sha512-azL4mg1H1FLpOAECiFtU+r+9VDhpeF6Vh9pzD4m51BWPJ60CVnyHayeI/0gqPsL60+5l90/b9VWonoA8DvAvpg==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.901.0.tgz", + "integrity": "sha512-UoHebjE7el/tfRo8/CQTj91oNUm+5Heus5/a4ECdmWaSCHCS/hXTsU3PTTHAY67oAQR8wBLFPfp3mMvXjB+L2A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/types": "3.901.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -523,15 +521,15 @@ } }, "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.891.0.tgz", - "integrity": "sha512-n++KwAEnNlvx5NZdIQZnvl2GjSH/YE3xGSqW2GmPB5780tFY5lOYSb1uA+EUzJSVX4oAKAkSPdR2AOW09kzoew==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.901.0.tgz", + "integrity": "sha512-Wd2t8qa/4OL0v/oDpCHHYkgsXJr8/ttCxrvCKAt0H1zZe2LlRhY9gpDVKqdertfHrHDj786fOvEQA28G1L75Dg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", + "@aws-sdk/types": "3.901.0", "@aws/lambda-invoke-store": "^0.0.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -539,16 +537,16 @@ } }, "node_modules/@aws-sdk/middleware-sdk-sqs": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.891.0.tgz", - "integrity": "sha512-+FkFslhvJqIzw+nVtToGuOcbdzclkTiOj6Z61mnq1ZyH8r5OOW9EkLHNgIacn6ehdoIeCvOCJiLpQbttNn51Lw==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.901.0.tgz", + "integrity": "sha512-0mdVLxT8RpxFUC8W5ygkyZkG2HoeqHQKGdvJlxXFVCDtAsGjY1qapS4OnDjrPDWUHWjNZa+chqFczzRmLe9UKw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@smithy/smithy-client": "^4.6.2", - "@smithy/types": "^4.5.0", - "@smithy/util-hex-encoding": "^4.1.0", - "@smithy/util-utf8": "^4.1.0", + "@aws-sdk/types": "3.901.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -556,17 +554,17 @@ } }, "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.891.0.tgz", - "integrity": "sha512-xyxIZtR7FunCWymPAxEm61VUq9lruXxWIYU5AIh5rt0av7nXa2ayAAlscQ7ch9jUlw+lbC2PVbw0K/OYrMovuA==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.901.0.tgz", + "integrity": "sha512-Zby4F03fvD9xAgXGPywyk4bC1jCbnyubMEYChLYohD+x20ULQCf+AimF/Btn7YL+hBpzh1+RmqmvZcx+RgwgNQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.891.0", - "@smithy/core": "^3.11.0", - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@aws-sdk/util-endpoints": "3.901.0", + "@smithy/core": "^3.14.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -574,48 +572,48 @@ } }, "node_modules/@aws-sdk/nested-clients": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.891.0.tgz", - "integrity": "sha512-cpol+Yk4T3GXPXbRfUyN2u6tpMEHUxAiesZgrfMm11QGHV+pmzyejJV/QZ0pdJKj5sXKaCr4DCntoJ5iBx++Cw==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.901.0.tgz", + "integrity": "sha512-feAAAMsVwctk2Tms40ONybvpfJPLCmSdI+G+OTrNpizkGLNl6ik2Ng2RzxY6UqOfN8abqKP/DOUj1qYDRDG8ag==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.890.0", - "@aws-sdk/middleware-host-header": "3.891.0", - "@aws-sdk/middleware-logger": "3.891.0", - "@aws-sdk/middleware-recursion-detection": "3.891.0", - "@aws-sdk/middleware-user-agent": "3.891.0", - "@aws-sdk/region-config-resolver": "3.890.0", - "@aws-sdk/types": "3.887.0", - "@aws-sdk/util-endpoints": "3.891.0", - "@aws-sdk/util-user-agent-browser": "3.887.0", - "@aws-sdk/util-user-agent-node": "3.891.0", - "@smithy/config-resolver": "^4.2.2", - "@smithy/core": "^3.11.0", - "@smithy/fetch-http-handler": "^5.2.1", - "@smithy/hash-node": "^4.1.1", - "@smithy/invalid-dependency": "^4.1.1", - "@smithy/middleware-content-length": "^4.1.1", - "@smithy/middleware-endpoint": "^4.2.2", - "@smithy/middleware-retry": "^4.2.3", - "@smithy/middleware-serde": "^4.1.1", - "@smithy/middleware-stack": "^4.1.1", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/node-http-handler": "^4.2.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/smithy-client": "^4.6.2", - "@smithy/types": "^4.5.0", - "@smithy/url-parser": "^4.1.1", - "@smithy/util-base64": "^4.1.0", - "@smithy/util-body-length-browser": "^4.1.0", - "@smithy/util-body-length-node": "^4.1.0", - "@smithy/util-defaults-mode-browser": "^4.1.2", - "@smithy/util-defaults-mode-node": "^4.1.2", - "@smithy/util-endpoints": "^3.1.2", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.2", - "@smithy/util-utf8": "^4.1.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/middleware-host-header": "3.901.0", + "@aws-sdk/middleware-logger": "3.901.0", + "@aws-sdk/middleware-recursion-detection": "3.901.0", + "@aws-sdk/middleware-user-agent": "3.901.0", + "@aws-sdk/region-config-resolver": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@aws-sdk/util-endpoints": "3.901.0", + "@aws-sdk/util-user-agent-browser": "3.901.0", + "@aws-sdk/util-user-agent-node": "3.901.0", + "@smithy/config-resolver": "^4.3.0", + "@smithy/core": "^3.14.0", + "@smithy/fetch-http-handler": "^5.3.0", + "@smithy/hash-node": "^4.2.0", + "@smithy/invalid-dependency": "^4.2.0", + "@smithy/middleware-content-length": "^4.2.0", + "@smithy/middleware-endpoint": "^4.3.0", + "@smithy/middleware-retry": "^4.4.0", + "@smithy/middleware-serde": "^4.2.0", + "@smithy/middleware-stack": "^4.2.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/node-http-handler": "^4.3.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/url-parser": "^4.2.0", + "@smithy/util-base64": "^4.2.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.0", + "@smithy/util-defaults-mode-browser": "^4.2.0", + "@smithy/util-defaults-mode-node": "^4.2.0", + "@smithy/util-endpoints": "^3.2.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-retry": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -623,16 +621,16 @@ } }, "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.890.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.890.0.tgz", - "integrity": "sha512-VfdT+tkF9groRYNzKvQCsCGDbOQdeBdzyB1d6hWiq22u13UafMIoskJ1ec0i0H1X29oT6mjTitfnvPq1UiKwzQ==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.901.0.tgz", + "integrity": "sha512-7F0N888qVLHo4CSQOsnkZ4QAp8uHLKJ4v3u09Ly5k4AEStrSlFpckTPyUx6elwGL+fxGjNE2aakK8vEgzzCV0A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/types": "^4.5.0", - "@smithy/util-config-provider": "^4.1.0", - "@smithy/util-middleware": "^4.1.1", + "@aws-sdk/types": "3.901.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/types": "^4.6.0", + "@smithy/util-config-provider": "^4.2.0", + "@smithy/util-middleware": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -640,17 +638,17 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.891.0.tgz", - "integrity": "sha512-n31JDMWhj/53QX33C97+1W63JGtgO8pg1/Tfmv4f9TR2VSGf1rFwYH7cPZ7dVIMmcUBeI2VCVhwUIabGNHw86Q==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.901.0.tgz", + "integrity": "sha512-pJEr1Ggbc/uVTDqp9IbNu9hdr0eQf3yZix3s4Nnyvmg4xmJSGAlbPC9LrNr5u3CDZoc8Z9CuLrvbP4MwYquNpQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.890.0", - "@aws-sdk/nested-clients": "3.891.0", - "@aws-sdk/types": "3.887.0", - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/core": "3.901.0", + "@aws-sdk/nested-clients": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -658,12 +656,12 @@ } }, "node_modules/@aws-sdk/types": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.887.0.tgz", - "integrity": "sha512-fmTEJpUhsPsovQ12vZSpVTEP/IaRoJAMBGQXlQNjtCpkBp6Iq3KQDa/HDaPINE+3xxo6XvTdtibsNOd5zJLV9A==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.901.0.tgz", + "integrity": "sha512-FfEM25hLEs4LoXsLXQ/q6X6L4JmKkKkbVFpKD4mwfVHtRVQG6QxJiCPcrkcPISquiy6esbwK2eh64TWbiD60cg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -671,15 +669,15 @@ } }, "node_modules/@aws-sdk/util-endpoints": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.891.0.tgz", - "integrity": "sha512-MgxvmHIQJbUK+YquX4bdjDw1MjdBqTRJGHs6iU2KM8nN1ut0bPwvavkq7NrY/wB3ZKKECqmv6J/nw+hYKKUIHA==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.901.0.tgz", + "integrity": "sha512-5nZP3hGA8FHEtKvEQf4Aww5QZOkjLW1Z+NixSd+0XKfHvA39Ah5sZboScjLx0C9kti/K3OGW1RCx5K9Zc3bZqg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@smithy/types": "^4.5.0", - "@smithy/url-parser": "^4.1.1", - "@smithy/util-endpoints": "^3.1.2", + "@aws-sdk/types": "3.901.0", + "@smithy/types": "^4.6.0", + "@smithy/url-parser": "^4.2.0", + "@smithy/util-endpoints": "^3.2.0", "tslib": "^2.6.2" }, "engines": { @@ -687,9 +685,9 @@ } }, "node_modules/@aws-sdk/util-locate-window": { - "version": "3.873.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.873.0.tgz", - "integrity": "sha512-xcVhZF6svjM5Rj89T1WzkjQmrTF6dpR2UvIHPMTnSZoNe6CixejPZ6f0JJ2kAhO8H+dUHwNBlsUgOTIKiK/Syg==", + "version": "3.893.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", + "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -699,27 +697,27 @@ } }, "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.887.0.tgz", - "integrity": "sha512-X71UmVsYc6ZTH4KU6hA5urOzYowSXc3qvroagJNLJYU1ilgZ529lP4J9XOYfEvTXkLR1hPFSRxa43SrwgelMjA==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.901.0.tgz", + "integrity": "sha512-Ntb6V/WFI21Ed4PDgL/8NSfoZQQf9xzrwNgiwvnxgAl/KvAvRBgQtqj5gHsDX8Nj2YmJuVoHfH9BGjL9VQ4WNg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.887.0", - "@smithy/types": "^4.5.0", + "@aws-sdk/types": "3.901.0", + "@smithy/types": "^4.6.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.891.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.891.0.tgz", - "integrity": "sha512-/mmvVL2PJE2NMTWj9JSY98OISx7yov0mi72eOViWCHQMRYJCN12DY54i1rc4Q/oPwJwTwIrx69MLjVhQ1OZsgw==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.901.0.tgz", + "integrity": "sha512-l59KQP5TY7vPVUfEURc7P5BJKuNg1RSsAKBQW7LHLECXjLqDUbo2SMLrexLBEoArSt6E8QOrIN0C8z/0Xk0jYw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/middleware-user-agent": "3.891.0", - "@aws-sdk/types": "3.887.0", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/types": "^4.5.0", + "@aws-sdk/middleware-user-agent": "3.901.0", + "@aws-sdk/types": "3.901.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -735,12 +733,13 @@ } }, "node_modules/@aws-sdk/xml-builder": { - "version": "3.887.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.887.0.tgz", - "integrity": "sha512-lMwgWK1kNgUhHGfBvO/5uLe7TKhycwOn3eRCqsKPT9aPCx/HWuTlpcQp8oW2pCRGLS7qzcxqpQulcD+bbUL7XQ==", + "version": "3.901.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.901.0.tgz", + "integrity": "sha512-pxFCkuAP7Q94wMTNPAwi6hEtNrp/BdFf+HOrIEeFQsk4EoOmpKY3I6S+u6A9Wg295J80Kh74LqDWM22ux3z6Aw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", + "fast-xml-parser": "5.2.5", "tslib": "^2.6.2" }, "engines": { @@ -800,20 +799,51 @@ "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/@cacheable/node-cache": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@cacheable/node-cache/-/node-cache-1.7.0.tgz", - "integrity": "sha512-B8hZe8tWh2wAA2W65NEDY6L7ksbg/7mm0dkI6NmHqd0LugILh64T3CakNOHpc9MiAc8SZl1qaFQGDx099dcjww==", + "node_modules/@cacheable/memoize": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cacheable/memoize/-/memoize-2.0.3.tgz", + "integrity": "sha512-hl9wfQgpiydhQEIv7fkjEzTGE+tcosCXLKFDO707wYJ/78FVOlowb36djex5GdbSyeHnG62pomYLMuV/OT8Pbw==", "license": "MIT", "dependencies": { - "cacheable": "^1.10.4", - "hookified": "^1.11.0", - "keyv": "^5.5.0" + "@cacheable/utils": "^2.0.3" + } + }, + "node_modules/@cacheable/memory": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.0.3.tgz", + "integrity": "sha512-R3UKy/CKOyb1LZG/VRCTMcpiMDyLH7SH3JrraRdK6kf3GweWCOU3sgvE13W3TiDRbxnDKylzKJvhUAvWl9LQOA==", + "license": "MIT", + "dependencies": { + "@cacheable/memoize": "^2.0.3", + "@cacheable/utils": "^2.0.3", + "@keyv/bigmap": "^1.0.2", + "hookified": "^1.12.1", + "keyv": "^5.5.3" + } + }, + "node_modules/@cacheable/node-cache": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@cacheable/node-cache/-/node-cache-1.7.3.tgz", + "integrity": "sha512-Ch68eMFL//1m8BXOJgTDT/o47vVZHJM/hlaNqyLiGU2gjp1WGGnNDrwXjWmts3SRst1d1dzlPfa9iVdUKkSc7A==", + "license": "MIT", + "dependencies": { + "cacheable": "^2.0.3", + "hookified": "^1.12.0", + "keyv": "^5.5.3" }, "engines": { "node": ">=18" } }, + "node_modules/@cacheable/utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.1.0.tgz", + "integrity": "sha512-ZdxfOiaarMqMj+H7qwlt5EBKWaeGihSYVHdQv5lUsbn8MJJOTW82OIwirQ39U5tMZkNvy3bQE+ryzC+xTAb9/g==", + "license": "MIT", + "dependencies": { + "keyv": "^5.5.3" + } + }, "node_modules/@commitlint/cli": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.8.1.tgz", @@ -836,90 +866,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/cli/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@commitlint/cli/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/cli/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/cli/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@commitlint/cli/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@commitlint/cli/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/@commitlint/config-conventional": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-19.8.1.tgz", @@ -948,30 +894,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/config-validator/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/@commitlint/config-validator/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, "node_modules/@commitlint/ensure": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-19.8.1.tgz", @@ -1014,19 +936,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/format/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/@commitlint/is-ignored": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-19.8.1.tgz", @@ -1079,19 +988,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/load/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/@commitlint/message": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-19.8.1.tgz", @@ -1152,16 +1048,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/resolve-extends/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@commitlint/rules": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-19.8.1.tgz", @@ -1201,95 +1087,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/top-level/node_modules/find-up": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", - "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^7.2.0", - "path-exists": "^5.0.0", - "unicorn-magic": "^0.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@commitlint/top-level/node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^6.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@commitlint/top-level/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@commitlint/top-level/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@commitlint/top-level/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/@commitlint/top-level/node_modules/yocto-queue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", - "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@commitlint/types": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-19.8.1.tgz", @@ -1304,19 +1101,6 @@ "node": ">=v18" } }, - "node_modules/@commitlint/types/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/@emnapi/runtime": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", @@ -1328,9 +1112,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", - "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz", + "integrity": "sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw==", "cpu": [ "ppc64" ], @@ -1344,9 +1128,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz", - "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.10.tgz", + "integrity": "sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w==", "cpu": [ "arm" ], @@ -1360,9 +1144,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", - "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.10.tgz", + "integrity": "sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg==", "cpu": [ "arm64" ], @@ -1376,9 +1160,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz", - "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.10.tgz", + "integrity": "sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg==", "cpu": [ "x64" ], @@ -1392,9 +1176,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", - "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.10.tgz", + "integrity": "sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA==", "cpu": [ "arm64" ], @@ -1408,9 +1192,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", - "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.10.tgz", + "integrity": "sha512-tguWg1olF6DGqzws97pKZ8G2L7Ig1vjDmGTwcTuYHbuU6TTjJe5FXbgs5C1BBzHbJ2bo1m3WkQDbWO2PvamRcg==", "cpu": [ "x64" ], @@ -1424,9 +1208,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", - "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.10.tgz", + "integrity": "sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg==", "cpu": [ "arm64" ], @@ -1440,9 +1224,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", - "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.10.tgz", + "integrity": "sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA==", "cpu": [ "x64" ], @@ -1456,9 +1240,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", - "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.10.tgz", + "integrity": "sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg==", "cpu": [ "arm" ], @@ -1472,9 +1256,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", - "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.10.tgz", + "integrity": "sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ==", "cpu": [ "arm64" ], @@ -1488,9 +1272,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", - "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.10.tgz", + "integrity": "sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ==", "cpu": [ "ia32" ], @@ -1504,9 +1288,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", - "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.10.tgz", + "integrity": "sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg==", "cpu": [ "loong64" ], @@ -1520,9 +1304,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", - "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.10.tgz", + "integrity": "sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA==", "cpu": [ "mips64el" ], @@ -1536,9 +1320,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", - "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.10.tgz", + "integrity": "sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA==", "cpu": [ "ppc64" ], @@ -1552,9 +1336,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", - "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.10.tgz", + "integrity": "sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA==", "cpu": [ "riscv64" ], @@ -1568,9 +1352,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", - "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.10.tgz", + "integrity": "sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew==", "cpu": [ "s390x" ], @@ -1584,9 +1368,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", - "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.10.tgz", + "integrity": "sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA==", "cpu": [ "x64" ], @@ -1600,9 +1384,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", - "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.10.tgz", + "integrity": "sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==", "cpu": [ "arm64" ], @@ -1616,9 +1400,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", - "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.10.tgz", + "integrity": "sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig==", "cpu": [ "x64" ], @@ -1632,9 +1416,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", - "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.10.tgz", + "integrity": "sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw==", "cpu": [ "arm64" ], @@ -1648,9 +1432,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", - "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.10.tgz", + "integrity": "sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw==", "cpu": [ "x64" ], @@ -1664,9 +1448,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", - "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.10.tgz", + "integrity": "sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==", "cpu": [ "arm64" ], @@ -1680,9 +1464,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", - "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.10.tgz", + "integrity": "sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ==", "cpu": [ "x64" ], @@ -1696,9 +1480,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", - "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.10.tgz", + "integrity": "sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw==", "cpu": [ "arm64" ], @@ -1712,9 +1496,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", - "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.10.tgz", + "integrity": "sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw==", "cpu": [ "ia32" ], @@ -1728,9 +1512,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", - "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.10.tgz", + "integrity": "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw==", "cpu": [ "x64" ], @@ -1802,6 +1586,23 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -1813,6 +1614,23 @@ "concat-map": "0.0.1" } }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2058,10 +1876,19 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.3.tgz", - "integrity": "sha512-ryFMfvxxpQRsgZJqBd4wsttYQbCxsJksrv9Lw/v798JcQ8+w84mBWuXwl+TT0WJ/WrYOLaYpwQXi3sA9nTIaIg==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.4.tgz", + "integrity": "sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==", "cpu": [ "arm64" ], @@ -2077,13 +1904,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.2.0" + "@img/sharp-libvips-darwin-arm64": "1.2.3" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.3.tgz", - "integrity": "sha512-yHpJYynROAj12TA6qil58hmPmAwxKKC7reUqtGLzsOHfP7/rniNGTL8tjWX6L3CTV4+5P4ypcS7Pp+7OB+8ihA==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.4.tgz", + "integrity": "sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==", "cpu": [ "x64" ], @@ -2099,13 +1926,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.2.0" + "@img/sharp-libvips-darwin-x64": "1.2.3" } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.0.tgz", - "integrity": "sha512-sBZmpwmxqwlqG9ueWFXtockhsxefaV6O84BMOrhtg/YqbTaRdqDE7hxraVE3y6gVM4eExmfzW4a8el9ArLeEiQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.3.tgz", + "integrity": "sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==", "cpu": [ "arm64" ], @@ -2119,9 +1946,9 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.0.tgz", - "integrity": "sha512-M64XVuL94OgiNHa5/m2YvEQI5q2cl9d/wk0qFTDVXcYzi43lxuiFTftMR1tOnFQovVXNZJ5TURSDK2pNe9Yzqg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.3.tgz", + "integrity": "sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==", "cpu": [ "x64" ], @@ -2135,9 +1962,9 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.0.tgz", - "integrity": "sha512-mWd2uWvDtL/nvIzThLq3fr2nnGfyr/XMXlq8ZJ9WMR6PXijHlC3ksp0IpuhK6bougvQrchUAfzRLnbsen0Cqvw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.3.tgz", + "integrity": "sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==", "cpu": [ "arm" ], @@ -2151,9 +1978,9 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.0.tgz", - "integrity": "sha512-RXwd0CgG+uPRX5YYrkzKyalt2OJYRiJQ8ED/fi1tq9WQW2jsQIn0tqrlR5l5dr/rjqq6AHAxURhj2DVjyQWSOA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.3.tgz", + "integrity": "sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==", "cpu": [ "arm64" ], @@ -2167,9 +1994,9 @@ } }, "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.0.tgz", - "integrity": "sha512-Xod/7KaDDHkYu2phxxfeEPXfVXFKx70EAFZ0qyUdOjCcxbjqyJOEUpDe6RIyaunGxT34Anf9ue/wuWOqBW2WcQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.3.tgz", + "integrity": "sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==", "cpu": [ "ppc64" ], @@ -2183,9 +2010,9 @@ } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.0.tgz", - "integrity": "sha512-eMKfzDxLGT8mnmPJTNMcjfO33fLiTDsrMlUVcp6b96ETbnJmd4uvZxVJSKPQfS+odwfVaGifhsB07J1LynFehw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.3.tgz", + "integrity": "sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==", "cpu": [ "s390x" ], @@ -2199,9 +2026,9 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.0.tgz", - "integrity": "sha512-ZW3FPWIc7K1sH9E3nxIGB3y3dZkpJlMnkk7z5tu1nSkBoCgw2nSRTFHI5pB/3CQaJM0pdzMF3paf9ckKMSE9Tg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.3.tgz", + "integrity": "sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==", "cpu": [ "x64" ], @@ -2215,9 +2042,9 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.0.tgz", - "integrity": "sha512-UG+LqQJbf5VJ8NWJ5Z3tdIe/HXjuIdo4JeVNADXBFuG7z9zjoegpzzGIyV5zQKi4zaJjnAd2+g2nna8TZvuW9Q==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.3.tgz", + "integrity": "sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==", "cpu": [ "arm64" ], @@ -2231,9 +2058,9 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.0.tgz", - "integrity": "sha512-SRYOLR7CXPgNze8akZwjoGBoN1ThNZoqpOgfnOxmWsklTGVfJiGJoC/Lod7aNMGA1jSsKWM1+HRX43OP6p9+6Q==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.3.tgz", + "integrity": "sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==", "cpu": [ "x64" ], @@ -2247,9 +2074,9 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.3.tgz", - "integrity": "sha512-oBK9l+h6KBN0i3dC8rYntLiVfW8D8wH+NPNT3O/WBHeW0OQWCjfWksLUaPidsrDKpJgXp3G3/hkmhptAW0I3+A==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.4.tgz", + "integrity": "sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==", "cpu": [ "arm" ], @@ -2265,13 +2092,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.2.0" + "@img/sharp-libvips-linux-arm": "1.2.3" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.3.tgz", - "integrity": "sha512-QdrKe3EvQrqwkDrtuTIjI0bu6YEJHTgEeqdzI3uWJOH6G1O8Nl1iEeVYRGdj1h5I21CqxSvQp1Yv7xeU3ZewbA==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.4.tgz", + "integrity": "sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==", "cpu": [ "arm64" ], @@ -2287,13 +2114,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.2.0" + "@img/sharp-libvips-linux-arm64": "1.2.3" } }, "node_modules/@img/sharp-linux-ppc64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.3.tgz", - "integrity": "sha512-GLtbLQMCNC5nxuImPR2+RgrviwKwVql28FWZIW1zWruy6zLgA5/x2ZXk3mxj58X/tszVF69KK0Is83V8YgWhLA==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.4.tgz", + "integrity": "sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==", "cpu": [ "ppc64" ], @@ -2309,13 +2136,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.2.0" + "@img/sharp-libvips-linux-ppc64": "1.2.3" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.3.tgz", - "integrity": "sha512-3gahT+A6c4cdc2edhsLHmIOXMb17ltffJlxR0aC2VPZfwKoTGZec6u5GrFgdR7ciJSsHT27BD3TIuGcuRT0KmQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.4.tgz", + "integrity": "sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==", "cpu": [ "s390x" ], @@ -2331,13 +2158,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.2.0" + "@img/sharp-libvips-linux-s390x": "1.2.3" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.3.tgz", - "integrity": "sha512-8kYso8d806ypnSq3/Ly0QEw90V5ZoHh10yH0HnrzOCr6DKAPI6QVHvwleqMkVQ0m+fc7EH8ah0BB0QPuWY6zJQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.4.tgz", + "integrity": "sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==", "cpu": [ "x64" ], @@ -2353,13 +2180,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.2.0" + "@img/sharp-libvips-linux-x64": "1.2.3" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.3.tgz", - "integrity": "sha512-vAjbHDlr4izEiXM1OTggpCcPg9tn4YriK5vAjowJsHwdBIdx0fYRsURkxLG2RLm9gyBq66gwtWI8Gx0/ov+JKQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.4.tgz", + "integrity": "sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==", "cpu": [ "arm64" ], @@ -2375,13 +2202,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.2.0" + "@img/sharp-libvips-linuxmusl-arm64": "1.2.3" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.3.tgz", - "integrity": "sha512-gCWUn9547K5bwvOn9l5XGAEjVTTRji4aPTqLzGXHvIr6bIDZKNTA34seMPgM0WmSf+RYBH411VavCejp3PkOeQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.4.tgz", + "integrity": "sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==", "cpu": [ "x64" ], @@ -2397,20 +2224,20 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.2.0" + "@img/sharp-libvips-linuxmusl-x64": "1.2.3" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.3.tgz", - "integrity": "sha512-+CyRcpagHMGteySaWos8IbnXcHgfDn7pO2fiC2slJxvNq9gDipYBN42/RagzctVRKgxATmfqOSulgZv5e1RdMg==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.4.tgz", + "integrity": "sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==", "cpu": [ "wasm32" ], "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.4.4" + "@emnapi/runtime": "^1.5.0" }, "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -2420,9 +2247,9 @@ } }, "node_modules/@img/sharp-win32-arm64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.3.tgz", - "integrity": "sha512-MjnHPnbqMXNC2UgeLJtX4XqoVHHlZNd+nPt1kRPmj63wURegwBhZlApELdtxM2OIZDRv/DFtLcNhVbd1z8GYXQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.4.tgz", + "integrity": "sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==", "cpu": [ "arm64" ], @@ -2439,9 +2266,9 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.3.tgz", - "integrity": "sha512-xuCdhH44WxuXgOM714hn4amodJMZl3OEvf0GVTm0BEyMeA2to+8HEdRPShH0SLYptJY1uBw+SCFP9WVQi1Q/cw==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.4.tgz", + "integrity": "sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==", "cpu": [ "ia32" ], @@ -2458,9 +2285,9 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.3.tgz", - "integrity": "sha512-OWwz05d++TxzLEv4VnsTz5CmZ6mI6S05sfQGEMrNrQcOEERbX46332IvE7pO/EUiw7jUrrS40z/M7kPyjfl04g==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.4.tgz", + "integrity": "sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==", "cpu": [ "x64" ], @@ -2505,18 +2332,6 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -3031,6 +2846,18 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@keyv/bigmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.0.2.tgz", + "integrity": "sha512-KR03xkEZlAZNF4IxXgVXb+uNIVNvwdh8UwI0cnc7WI6a+aQcDp8GL80qVfeB4E5NpsKJzou5jU0r6yLSSbMOtA==", + "license": "MIT", + "dependencies": { + "hookified": "^1.12.1" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/@keyv/serialize": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", @@ -3519,9 +3346,9 @@ } }, "node_modules/@opentelemetry/redis-common": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.0.tgz", - "integrity": "sha512-4Wc0AWURII2cfXVVoZ6vDqK+s5n4K5IssdrlVrvGsx6OEOKdghKtJZqXAHWFiZv4nTDLH2/2fldjIHY8clMOjQ==", + "version": "0.38.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.2.tgz", + "integrity": "sha512-1BCcU93iwSRZvDAgwUxC/DV4T/406SkMfxGqu5ojc3AvNI+I9GhV7v0J1HljsczuuhcnFLYqD5VmwVXfCGHzxA==", "license": "Apache-2.0", "engines": { "node": "^18.19.0 || >=20.6.0" @@ -3570,9 +3397,9 @@ } }, "node_modules/@opentelemetry/sql-common": { - "version": "0.41.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.0.tgz", - "integrity": "sha512-pmzXctVbEERbqSfiAgdes9Y63xjoOyXcD7B6IXBkVb+vbM7M9U98mn33nGXxPf4dfYR0M+vhcKRZmbSJ7HfqFA==", + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.2.tgz", + "integrity": "sha512-4mhWm3Z8z+i508zQJ7r6Xi7y4mmoJpdvH0fZPFRkWrdp5fq7hhZ2HhYokEOLkfqSMgPR4Z9EyB3DBkbKGOqZiQ==", "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "^2.0.0" @@ -3617,9 +3444,9 @@ } }, "node_modules/@prisma/client": { - "version": "6.16.2", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.2.tgz", - "integrity": "sha512-E00PxBcalMfYO/TWnXobBVUai6eW/g5OsifWQsQDzJYm7yaY+IRLo7ZLsaefi0QkTpxfuhFcQ/w180i6kX3iJw==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.3.tgz", + "integrity": "sha512-JfNfAtXG+/lIopsvoZlZiH2k5yNx87mcTS4t9/S5oufM1nKdXYxOvpDC1XoTCFBa5cQh7uXnbMPsmZrwZY80xw==", "hasInstallScript": true, "license": "Apache-2.0", "engines": { @@ -3639,9 +3466,9 @@ } }, "node_modules/@prisma/config": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.16.1.tgz", - "integrity": "sha512-sz3uxRPNL62QrJ0EYiujCFkIGZ3hg+9hgC1Ae1HjoYuj0BxCqHua4JNijYvYCrh9LlofZDZcRBX3tHBfLvAngA==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.16.3.tgz", + "integrity": "sha512-VlsLnG4oOuKGGMToEeVaRhoTBZu5H3q51jTQXb/diRags3WV0+BQK5MolJTtP6G7COlzoXmWeS11rNBtvg+qFQ==", "license": "Apache-2.0", "dependencies": { "c12": "3.1.0", @@ -3651,48 +3478,48 @@ } }, "node_modules/@prisma/debug": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.16.1.tgz", - "integrity": "sha512-RWv/VisW5vJE4cDRTuAHeVedtGoItXTnhuLHsSlJ9202QKz60uiXWywBlVcqXVq8bFeIZoCoWH+R1duZJPwqLw==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.16.3.tgz", + "integrity": "sha512-89DdqWtdKd7qoc9/qJCKLTazj3W3zPEiz0hc7HfZdpjzm21c7orOUB5oHWJsG+4KbV4cWU5pefq3CuDVYF9vgA==", "license": "Apache-2.0" }, "node_modules/@prisma/engines": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.16.1.tgz", - "integrity": "sha512-EOnEM5HlosPudBqbI+jipmaW/vQEaF0bKBo4gVkGabasINHR6RpC6h44fKZEqx4GD8CvH+einD2+b49DQrwrAg==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.16.3.tgz", + "integrity": "sha512-b+Rl4nzQDcoqe6RIpSHv8f5lLnwdDGvXhHjGDiokObguAAv/O1KaX1Oc69mBW/GFWKQpCkOraobLjU6s1h8HGg==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.16.1", - "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", - "@prisma/fetch-engine": "6.16.1", - "@prisma/get-platform": "6.16.1" + "@prisma/debug": "6.16.3", + "@prisma/engines-version": "6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "@prisma/fetch-engine": "6.16.3", + "@prisma/get-platform": "6.16.3" } }, "node_modules/@prisma/engines-version": { - "version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43.tgz", - "integrity": "sha512-ThvlDaKIVrnrv97ujNFDYiQbeMQpLa0O86HFA2mNoip4mtFqM7U5GSz2ie1i2xByZtvPztJlNRgPsXGeM/kqAA==", + "version": "6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a.tgz", + "integrity": "sha512-fftRmosBex48Ph1v2ll1FrPpirwtPZpNkE5CDCY1Lw2SD2ctyrLlVlHiuxDAAlALwWBOkPbAll4+EaqdGuMhJw==", "license": "Apache-2.0" }, "node_modules/@prisma/fetch-engine": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.16.1.tgz", - "integrity": "sha512-fl/PKQ8da5YTayw86WD3O9OmKJEM43gD3vANy2hS5S1CnfW2oPXk+Q03+gUWqcKK306QqhjjIHRFuTZ31WaosQ==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.16.3.tgz", + "integrity": "sha512-bUoRIkVaI+CCaVGrSfcKev0/Mk4ateubqWqGZvQ9uCqFv2ENwWIR3OeNuGin96nZn5+SkebcD7RGgKr/+mJelw==", "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.16.1", - "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43", - "@prisma/get-platform": "6.16.1" + "@prisma/debug": "6.16.3", + "@prisma/engines-version": "6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "@prisma/get-platform": "6.16.3" } }, "node_modules/@prisma/get-platform": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.16.1.tgz", - "integrity": "sha512-kUfg4vagBG7dnaGRcGd1c0ytQFcDj2SUABiuveIpL3bthFdTLI6PJeLEia6Q8Dgh+WhPdo0N2q0Fzjk63XTyaA==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.16.3.tgz", + "integrity": "sha512-X1LxiFXinJ4iQehrodGp0f66Dv6cDL0GbRlcCoLtSu6f4Wi+hgo7eND/afIs5029GQLgNWKZ46vn8hjyXTsHLA==", "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.16.1" + "@prisma/debug": "6.16.3" } }, "node_modules/@prisma/instrumentation": { @@ -3863,9 +3690,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.2.tgz", - "integrity": "sha512-uLN8NAiFVIRKX9ZQha8wy6UUs06UNSZ32xj6giK/rmMXAgKahwExvK6SsmgU5/brh4w/nSgj8e0k3c1HBQpa0A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.4.tgz", + "integrity": "sha512-BTm2qKNnWIQ5auf4deoetINJm2JzvihvGb9R6K/ETwKLql/Bb3Eg2H1FBp1gUb4YGbydMA3jcmQTR73q7J+GAA==", "cpu": [ "arm" ], @@ -3876,9 +3703,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.2.tgz", - "integrity": "sha512-oEouqQk2/zxxj22PNcGSskya+3kV0ZKH+nQxuCCOGJ4oTXBdNTbv+f/E3c74cNLeMO1S5wVWacSws10TTSB77g==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.4.tgz", + "integrity": "sha512-P9LDQiC5vpgGFgz7GSM6dKPCiqR3XYN1WwJKA4/BUVDjHpYsf3iBEmVz62uyq20NGYbiGPR5cNHI7T1HqxNs2w==", "cpu": [ "arm64" ], @@ -3889,9 +3716,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.2.tgz", - "integrity": "sha512-OZuTVTpj3CDSIxmPgGH8en/XtirV5nfljHZ3wrNwvgkT5DQLhIKAeuFSiwtbMto6oVexV0k1F1zqURPKf5rI1Q==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.4.tgz", + "integrity": "sha512-QRWSW+bVccAvZF6cbNZBJwAehmvG9NwfWHwMy4GbWi/BQIA/laTIktebT2ipVjNncqE6GLPxOok5hsECgAxGZg==", "cpu": [ "arm64" ], @@ -3902,9 +3729,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.2.tgz", - "integrity": "sha512-Wa/Wn8RFkIkr1vy1k1PB//VYhLnlnn5eaJkfTQKivirOvzu5uVd2It01ukeQstMursuz7S1bU+8WW+1UPXpa8A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.4.tgz", + "integrity": "sha512-hZgP05pResAkRJxL1b+7yxCnXPGsXU0fG9Yfd6dUaoGk+FhdPKCJ5L1Sumyxn8kvw8Qi5PvQ8ulenUbRjzeCTw==", "cpu": [ "x64" ], @@ -3915,9 +3742,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.2.tgz", - "integrity": "sha512-QkzxvH3kYN9J1w7D1A+yIMdI1pPekD+pWx7G5rXgnIlQ1TVYVC6hLl7SOV9pi5q9uIDF9AuIGkuzcbF7+fAhow==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.4.tgz", + "integrity": "sha512-xmc30VshuBNUd58Xk4TKAEcRZHaXlV+tCxIXELiE9sQuK3kG8ZFgSPi57UBJt8/ogfhAF5Oz4ZSUBN77weM+mQ==", "cpu": [ "arm64" ], @@ -3928,9 +3755,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.2.tgz", - "integrity": "sha512-dkYXB0c2XAS3a3jmyDkX4Jk0m7gWLFzq1C3qUnJJ38AyxIF5G/dyS4N9B30nvFseCfgtCEdbYFhk0ChoCGxPog==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.4.tgz", + "integrity": "sha512-WdSLpZFjOEqNZGmHflxyifolwAiZmDQzuOzIq9L27ButpCVpD7KzTRtEG1I0wMPFyiyUdOO+4t8GvrnBLQSwpw==", "cpu": [ "x64" ], @@ -3941,9 +3768,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.2.tgz", - "integrity": "sha512-9VlPY/BN3AgbukfVHAB8zNFWB/lKEuvzRo1NKev0Po8sYFKx0i+AQlCYftgEjcL43F2h9Ui1ZSdVBc4En/sP2w==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.4.tgz", + "integrity": "sha512-xRiOu9Of1FZ4SxVbB0iEDXc4ddIcjCv2aj03dmW8UrZIW7aIQ9jVJdLBIhxBI+MaTnGAKyvMwPwQnoOEvP7FgQ==", "cpu": [ "arm" ], @@ -3954,9 +3781,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.2.tgz", - "integrity": "sha512-+GdKWOvsifaYNlIVf07QYan1J5F141+vGm5/Y8b9uCZnG/nxoGqgCmR24mv0koIWWuqvFYnbURRqw1lv7IBINw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.4.tgz", + "integrity": "sha512-FbhM2p9TJAmEIEhIgzR4soUcsW49e9veAQCziwbR+XWB2zqJ12b4i/+hel9yLiD8pLncDH4fKIPIbt5238341Q==", "cpu": [ "arm" ], @@ -3967,9 +3794,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.2.tgz", - "integrity": "sha512-df0Eou14ojtUdLQdPFnymEQteENwSJAdLf5KCDrmZNsy1c3YaCNaJvYsEUHnrg+/DLBH612/R0xd3dD03uz2dg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.4.tgz", + "integrity": "sha512-4n4gVwhPHR9q/g8lKCyz0yuaD0MvDf7dV4f9tHt0C73Mp8h38UCtSCSE6R9iBlTbXlmA8CjpsZoujhszefqueg==", "cpu": [ "arm64" ], @@ -3980,9 +3807,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.2.tgz", - "integrity": "sha512-iPeouV0UIDtz8j1YFR4OJ/zf7evjauqv7jQ/EFs0ClIyL+by++hiaDAfFipjOgyz6y6xbDvJuiU4HwpVMpRFDQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.4.tgz", + "integrity": "sha512-u0n17nGA0nvi/11gcZKsjkLj1QIpAuPFQbR48Subo7SmZJnGxDpspyw2kbpuoQnyK+9pwf3pAoEXerJs/8Mi9g==", "cpu": [ "arm64" ], @@ -3993,9 +3820,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.50.2.tgz", - "integrity": "sha512-OL6KaNvBopLlj5fTa5D5bau4W82f+1TyTZRr2BdnfsrnQnmdxh4okMxR2DcDkJuh4KeoQZVuvHvzuD/lyLn2Kw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.4.tgz", + "integrity": "sha512-0G2c2lpYtbTuXo8KEJkDkClE/+/2AFPdPAbmaHoE870foRFs4pBrDehilMcrSScrN/fB/1HTaWO4bqw+ewBzMQ==", "cpu": [ "loong64" ], @@ -4006,9 +3833,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.2.tgz", - "integrity": "sha512-I21VJl1w6z/K5OTRl6aS9DDsqezEZ/yKpbqlvfHbW0CEF5IL8ATBMuUx6/mp683rKTK8thjs/0BaNrZLXetLag==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.4.tgz", + "integrity": "sha512-teSACug1GyZHmPDv14VNbvZFX779UqWTsd7KtTM9JIZRDI5NUwYSIS30kzI8m06gOPB//jtpqlhmraQ68b5X2g==", "cpu": [ "ppc64" ], @@ -4019,9 +3846,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.2.tgz", - "integrity": "sha512-Hq6aQJT/qFFHrYMjS20nV+9SKrXL2lvFBENZoKfoTH2kKDOJqff5OSJr4x72ZaG/uUn+XmBnGhfr4lwMRrmqCQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.4.tgz", + "integrity": "sha512-/MOEW3aHjjs1p4Pw1Xk4+3egRevx8Ji9N6HUIA1Ifh8Q+cg9dremvFCUbOX2Zebz80BwJIgCBUemjqhU5XI5Eg==", "cpu": [ "riscv64" ], @@ -4032,9 +3859,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.2.tgz", - "integrity": "sha512-82rBSEXRv5qtKyr0xZ/YMF531oj2AIpLZkeNYxmKNN6I2sVE9PGegN99tYDLK2fYHJITL1P2Lgb4ZXnv0PjQvw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.4.tgz", + "integrity": "sha512-1HHmsRyh845QDpEWzOFtMCph5Ts+9+yllCrREuBR/vg2RogAQGGBRC8lDPrPOMnrdOJ+mt1WLMOC2Kao/UwcvA==", "cpu": [ "riscv64" ], @@ -4045,9 +3872,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.2.tgz", - "integrity": "sha512-4Q3S3Hy7pC6uaRo9gtXUTJ+EKo9AKs3BXKc2jYypEcMQ49gDPFU2P1ariX9SEtBzE5egIX6fSUmbmGazwBVF9w==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.4.tgz", + "integrity": "sha512-seoeZp4L/6D1MUyjWkOMRU6/iLmCU2EjbMTyAG4oIOs1/I82Y5lTeaxW0KBfkUdHAWN7j25bpkt0rjnOgAcQcA==", "cpu": [ "s390x" ], @@ -4058,9 +3885,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.2.tgz", - "integrity": "sha512-9Jie/At6qk70dNIcopcL4p+1UirusEtznpNtcq/u/C5cC4HBX7qSGsYIcG6bdxj15EYWhHiu02YvmdPzylIZlA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.4.tgz", + "integrity": "sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==", "cpu": [ "x64" ], @@ -4071,9 +3898,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.2.tgz", - "integrity": "sha512-HPNJwxPL3EmhzeAnsWQCM3DcoqOz3/IC6de9rWfGR8ZCuEHETi9km66bH/wG3YH0V3nyzyFEGUZeL5PKyy4xvw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.4.tgz", + "integrity": "sha512-dtBZYjDmCQ9hW+WgEkaffvRRCKm767wWhxsFW3Lw86VXz/uJRuD438/XvbZT//B96Vs8oTA8Q4A0AfHbrxP9zw==", "cpu": [ "x64" ], @@ -4084,9 +3911,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.2.tgz", - "integrity": "sha512-nMKvq6FRHSzYfKLHZ+cChowlEkR2lj/V0jYj9JnGUVPL2/mIeFGmVM2mLaFeNa5Jev7W7TovXqXIG2d39y1KYA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.4.tgz", + "integrity": "sha512-1ox+GqgRWqaB1RnyZXL8PD6E5f7YyRUJYnCqKpNzxzP0TkaUh112NDrR9Tt+C8rJ4x5G9Mk8PQR3o7Ku2RKqKA==", "cpu": [ "arm64" ], @@ -4097,9 +3924,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.2.tgz", - "integrity": "sha512-eFUvvnTYEKeTyHEijQKz81bLrUQOXKZqECeiWH6tb8eXXbZk+CXSG2aFrig2BQ/pjiVRj36zysjgILkqarS2YA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.4.tgz", + "integrity": "sha512-8GKr640PdFNXwzIE0IrkMWUNUomILLkfeHjXBi/nUvFlpZP+FA8BKGKpacjW6OUUHaNI6sUURxR2U2g78FOHWQ==", "cpu": [ "arm64" ], @@ -4110,9 +3937,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.2.tgz", - "integrity": "sha512-cBaWmXqyfRhH8zmUxK3d3sAhEWLrtMjWBRwdMMHJIXSjvjLKvv49adxiEz+FJ8AP90apSDDBx2Tyd/WylV6ikA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.4.tgz", + "integrity": "sha512-AIy/jdJ7WtJ/F6EcfOb2GjR9UweO0n43jNObQMb6oGxkYTfLcnN7vYYpG+CN3lLxrQkzWnMOoNSHTW54pgbVxw==", "cpu": [ "ia32" ], @@ -4122,10 +3949,23 @@ "win32" ] }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.4.tgz", + "integrity": "sha512-UF9KfsH9yEam0UjTwAgdK0anlQ7c8/pWPU2yVjyWcF1I1thABt6WXE47cI71pGiZ8wGvxohBoLnxM04L/wj8mQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.2.tgz", - "integrity": "sha512-APwKy6YUhvZaEoHyM+9xqmTpviEI+9eL7LoCH+aLcvWYHJ663qG5zx7WzWZY+a9qkg5JtzcMyJ9z0WtQBMDmgA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.4.tgz", + "integrity": "sha512-bf9PtUa0u8IXDVxzRToFQKsNCRz9qLYfR/MpECxl4mRoWYjAeFjgxj1XdZr2M/GNVpT05p+LgQOHopYDlUu6/w==", "cpu": [ "x64" ], @@ -4150,18 +3990,18 @@ "license": "Apache-2.0" }, "node_modules/@sentry/core": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.12.0.tgz", - "integrity": "sha512-Jrf0Yo7DvmI/ZQcvBnA0xKNAFkJlVC/fMlvcin+5IrFNRcqOToZ2vtF+XqTgjRZymXQNE8s1QTD7IomPHk0TAw==", + "version": "10.17.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.17.0.tgz", + "integrity": "sha512-UVIvxSzS0n5QbIDPyFf0WX9I77Of1bcr6a0sCEKfjhJGmGQ8mFWoWgR2gF4wcPw60XUrzbryCr79eOsIHLQ5cw==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@sentry/node": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.12.0.tgz", - "integrity": "sha512-rnrNKJkG8rbm1NZaYAhTfLqGmZmiOjv9Y6apa1G9+hsfAqdK4SGFa/s22WG//qVnvqW4aDXR883Dvc0236op+g==", + "version": "10.17.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.17.0.tgz", + "integrity": "sha512-rM+ANC4NKkYHAFa73lqBXq024/YrflcUKBxkqSuo/0jc/Q/svLZfoZ8FW0IVZ4uhXXFZL3PZbkceZYmoOG9ePg==", "license": "MIT", "dependencies": { "@opentelemetry/api": "^1.9.0", @@ -4194,9 +4034,9 @@ "@opentelemetry/sdk-trace-base": "^2.1.0", "@opentelemetry/semantic-conventions": "^1.37.0", "@prisma/instrumentation": "6.15.0", - "@sentry/core": "10.12.0", - "@sentry/node-core": "10.12.0", - "@sentry/opentelemetry": "10.12.0", + "@sentry/core": "10.17.0", + "@sentry/node-core": "10.17.0", + "@sentry/opentelemetry": "10.17.0", "import-in-the-middle": "^1.14.2", "minimatch": "^9.0.0" }, @@ -4205,13 +4045,13 @@ } }, "node_modules/@sentry/node-core": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.12.0.tgz", - "integrity": "sha512-ki+pX4YyVVMhue1Qso0Kiz862ragDe1PgRc/AgtUJ0jc75s5PTvQw6N+9DAtSahL8t078+8rC7UzyGdLTPCl5w==", + "version": "10.17.0", + "resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.17.0.tgz", + "integrity": "sha512-x6av2pFtsAeN+nZKkhI07cOCugTKux908DCGBlwQEw8ZjghcO5jn3unfAlKZqxZ0ktWgBcSrCM/iJ5Gk2nxPFg==", "license": "MIT", "dependencies": { - "@sentry/core": "10.12.0", - "@sentry/opentelemetry": "10.12.0", + "@sentry/core": "10.17.0", + "@sentry/opentelemetry": "10.17.0", "import-in-the-middle": "^1.14.2" }, "engines": { @@ -4228,12 +4068,12 @@ } }, "node_modules/@sentry/opentelemetry": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.12.0.tgz", - "integrity": "sha512-bkUfLVpu0qTfCrQsz7uE/ch0kCJSV2KlFtguWPLMG2m0JOLDI+iivLm2nbp+Bg16FopZojKs5P8aevCSl+ilEw==", + "version": "10.17.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.17.0.tgz", + "integrity": "sha512-kZONokjkIQjhDUEZLsi7TZ1Bay0g4VFC2rT1MvZqa1fkFZff7Th9qQr0Lv7gt3nrbD6qIctEzmpf75OQN1cR8A==", "license": "MIT", "dependencies": { - "@sentry/core": "10.12.0" + "@sentry/core": "10.17.0" }, "engines": { "node": ">=18" @@ -4247,12 +4087,12 @@ } }, "node_modules/@smithy/abort-controller": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.1.1.tgz", - "integrity": "sha512-vkzula+IwRvPR6oKQhMYioM3A/oX/lFCZiwuxkQbRhqJS2S4YRY2k7k/SyR2jMf3607HLtbEwlRxi0ndXHMjRg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.0.tgz", + "integrity": "sha512-PLUYa+SUKOEZtXFURBu/CNxlsxfaFGxSBPcStL13KpVeVWIfdezWyDqkz7iDLmwnxojXD0s5KzuB5HGHvt4Aeg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4260,15 +4100,15 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.2.2.tgz", - "integrity": "sha512-IT6MatgBWagLybZl1xQcURXRICvqz1z3APSCAI9IqdvfCkrA7RaQIEfgC6G/KvfxnDfQUDqFV+ZlixcuFznGBQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.3.0.tgz", + "integrity": "sha512-9oH+n8AVNiLPK/iK/agOsoWfrKZ3FGP3502tkksd6SRsKMYiu7AFX0YXo6YBADdsAj7C+G/aLKdsafIJHxuCkQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.2.2", - "@smithy/types": "^4.5.0", - "@smithy/util-config-provider": "^4.1.0", - "@smithy/util-middleware": "^4.1.1", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/types": "^4.6.0", + "@smithy/util-config-provider": "^4.2.0", + "@smithy/util-middleware": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4276,56 +4116,36 @@ } }, "node_modules/@smithy/core": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.11.1.tgz", - "integrity": "sha512-REH7crwORgdjSpYs15JBiIWOYjj0hJNC3aCecpJvAlMMaaqL5i2CLb1i6Hc4yevToTKSqslLMI9FKjhugEwALA==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.14.0.tgz", + "integrity": "sha512-XJ4z5FxvY/t0Dibms/+gLJrI5niRoY0BCmE02fwmPcRYFPI4KI876xaE79YGWIKnEslMbuQPsIEsoU/DXa0DoA==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-serde": "^4.1.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", - "@smithy/util-base64": "^4.1.0", - "@smithy/util-body-length-browser": "^4.1.0", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-stream": "^4.3.2", - "@smithy/util-utf8": "^4.1.0", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@smithy/middleware-serde": "^4.2.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", + "@smithy/util-base64": "^4.2.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-stream": "^4.4.0", + "@smithy/util-utf8": "^4.2.0", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@types/uuid": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", - "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", - "license": "MIT" - }, - "node_modules/@smithy/core/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@smithy/credential-provider-imds": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.1.2.tgz", - "integrity": "sha512-JlYNq8TShnqCLg0h+afqe2wLAwZpuoSgOyzhYvTgbiKBWRov+uUve+vrZEQO6lkdLOWPh7gK5dtb9dS+KGendg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.0.tgz", + "integrity": "sha512-SOhFVvFH4D5HJZytb0bLKxCrSnwcqPiNlrw+S4ZXjMnsC+o9JcUQzbZOEQcA8yv9wJFNhfsUiIUKiEnYL68Big==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.2.2", - "@smithy/property-provider": "^4.1.1", - "@smithy/types": "^4.5.0", - "@smithy/url-parser": "^4.1.1", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/types": "^4.6.0", + "@smithy/url-parser": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4333,15 +4153,15 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.2.1.tgz", - "integrity": "sha512-5/3wxKNtV3wO/hk1is+CZUhL8a1yy/U+9u9LKQ9kZTkMsHaQjJhc3stFfiujtMnkITjzWfndGA2f7g9Uh9vKng==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.0.tgz", + "integrity": "sha512-BG3KSmsx9A//KyIfw+sqNmWFr1YBUr+TwpxFT7yPqAk0yyDh7oSNgzfNH7pS6OC099EGx2ltOULvumCFe8bcgw==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.2.1", - "@smithy/querystring-builder": "^4.1.1", - "@smithy/types": "^4.5.0", - "@smithy/util-base64": "^4.1.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/querystring-builder": "^4.2.0", + "@smithy/types": "^4.6.0", + "@smithy/util-base64": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4349,14 +4169,14 @@ } }, "node_modules/@smithy/hash-node": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.1.1.tgz", - "integrity": "sha512-H9DIU9WBLhYrvPs9v4sYvnZ1PiAI0oc8CgNQUJ1rpN3pP7QADbTOUjchI2FB764Ub0DstH5xbTqcMJu1pnVqxA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.0.tgz", + "integrity": "sha512-ugv93gOhZGysTctZh9qdgng8B+xO0cj+zN0qAZ+Sgh7qTQGPOJbMdIuyP89KNfUyfAqFSNh5tMvC+h2uCpmTtA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", - "@smithy/util-buffer-from": "^4.1.0", - "@smithy/util-utf8": "^4.1.0", + "@smithy/types": "^4.6.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4364,12 +4184,12 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.1.1.tgz", - "integrity": "sha512-1AqLyFlfrrDkyES8uhINRlJXmHA2FkG+3DY8X+rmLSqmFwk3DJnvhyGzyByPyewh2jbmV+TYQBEfngQax8IFGg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.0.tgz", + "integrity": "sha512-ZmK5X5fUPAbtvRcUPtk28aqIClVhbfcmfoS4M7UQBTnDdrNxhsrxYVv0ZEl5NaPSyExsPWqL4GsPlRvtlwg+2A==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4377,9 +4197,9 @@ } }, "node_modules/@smithy/is-array-buffer": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.1.0.tgz", - "integrity": "sha512-ePTYUOV54wMogio+he4pBybe8fwg4sDvEVDBU8ZlHOZXbXK3/C0XfJgUCu6qAZcawv05ZhZzODGUerFBPsPUDQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", + "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4389,13 +4209,13 @@ } }, "node_modules/@smithy/md5-js": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.1.1.tgz", - "integrity": "sha512-MvWXKK743BuHjr/hnWuT6uStdKEaoqxHAQUvbKJPPZM5ZojTNFI5D+47BoQfBE5RgGlRRty05EbWA+NXDv+hIA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.0.tgz", + "integrity": "sha512-LFEPniXGKRQArFmDQ3MgArXlClFJMsXDteuQQY8WG1/zzv6gVSo96+qpkuu1oJp4MZsKrwchY0cuAoPKzEbaNA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", - "@smithy/util-utf8": "^4.1.0", + "@smithy/types": "^4.6.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4403,13 +4223,13 @@ } }, "node_modules/@smithy/middleware-content-length": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.1.1.tgz", - "integrity": "sha512-9wlfBBgTsRvC2JxLJxv4xDGNBrZuio3AgSl0lSFX7fneW2cGskXTYpFxCdRYD2+5yzmsiTuaAJD1Wp7gWt9y9w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.0.tgz", + "integrity": "sha512-6ZAnwrXFecrA4kIDOcz6aLBhU5ih2is2NdcZtobBDSdSHtE9a+MThB5uqyK4XXesdOCvOcbCm2IGB95birTSOQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4417,18 +4237,18 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.2.3.tgz", - "integrity": "sha512-+1H5A28DeffRVrqmVmtqtRraEjoaC6JVap3xEQdVoBh2EagCVY7noPmcBcG4y7mnr9AJitR1ZAse2l+tEtK5vg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.3.0.tgz", + "integrity": "sha512-jFVjuQeV8TkxaRlcCNg0GFVgg98tscsmIrIwRFeC74TIUyLE3jmY9xgc1WXrPQYRjQNK3aRoaIk6fhFRGOIoGw==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.11.1", - "@smithy/middleware-serde": "^4.1.1", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", - "@smithy/url-parser": "^4.1.1", - "@smithy/util-middleware": "^4.1.1", + "@smithy/core": "^3.14.0", + "@smithy/middleware-serde": "^4.2.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", + "@smithy/url-parser": "^4.2.0", + "@smithy/util-middleware": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4436,53 +4256,33 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.2.4.tgz", - "integrity": "sha512-amyqYQFewnAviX3yy/rI/n1HqAgfvUdkEhc04kDjxsngAUREKuOI24iwqQUirrj6GtodWmR4iO5Zeyl3/3BwWg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.0.tgz", + "integrity": "sha512-yaVBR0vQnOnzex45zZ8ZrPzUnX73eUC8kVFaAAbn04+6V7lPtxn56vZEBBAhgS/eqD6Zm86o6sJs6FuQVoX5qg==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.2.2", - "@smithy/protocol-http": "^5.2.1", - "@smithy/service-error-classification": "^4.1.2", - "@smithy/smithy-client": "^4.6.3", - "@smithy/types": "^4.5.0", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-retry": "^4.1.2", - "@types/uuid": "^9.0.1", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@smithy/node-config-provider": "^4.3.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/service-error-classification": "^4.2.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-retry": "^4.2.0", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@smithy/middleware-retry/node_modules/@types/uuid": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", - "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", - "license": "MIT" - }, - "node_modules/@smithy/middleware-retry/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@smithy/middleware-serde": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.1.1.tgz", - "integrity": "sha512-lh48uQdbCoj619kRouev5XbWhCwRKLmphAif16c4J6JgJ4uXjub1PI6RL38d3BLliUvSso6klyB/LTNpWSNIyg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.0.tgz", + "integrity": "sha512-rpTQ7D65/EAbC6VydXlxjvbifTf4IH+sADKg6JmAvhkflJO2NvDeyU9qsWUNBelJiQFcXKejUHWRSdmpJmEmiw==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4490,12 +4290,12 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.1.1.tgz", - "integrity": "sha512-ygRnniqNcDhHzs6QAPIdia26M7e7z9gpkIMUe/pK0RsrQ7i5MblwxY8078/QCnGq6AmlUUWgljK2HlelsKIb/A==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.0.tgz", + "integrity": "sha512-G5CJ//eqRd9OARrQu9MK1H8fNm2sMtqFh6j8/rPozhEL+Dokpvi1Og+aCixTuwDAGZUkJPk6hJT5jchbk/WCyg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4503,14 +4303,14 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.2.2.tgz", - "integrity": "sha512-SYGTKyPvyCfEzIN5rD8q/bYaOPZprYUPD2f5g9M7OjaYupWOoQFYJ5ho+0wvxIRf471i2SR4GoiZ2r94Jq9h6A==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.0.tgz", + "integrity": "sha512-5QgHNuWdT9j9GwMPPJCKxy2KDxZ3E5l4M3/5TatSZrqYVoEiqQrDfAq8I6KWZw7RZOHtVtCzEPdYz7rHZixwcA==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.1.1", - "@smithy/shared-ini-file-loader": "^4.2.0", - "@smithy/types": "^4.5.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/shared-ini-file-loader": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4518,15 +4318,15 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.2.1.tgz", - "integrity": "sha512-REyybygHlxo3TJICPF89N2pMQSf+p+tBJqpVe1+77Cfi9HBPReNjTgtZ1Vg73exq24vkqJskKDpfF74reXjxfw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.3.0.tgz", + "integrity": "sha512-RHZ/uWCmSNZ8cneoWEVsVwMZBKy/8123hEpm57vgGXA3Irf/Ja4v9TVshHK2ML5/IqzAZn0WhINHOP9xl+Qy6Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.1.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/querystring-builder": "^4.1.1", - "@smithy/types": "^4.5.0", + "@smithy/abort-controller": "^4.2.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/querystring-builder": "^4.2.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4534,12 +4334,12 @@ } }, "node_modules/@smithy/property-provider": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.1.1.tgz", - "integrity": "sha512-gm3ZS7DHxUbzC2wr8MUCsAabyiXY0gaj3ROWnhSx/9sPMc6eYLMM4rX81w1zsMaObj2Lq3PZtNCC1J6lpEY7zg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.0.tgz", + "integrity": "sha512-rV6wFre0BU6n/tx2Ztn5LdvEdNZ2FasQbPQmDOPfV9QQyDmsCkOAB0osQjotRCQg+nSKFmINhyda0D3AnjSBJw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4547,12 +4347,12 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.2.1.tgz", - "integrity": "sha512-T8SlkLYCwfT/6m33SIU/JOVGNwoelkrvGjFKDSDtVvAXj/9gOT78JVJEas5a+ETjOu4SVvpCstKgd0PxSu/aHw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.0.tgz", + "integrity": "sha512-6POSYlmDnsLKb7r1D3SVm7RaYW6H1vcNcTWGWrF7s9+2noNYvUsm7E4tz5ZQ9HXPmKn6Hb67pBDRIjrT4w/d7Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4560,13 +4360,13 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.1.1.tgz", - "integrity": "sha512-J9b55bfimP4z/Jg1gNo+AT84hr90p716/nvxDkPGCD4W70MPms0h8KF50RDRgBGZeL83/u59DWNqJv6tEP/DHA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.0.tgz", + "integrity": "sha512-Q4oFD0ZmI8yJkiPPeGUITZj++4HHYCW3pYBYfIobUCkYpI6mbkzmG1MAQQ3lJYYWj3iNqfzOenUZu+jqdPQ16A==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", - "@smithy/util-uri-escape": "^4.1.0", + "@smithy/types": "^4.6.0", + "@smithy/util-uri-escape": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4574,12 +4374,12 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.1.1.tgz", - "integrity": "sha512-63TEp92YFz0oQ7Pj9IuI3IgnprP92LrZtRAkE3c6wLWJxfy/yOPRt39IOKerVr0JS770olzl0kGafXlAXZ1vng==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.0.tgz", + "integrity": "sha512-BjATSNNyvVbQxOOlKse0b0pSezTWGMvA87SvoFoFlkRsKXVsN3bEtjCxvsNXJXfnAzlWFPaT9DmhWy1vn0sNEA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4587,24 +4387,24 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.1.2.tgz", - "integrity": "sha512-Kqd8wyfmBWHZNppZSMfrQFpc3M9Y/kjyN8n8P4DqJJtuwgK1H914R471HTw7+RL+T7+kI1f1gOnL7Vb5z9+NgQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.0.tgz", + "integrity": "sha512-Ylv1ttUeKatpR0wEOMnHf1hXMktPUMObDClSWl2TpCVT4DwtJhCeighLzSLbgH3jr5pBNM0LDXT5yYxUvZ9WpA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0" + "@smithy/types": "^4.6.0" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.2.0.tgz", - "integrity": "sha512-OQTfmIEp2LLuWdxa8nEEPhZmiOREO6bcB6pjs0AySf4yiZhl6kMOfqmcwcY8BaBPX+0Tb+tG7/Ia/6mwpoZ7Pw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.3.0.tgz", + "integrity": "sha512-VCUPPtNs+rKWlqqntX0CbVvWyjhmX30JCtzO+s5dlzzxrvSfRh5SY0yxnkirvc1c80vdKQttahL71a9EsdolSQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4612,18 +4412,18 @@ } }, "node_modules/@smithy/signature-v4": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.2.1.tgz", - "integrity": "sha512-M9rZhWQLjlQVCCR37cSjHfhriGRN+FQ8UfgrYNufv66TJgk+acaggShl3KS5U/ssxivvZLlnj7QH2CUOKlxPyA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.0.tgz", + "integrity": "sha512-MKNyhXEs99xAZaFhm88h+3/V+tCRDQ+PrDzRqL0xdDpq4gjxcMmf5rBA3YXgqZqMZ/XwemZEurCBQMfxZOWq/g==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.1.0", - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", - "@smithy/util-hex-encoding": "^4.1.0", - "@smithy/util-middleware": "^4.1.1", - "@smithy/util-uri-escape": "^4.1.0", - "@smithy/util-utf8": "^4.1.0", + "@smithy/is-array-buffer": "^4.2.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-middleware": "^4.2.0", + "@smithy/util-uri-escape": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4631,17 +4431,17 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.6.3.tgz", - "integrity": "sha512-K27LqywsaqKz4jusdUQYJh/YP2VbnbdskZ42zG8xfV+eovbTtMc2/ZatLWCfSkW0PDsTUXlpvlaMyu8925HsOw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.7.0.tgz", + "integrity": "sha512-3BDx/aCCPf+kkinYf5QQhdQ9UAGihgOVqI3QO5xQfSaIWvUE4KYLtiGRWsNe1SR7ijXC0QEPqofVp5Sb0zC8xQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.11.1", - "@smithy/middleware-endpoint": "^4.2.3", - "@smithy/middleware-stack": "^4.1.1", - "@smithy/protocol-http": "^5.2.1", - "@smithy/types": "^4.5.0", - "@smithy/util-stream": "^4.3.2", + "@smithy/core": "^3.14.0", + "@smithy/middleware-endpoint": "^4.3.0", + "@smithy/middleware-stack": "^4.2.0", + "@smithy/protocol-http": "^5.3.0", + "@smithy/types": "^4.6.0", + "@smithy/util-stream": "^4.4.0", "tslib": "^2.6.2" }, "engines": { @@ -4649,9 +4449,9 @@ } }, "node_modules/@smithy/types": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.5.0.tgz", - "integrity": "sha512-RkUpIOsVlAwUIZXO1dsz8Zm+N72LClFfsNqf173catVlvRZiwPy0x2u0JLEA4byreOPKDZPGjmPDylMoP8ZJRg==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.6.0.tgz", + "integrity": "sha512-4lI9C8NzRPOv66FaY1LL1O/0v0aLVrq/mXP/keUa9mJOApEeae43LsLd2kZRUJw91gxOQfLIrV3OvqPgWz1YsA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4661,13 +4461,13 @@ } }, "node_modules/@smithy/url-parser": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.1.1.tgz", - "integrity": "sha512-bx32FUpkhcaKlEoOMbScvc93isaSiRM75pQ5IgIBaMkT7qMlIibpPRONyx/0CvrXHzJLpOn/u6YiDX2hcvs7Dg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.0.tgz", + "integrity": "sha512-AlBmD6Idav2ugmoAL6UtR6ItS7jU5h5RNqLMZC7QrLCoITA9NzIN3nx9GWi8g4z1pfWh2r9r96SX/jHiNwPJ9A==", "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^4.1.1", - "@smithy/types": "^4.5.0", + "@smithy/querystring-parser": "^4.2.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4675,13 +4475,13 @@ } }, "node_modules/@smithy/util-base64": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.1.0.tgz", - "integrity": "sha512-RUGd4wNb8GeW7xk+AY5ghGnIwM96V0l2uzvs/uVHf+tIuVX2WSvynk5CxNoBCsM2rQRSZElAo9rt3G5mJ/gktQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.2.0.tgz", + "integrity": "sha512-+erInz8WDv5KPe7xCsJCp+1WCjSbah9gWcmUXc9NqmhyPx59tf7jqFz+za1tRG1Y5KM1Cy1rWCcGypylFp4mvA==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.1.0", - "@smithy/util-utf8": "^4.1.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4689,9 +4489,9 @@ } }, "node_modules/@smithy/util-body-length-browser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.1.0.tgz", - "integrity": "sha512-V2E2Iez+bo6bUMOTENPr6eEmepdY8Hbs+Uc1vkDKgKNA/brTJqOW/ai3JO1BGj9GbCeLqw90pbbH7HFQyFotGQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", + "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4701,9 +4501,9 @@ } }, "node_modules/@smithy/util-body-length-node": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.1.0.tgz", - "integrity": "sha512-BOI5dYjheZdgR9XiEM3HJcEMCXSoqbzu7CzIgYrx0UtmvtC3tC2iDGpJLsSRFffUpy8ymsg2ARMP5fR8mtuUQQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.0.tgz", + "integrity": "sha512-U8q1WsSZFjXijlD7a4wsDQOvOwV+72iHSfq1q7VD+V75xP/pdtm0WIGuaFJ3gcADDOKj2MIBn4+zisi140HEnQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4713,12 +4513,12 @@ } }, "node_modules/@smithy/util-buffer-from": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.1.0.tgz", - "integrity": "sha512-N6yXcjfe/E+xKEccWEKzK6M+crMrlwaCepKja0pNnlSkm6SjAeLKKA++er5Ba0I17gvKfN/ThV+ZOx/CntKTVw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", + "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.1.0", + "@smithy/is-array-buffer": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4726,9 +4526,9 @@ } }, "node_modules/@smithy/util-config-provider": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.1.0.tgz", - "integrity": "sha512-swXz2vMjrP1ZusZWVTB/ai5gK+J8U0BWvP10v9fpcFvg+Xi/87LHvHfst2IgCs1i0v4qFZfGwCmeD/KNCdJZbQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", + "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4738,14 +4538,14 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.1.3.tgz", - "integrity": "sha512-5fm3i2laE95uhY6n6O6uGFxI5SVbqo3/RWEuS3YsT0LVmSZk+0eUqPhKd4qk0KxBRPaT5VNT/WEBUqdMyYoRgg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.2.0.tgz", + "integrity": "sha512-qzHp7ZDk1Ba4LDwQVCNp90xPGqSu7kmL7y5toBpccuhi3AH7dcVBIT/pUxYcInK4jOy6FikrcTGq5wxcka8UaQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.1.1", - "@smithy/smithy-client": "^4.6.3", - "@smithy/types": "^4.5.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, @@ -4754,17 +4554,17 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.1.3.tgz", - "integrity": "sha512-lwnMzlMslZ9GJNt+/wVjz6+fe9Wp5tqR1xAyQn+iywmP+Ymj0F6NhU/KfHM5jhGPQchRSCcau5weKhFdLIM4cA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.0.tgz", + "integrity": "sha512-FxUHS3WXgx3bTWR6yQHNHHkQHZm/XKIi/CchTnKvBulN6obWpcbzJ6lDToXn+Wp0QlVKd7uYAz2/CTw1j7m+Kg==", "license": "Apache-2.0", "dependencies": { - "@smithy/config-resolver": "^4.2.2", - "@smithy/credential-provider-imds": "^4.1.2", - "@smithy/node-config-provider": "^4.2.2", - "@smithy/property-provider": "^4.1.1", - "@smithy/smithy-client": "^4.6.3", - "@smithy/types": "^4.5.0", + "@smithy/config-resolver": "^4.3.0", + "@smithy/credential-provider-imds": "^4.2.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/property-provider": "^4.2.0", + "@smithy/smithy-client": "^4.7.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4772,13 +4572,13 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.1.2.tgz", - "integrity": "sha512-+AJsaaEGb5ySvf1SKMRrPZdYHRYSzMkCoK16jWnIMpREAnflVspMIDeCVSZJuj+5muZfgGpNpijE3mUNtjv01Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.0.tgz", + "integrity": "sha512-TXeCn22D56vvWr/5xPqALc9oO+LN+QpFjrSM7peG/ckqEPoI3zaKZFp+bFwfmiHhn5MGWPaLCqDOJPPIixk9Wg==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.2.2", - "@smithy/types": "^4.5.0", + "@smithy/node-config-provider": "^4.3.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4786,9 +4586,9 @@ } }, "node_modules/@smithy/util-hex-encoding": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.1.0.tgz", - "integrity": "sha512-1LcueNN5GYC4tr8mo14yVYbh/Ur8jHhWOxniZXii+1+ePiIbsLZ5fEI0QQGtbRRP5mOhmooos+rLmVASGGoq5w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", + "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4798,12 +4598,12 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.1.1.tgz", - "integrity": "sha512-CGmZ72mL29VMfESz7S6dekqzCh8ZISj3B+w0g1hZFXaOjGTVaSqfAEFAq8EGp8fUL+Q2l8aqNmt8U1tglTikeg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.0.tgz", + "integrity": "sha512-u9OOfDa43MjagtJZ8AapJcmimP+K2Z7szXn8xbty4aza+7P1wjFmy2ewjSbhEiYQoW1unTlOAIV165weYAaowA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.5.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4811,13 +4611,13 @@ } }, "node_modules/@smithy/util-retry": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.1.2.tgz", - "integrity": "sha512-NCgr1d0/EdeP6U5PSZ9Uv5SMR5XRRYoVr1kRVtKZxWL3tixEL3UatrPIMFZSKwHlCcp2zPLDvMubVDULRqeunA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.0.tgz", + "integrity": "sha512-BWSiuGbwRnEE2SFfaAZEX0TqaxtvtSYPM/J73PFVm+A29Fg1HTPiYFb8TmX1DXp4hgcdyJcNQmprfd5foeORsg==", "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^4.1.2", - "@smithy/types": "^4.5.0", + "@smithy/service-error-classification": "^4.2.0", + "@smithy/types": "^4.6.0", "tslib": "^2.6.2" }, "engines": { @@ -4825,18 +4625,18 @@ } }, "node_modules/@smithy/util-stream": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.3.2.tgz", - "integrity": "sha512-Ka+FA2UCC/Q1dEqUanCdpqwxOFdf5Dg2VXtPtB1qxLcSGh5C1HdzklIt18xL504Wiy9nNUKwDMRTVCbKGoK69g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.4.0.tgz", + "integrity": "sha512-vtO7ktbixEcrVzMRmpQDnw/Ehr9UWjBvSJ9fyAbadKkC4w5Cm/4lMO8cHz8Ysb8uflvQUNRcuux/oNHKPXkffg==", "license": "Apache-2.0", "dependencies": { - "@smithy/fetch-http-handler": "^5.2.1", - "@smithy/node-http-handler": "^4.2.1", - "@smithy/types": "^4.5.0", - "@smithy/util-base64": "^4.1.0", - "@smithy/util-buffer-from": "^4.1.0", - "@smithy/util-hex-encoding": "^4.1.0", - "@smithy/util-utf8": "^4.1.0", + "@smithy/fetch-http-handler": "^5.3.0", + "@smithy/node-http-handler": "^4.3.0", + "@smithy/types": "^4.6.0", + "@smithy/util-base64": "^4.2.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4844,9 +4644,9 @@ } }, "node_modules/@smithy/util-uri-escape": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.1.0.tgz", - "integrity": "sha512-b0EFQkq35K5NHUYxU72JuoheM6+pytEVUGlTwiFxWFpmddA+Bpz3LgsPRIpBk8lnPE47yT7AF2Egc3jVnKLuPg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", + "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -4856,12 +4656,24 @@ } }, "node_modules/@smithy/util-utf8": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.1.0.tgz", - "integrity": "sha512-mEu1/UIXAdNYuBcyEPbjScKi/+MQVXNIuY/7Cm5XLIWe319kDrT5SizBE95jqtmEXoDbGoZxKLCMttdZdqTZKQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", + "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/uuid": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", + "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.1.0", "tslib": "^2.6.2" }, "engines": { @@ -5051,9 +4863,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", - "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.7.tgz", + "integrity": "sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg==", "dev": true, "license": "MIT", "dependencies": { @@ -5118,12 +4930,12 @@ } }, "node_modules/@types/node": { - "version": "24.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", - "integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.7.0.tgz", + "integrity": "sha512-IbKooQVqUBrlzWTi79E8Fw78l8k1RNtlDDNWsFZs7XonuQSJ8oNYfEeclhprUldXISRMLzBpILuKgPlIxm+/Yw==", "license": "MIT", "dependencies": { - "undici-types": "~7.12.0" + "undici-types": "~7.14.0" } }, "node_modules/@types/node-cron": { @@ -5195,6 +5007,35 @@ "license": "MIT" }, "node_modules/@types/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.0.tgz", + "integrity": "sha512-zBF6vZJn1IaMpg3xUF25VK3gd3l8zwE0ZLRX7dsQyQi+jp4E8mMDJNGDYnYse+bQhYwWERTxVwHpi3dMOq7RKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.9.tgz", + "integrity": "sha512-dOTIuqpWLyl3BBXU3maNQsS4A3zuuoYRNIvYSxxhebPfXg2mzWQEPne/nlJ37yOse6uGgR386uTpdsx4D0QZWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/serve-static/node_modules/@types/send": { "version": "0.17.5", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", @@ -5205,25 +5046,6 @@ "@types/node": "*" } }, - "node_modules/@types/send/node_modules/@types/mime": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/serve-static": { - "version": "1.15.8", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", - "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/http-errors": "*", - "@types/node": "*", - "@types/send": "*" - } - }, "node_modules/@types/shimmer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", @@ -5252,17 +5074,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.44.0.tgz", - "integrity": "sha512-EGDAOGX+uwwekcS0iyxVDmRV9HX6FLSM5kzrAToLTsr9OWCIKG/y3lQheCq18yZ5Xh78rRKJiEpP0ZaCs4ryOQ==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.0.tgz", + "integrity": "sha512-hA8gxBq4ukonVXPy0OKhiaUh/68D0E88GSmtC1iAEnGaieuDi38LhS7jdCHRLi6ErJBNDGCzvh5EnzdPwUc0DA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/type-utils": "8.44.0", - "@typescript-eslint/utils": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/type-utils": "8.46.0", + "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -5276,32 +5098,22 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.44.0", + "@typescript-eslint/parser": "^8.46.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, "node_modules/@typescript-eslint/parser": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.44.0.tgz", - "integrity": "sha512-VGMpFQGUQWYT9LfnPcX8ouFojyrZ/2w3K5BucvxL/spdNehccKhB4jUyB1yBCXpr2XFm0jkECxgrpXBW2ipoAw==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.0.tgz", + "integrity": "sha512-n1H6IcDhmmUEG7TNVSspGmiHHutt7iVKtZwRppD7e04wha5MrkV1h3pti9xQLcCMt6YWsncpoT0HMjkH1FNwWQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4" }, "engines": { @@ -5317,14 +5129,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.44.0.tgz", - "integrity": "sha512-ZeaGNraRsq10GuEohKTo4295Z/SuGcSq2LzfGlqiuEvfArzo/VRrT0ZaJsVPuKZ55lVbNk8U6FcL+ZMH8CoyVA==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.0.tgz", + "integrity": "sha512-OEhec0mH+U5Je2NZOeK1AbVCdm0ChyapAyTeXVIYTPXDJ3F07+cu87PPXcGoYqZ7M9YJVvFnfpGg1UmCIqM+QQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.44.0", - "@typescript-eslint/types": "^8.44.0", + "@typescript-eslint/tsconfig-utils": "^8.46.0", + "@typescript-eslint/types": "^8.46.0", "debug": "^4.3.4" }, "engines": { @@ -5339,14 +5151,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.44.0.tgz", - "integrity": "sha512-87Jv3E+al8wpD+rIdVJm/ItDBe/Im09zXIjFoipOjr5gHUhJmTzfFLuTJ/nPTMc2Srsroy4IBXwcTCHyRR7KzA==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.0.tgz", + "integrity": "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0" + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5357,9 +5169,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.44.0.tgz", - "integrity": "sha512-x5Y0+AuEPqAInc6yd0n5DAcvtoQ/vyaGwuX5HE9n6qAefk1GaedqrLQF8kQGylLUb9pnZyLf+iEiL9fr8APDtQ==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.0.tgz", + "integrity": "sha512-WrYXKGAHY836/N7zoK/kzi6p8tXFhasHh8ocFL9VZSAkvH956gfeRfcnhs3xzRy8qQ/dq3q44v1jvQieMFg2cw==", "dev": true, "license": "MIT", "engines": { @@ -5374,15 +5186,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.44.0.tgz", - "integrity": "sha512-9cwsoSxJ8Sak67Be/hD2RNt/fsqmWnNE1iHohG8lxqLSNY8xNfyY7wloo5zpW3Nu9hxVgURevqfcH6vvKCt6yg==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.0.tgz", + "integrity": "sha512-hy+lvYV1lZpVs2jRaEYvgCblZxUoJiPyCemwbQZ+NGulWkQRy0HRPYAoef/CNSzaLt+MLvMptZsHXHlkEilaeg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/utils": "8.46.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -5399,9 +5211,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.44.0.tgz", - "integrity": "sha512-ZSl2efn44VsYM0MfDQe68RKzBz75NPgLQXuGypmym6QVOWL5kegTZuZ02xRAT9T+onqvM6T8CdQk0OwYMB6ZvA==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.0.tgz", + "integrity": "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA==", "dev": true, "license": "MIT", "engines": { @@ -5413,16 +5225,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.44.0.tgz", - "integrity": "sha512-lqNj6SgnGcQZwL4/SBJ3xdPEfcBuhCG8zdcwCPgYcmiPLgokiNDKlbPzCwEwu7m279J/lBYWtDYL+87OEfn8Jw==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.0.tgz", + "integrity": "sha512-ekDCUfVpAKWJbRfm8T1YRrCot1KFxZn21oV76v5Fj4tr7ELyk84OS+ouvYdcDAwZL89WpEkEj2DKQ+qg//+ucg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.44.0", - "@typescript-eslint/tsconfig-utils": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/project-service": "8.46.0", + "@typescript-eslint/tsconfig-utils": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -5442,16 +5254,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.44.0.tgz", - "integrity": "sha512-nktOlVcg3ALo0mYlV+L7sWUD58KG4CMj1rb2HUVOO4aL3K/6wcD+NERqd0rrA5Vg06b42YhF6cFxeixsp9Riqg==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.0.tgz", + "integrity": "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0" + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5466,13 +5278,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.44.0.tgz", - "integrity": "sha512-zaz9u8EJ4GBmnehlrpoKvj/E3dNbuQ7q0ucyZImm3cLqJ8INTc970B1qEqDX/Rzq65r3TvVTN7kHWPBoyW7DWw==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.0.tgz", + "integrity": "sha512-FrvMpAK+hTbFy7vH5j1+tMYHMSKLE6RzluFJlkFNKD0p9YsUT75JlBSmr5so3QRzvMwU5/bIEdeNrxm8du8l3Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/types": "8.46.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -5648,16 +5460,16 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -5678,16 +5490,29 @@ } }, "node_modules/ansi-escapes": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.0.tgz", - "integrity": "sha512-YdhtCd19sKRKfAAUsrcC1wzm4JuzJoiX4pOJqIoW2qmKj5WzG/dL8uUJ0361zaXtHqK7gEhOwtAtz7t3Yq3X5g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "license": "MIT", "dependencies": { - "environment": "^1.0.0" + "type-fest": "^0.21.3" }, "engines": { - "node": ">=18" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5703,15 +5528,12 @@ } }, "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -6093,31 +5915,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bl/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/block-stream2": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.1.0.tgz", @@ -6213,9 +6010,10 @@ "license": "MIT" }, "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, "funding": [ { "type": "github", @@ -6233,7 +6031,7 @@ "license": "MIT", "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "ieee754": "^1.1.13" } }, "node_modules/buffer-crc32": { @@ -6336,13 +6134,17 @@ } }, "node_modules/cacheable": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-1.10.4.tgz", - "integrity": "sha512-Gd7ccIUkZ9TE2odLQVS+PDjIvQCdJKUlLdJRVvZu0aipj07Qfx+XIej7hhDrKGGoIxV5m5fT/kOJNJPQhQneRg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.1.0.tgz", + "integrity": "sha512-zzL1BxdnqwD69JRT0dihnawAcLkBMwAH+hZSKjUzeBbPedVhk3qYPjRw9VOMYWwt5xRih5xd8S+3kEdGohZm/g==", "license": "MIT", "dependencies": { - "hookified": "^1.11.0", - "keyv": "^5.5.0" + "@cacheable/memoize": "^2.0.3", + "@cacheable/memory": "^2.0.3", + "@cacheable/utils": "^2.1.0", + "hookified": "^1.12.1", + "keyv": "^5.5.3", + "qified": "^0.5.0" } }, "node_modules/cachedir": { @@ -6422,17 +6224,13 @@ } }, "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" @@ -6526,19 +6324,16 @@ } }, "node_modules/cli-cursor": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", - "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "license": "MIT", "dependencies": { - "restore-cursor": "^5.0.0" + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/cli-spinners": { @@ -6628,44 +6423,18 @@ } }, "node_modules/cliui": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", - "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, "license": "ISC", "dependencies": { - "string-width": "^7.2.0", - "strip-ansi": "^7.1.0", - "wrap-ansi": "^9.0.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/clone": { @@ -6692,47 +6461,23 @@ "integrity": "sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==", "license": "LGPL-3.0-or-later" }, - "node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" - }, - "engines": { - "node": ">=12.5.0" - } - }, "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "color-name": "1.1.3" } }, "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, "license": "MIT" }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "license": "MIT", - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", @@ -6753,12 +6498,13 @@ } }, "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.1.tgz", + "integrity": "sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==", + "dev": true, "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=20" } }, "node_modules/commitizen": { @@ -6802,16 +6548,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/commitizen/node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -7148,23 +6884,6 @@ "node": ">=4" } }, - "node_modules/cz-conventional-changelog/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/cz-conventional-changelog/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, "node_modules/cz-conventional-changelog/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -7175,29 +6894,6 @@ "node": ">=0.8.0" } }, - "node_modules/cz-conventional-changelog/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/cz-conventional-changelog/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/dargs": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-8.1.0.tgz", @@ -7448,9 +7144,9 @@ } }, "node_modules/detect-libc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.0.tgz", - "integrity": "sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "license": "Apache-2.0", "engines": { "node": ">=8" @@ -7796,13 +7492,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/error-ex/node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "license": "MIT" - }, "node_modules/es-abstract": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", @@ -7949,9 +7638,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", - "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", + "version": "0.25.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.10.tgz", + "integrity": "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==", "hasInstallScript": true, "license": "MIT", "bin": { @@ -7961,32 +7650,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.9", - "@esbuild/android-arm": "0.25.9", - "@esbuild/android-arm64": "0.25.9", - "@esbuild/android-x64": "0.25.9", - "@esbuild/darwin-arm64": "0.25.9", - "@esbuild/darwin-x64": "0.25.9", - "@esbuild/freebsd-arm64": "0.25.9", - "@esbuild/freebsd-x64": "0.25.9", - "@esbuild/linux-arm": "0.25.9", - "@esbuild/linux-arm64": "0.25.9", - "@esbuild/linux-ia32": "0.25.9", - "@esbuild/linux-loong64": "0.25.9", - "@esbuild/linux-mips64el": "0.25.9", - "@esbuild/linux-ppc64": "0.25.9", - "@esbuild/linux-riscv64": "0.25.9", - "@esbuild/linux-s390x": "0.25.9", - "@esbuild/linux-x64": "0.25.9", - "@esbuild/netbsd-arm64": "0.25.9", - "@esbuild/netbsd-x64": "0.25.9", - "@esbuild/openbsd-arm64": "0.25.9", - "@esbuild/openbsd-x64": "0.25.9", - "@esbuild/openharmony-arm64": "0.25.9", - "@esbuild/sunos-x64": "0.25.9", - "@esbuild/win32-arm64": "0.25.9", - "@esbuild/win32-ia32": "0.25.9", - "@esbuild/win32-x64": "0.25.9" + "@esbuild/aix-ppc64": "0.25.10", + "@esbuild/android-arm": "0.25.10", + "@esbuild/android-arm64": "0.25.10", + "@esbuild/android-x64": "0.25.10", + "@esbuild/darwin-arm64": "0.25.10", + "@esbuild/darwin-x64": "0.25.10", + "@esbuild/freebsd-arm64": "0.25.10", + "@esbuild/freebsd-x64": "0.25.10", + "@esbuild/linux-arm": "0.25.10", + "@esbuild/linux-arm64": "0.25.10", + "@esbuild/linux-ia32": "0.25.10", + "@esbuild/linux-loong64": "0.25.10", + "@esbuild/linux-mips64el": "0.25.10", + "@esbuild/linux-ppc64": "0.25.10", + "@esbuild/linux-riscv64": "0.25.10", + "@esbuild/linux-s390x": "0.25.10", + "@esbuild/linux-x64": "0.25.10", + "@esbuild/netbsd-arm64": "0.25.10", + "@esbuild/netbsd-x64": "0.25.10", + "@esbuild/openbsd-arm64": "0.25.10", + "@esbuild/openbsd-x64": "0.25.10", + "@esbuild/openharmony-arm64": "0.25.10", + "@esbuild/sunos-x64": "0.25.10", + "@esbuild/win32-arm64": "0.25.10", + "@esbuild/win32-ia32": "0.25.10", + "@esbuild/win32-x64": "0.25.10" } }, "node_modules/escalade": { @@ -8244,6 +7933,16 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-import/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-import/node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -8328,6 +8027,39 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/eslint/node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -8339,6 +8071,103 @@ "concat-map": "0.0.1" } }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8352,6 +8181,74 @@ "node": "*" } }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -8644,15 +8541,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-redact": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", - "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/fast-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", @@ -8834,17 +8722,18 @@ "license": "MIT" }, "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", + "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", "dev": true, "license": "MIT", "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "locate-path": "^7.2.0", + "path-exists": "^5.0.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -8986,6 +8875,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", @@ -9122,6 +9023,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/generic-pool": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", @@ -9465,13 +9375,13 @@ } }, "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/has-property-descriptors": { @@ -9555,9 +9465,9 @@ } }, "node_modules/hookified": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.12.0.tgz", - "integrity": "sha512-hMr1Y9TCLshScrBbV2QxJ9BROddxZ12MX9KsCtuGGy/3SmmN5H1PllKerrVlSotur9dlE8hmUKAOSa3WDzsZmQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.12.1.tgz", + "integrity": "sha512-xnKGl+iMIlhrZmGHB729MqlmPoWBznctSQTYCpFKqNsCgimJQmithcW0xSQMMFzYnV2iKUh25alswn6epgxS0Q==", "license": "MIT" }, "node_modules/htmlparser2": { @@ -9689,9 +9599,9 @@ "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { @@ -9730,10 +9640,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/import-in-the-middle": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.14.2.tgz", - "integrity": "sha512-5tCuY9BV8ujfOpwtAGgsTx9CGUapcFMEEyByLv1B+v2+6DhAcw+Zr0nhQT7uwaZ7DiourxFEscghOR8e1aPLQw==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.14.4.tgz", + "integrity": "sha512-eWjxh735SJLFJJDs5X82JQ2405OdJeAHDBnaoFCfdr5GVc7AWc9xU7KbrF+3Xd5F2ccP1aQFKtY+65X6EfKZ7A==", "license": "Apache-2.0", "dependencies": { "acorn": "^8.14.0", @@ -9818,125 +9738,82 @@ "node": ">=12.0.0" } }, - "node_modules/inquirer/node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { - "type-fest": "^0.21.3" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/inquirer/node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { - "restore-cursor": "^3.1.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/inquirer/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, - "node_modules/inquirer/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inquirer/node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, "engines": { "node": ">=8" } }, - "node_modules/inquirer/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/inquirer/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/inquirer/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inquirer/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -10005,9 +9882,10 @@ } }, "node_modules/is-arrayish": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", - "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, "license": "MIT" }, "node_modules/is-async-function": { @@ -10162,22 +10040,30 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-generator-function": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", - "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "get-proto": "^1.0.0", + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" }, @@ -10537,9 +10423,9 @@ } }, "node_modules/jiti": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", - "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" @@ -10601,9 +10487,9 @@ "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT" }, @@ -10729,9 +10615,9 @@ } }, "node_modules/keyv": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.1.tgz", - "integrity": "sha512-eF3cHZ40bVsjdlRi/RvKAuB0+B61Q1xWvohnrJrnaQslM3h1n79IV+mc9EGag4nrA9ZOlNyr3TUzW5c8uy8vNA==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.3.tgz", + "integrity": "sha512-h0Un1ieD+HUrzBH6dJXhod3ifSghk5Hw/2Y4/KHBziPlZecrFyE9YOTPU6eOs0V9pYl8gOs86fkr/KN8lUX39A==", "license": "MIT", "dependencies": { "@keyv/serialize": "^1.1.1" @@ -10752,9 +10638,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.12.17", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.17.tgz", - "integrity": "sha512-bsxi8FoceAYR/bjHcLYc2ShJ/aVAzo5jaxAYiMHF0BD+NTp47405CGuPNKYpw+lHadN9k/ClFGc9X5vaZswIrA==", + "version": "1.12.23", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.23.tgz", + "integrity": "sha512-RN3q3gImZ91BvRDYjWp7ICz3gRn81mW5L4SW+2afzNCC0I/nkXstBgZThQGTE3S/9q5J90FH4dP+TXx8NhdZKg==", "license": "MIT" }, "node_modules/libsignal": { @@ -10837,19 +10723,16 @@ } }, "node_modules/lint-staged": { - "version": "16.1.6", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.1.6.tgz", - "integrity": "sha512-U4kuulU3CKIytlkLlaHcGgKscNfJPNTiDF2avIUGFCv7K95/DCYQ7Ra62ydeRWmgQGg9zJYw2dzdbztwJlqrow==", + "version": "16.2.3", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.2.3.tgz", + "integrity": "sha512-1OnJEESB9zZqsp61XHH2fvpS1es3hRCxMplF/AJUDa8Ho8VrscYDIuxGrj3m8KPXbcWZ8fT9XTMUhEQmOVKpKw==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^5.6.0", - "commander": "^14.0.0", - "debug": "^4.4.1", - "lilconfig": "^3.1.3", - "listr2": "^9.0.3", + "commander": "^14.0.1", + "listr2": "^9.0.4", "micromatch": "^4.0.8", - "nano-spawn": "^1.0.2", + "nano-spawn": "^1.0.3", "pidtree": "^0.6.0", "string-argv": "^0.3.2", "yaml": "^2.8.1" @@ -10864,29 +10747,6 @@ "url": "https://opencollective.com/lint-staged" } }, - "node_modules/lint-staged/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/lint-staged/node_modules/commander": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.1.tgz", - "integrity": "sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20" - } - }, "node_modules/listr2": { "version": "9.0.4", "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.4.tgz", @@ -10905,6 +10765,71 @@ "node": ">=20.0.0" } }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/load-tsconfig": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", @@ -10915,16 +10840,16 @@ } }, "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, "license": "MIT", "dependencies": { - "p-locate": "^5.0.0" + "p-locate": "^6.0.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -11064,6 +10989,82 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -11084,6 +11085,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.1.tgz", + "integrity": "sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/log-update/node_modules/ansi-regex": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", @@ -11097,6 +11114,86 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, + "node_modules/log-update/node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", @@ -11113,6 +11210,24 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/long": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", @@ -11130,9 +11245,9 @@ } }, "node_modules/lru-cache": { - "version": "11.2.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", - "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz", + "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", "license": "ISC", "engines": { "node": "20 || >=22" @@ -11180,6 +11295,107 @@ "node": ">=18.0.0" } }, + "node_modules/mediainfo.js/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/mediainfo.js/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/mediainfo.js/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mediainfo.js/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/mediainfo.js/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mediainfo.js/node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/mediainfo.js/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, "node_modules/meow": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", @@ -11489,9 +11705,9 @@ } }, "node_modules/music-metadata": { - "version": "11.8.3", - "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.8.3.tgz", - "integrity": "sha512-Tgiv4MlCgDb6XzelziB1mmL2xeoHls0KTpCm3Z3qr+LfF4mBEpkuc5vNrc927IT5+S5fv+vzStfI+HYC0igDpA==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.9.0.tgz", + "integrity": "sha512-J7VqD8FY6KRcm75Fzj86FPsckiD/EdvO5OS3P+JiMf/2krP3TcAseZYfkic6eFeJ0iBhhzcdxgfu8hLW95aXXw==", "funding": [ { "type": "github", @@ -11507,12 +11723,12 @@ "@borewit/text-codec": "^0.2.0", "@tokenizer/token": "^0.3.0", "content-type": "^1.0.5", - "debug": "^4.4.1", + "debug": "^4.4.3", "file-type": "^21.0.0", "media-typer": "^1.1.0", "strtok3": "^10.3.4", "token-types": "^6.1.1", - "uint8array-extras": "^1.4.1" + "uint8array-extras": "^1.5.0" }, "engines": { "node": ">=18" @@ -11752,15 +11968,15 @@ } }, "node_modules/nypm": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.1.tgz", - "integrity": "sha512-hlacBiRiv1k9hZFiphPUkfSQ/ZfQzZDzC+8z0wL3lvDAOUu/2NnChkKuMoMjNur/9OpKuz2QsIeiPVN0xM5Q0w==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.2.tgz", + "integrity": "sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g==", "license": "MIT", "dependencies": { "citty": "^0.1.6", "consola": "^3.4.2", "pathe": "^2.0.3", - "pkg-types": "^2.2.0", + "pkg-types": "^2.3.0", "tinyexec": "^1.0.1" }, "bin": { @@ -11876,9 +12092,9 @@ } }, "node_modules/ogg-opus-decoder": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ogg-opus-decoder/-/ogg-opus-decoder-1.7.0.tgz", - "integrity": "sha512-/lrj4+ZGjxZCCNiDSlNEckLrCL+UU9N9XtqES7sXq/Lm6PMi8Pwn/D6TTsbvG45krt21ohAh2FqdEsMuI7ZN4w==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/ogg-opus-decoder/-/ogg-opus-decoder-1.7.1.tgz", + "integrity": "sha512-Dlf9rKv61hjWAshaU7OoWHcu0Zn9+2ig7p6HZjh59CQMzzTwXkzsoSVl1EoqKLijL7KWEGpYxyOy+rHpd22vfw==", "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7", @@ -11944,16 +12160,16 @@ } }, "node_modules/onetime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", - "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "license": "MIT", "dependencies": { - "mimic-function": "^5.0.0" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">=18" + "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -11990,9 +12206,9 @@ } }, "node_modules/openai/node_modules/@types/node": { - "version": "18.19.124", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.124.tgz", - "integrity": "sha512-hY4YWZFLs3ku6D2Gqo3RchTd9VRCcrjqp/I0mmohYeUVA5Y8eCXKJEasHxLAJVZRJuQogfd1GiJ9lgogBgKeuQ==", + "version": "18.19.129", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.129.tgz", + "integrity": "sha512-hrmi5jWt2w60ayox3iIXwpMEnfUvOLJCRtrOPbHtH15nTjvO7uhnelvrdAs0dO0/zl5DZ3ZbahiaXEVb54ca/A==", "license": "MIT", "dependencies": { "undici-types": "~5.26.4" @@ -12059,55 +12275,81 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ora/node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { - "restore-cursor": "^3.1.0" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" - } - }, - "node_modules/ora/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/ora/node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/ora/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "ISC" + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } }, "node_modules/os-tmpdir": { "version": "1.0.2", @@ -12138,32 +12380,32 @@ } }, "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, "license": "MIT", "dependencies": { - "yocto-queue": "^0.1.0" + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, "license": "MIT", "dependencies": { - "p-limit": "^3.0.2" + "p-limit": "^4.0.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12342,12 +12584,13 @@ } }, "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/path-is-absolute": { @@ -12550,13 +12793,12 @@ } }, "node_modules/pino": { - "version": "9.10.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-9.10.0.tgz", - "integrity": "sha512-VOFxoNnxICtxaN8S3E73pR66c5MTFC+rwRcNRyHV/bV/c90dXvJqMfjkeRFsGBDXmlUN3LccJQPqGIufnaJePA==", + "version": "9.13.1", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.13.1.tgz", + "integrity": "sha512-Szuj+ViDTjKPQYiKumGmEn3frdl+ZPSdosHyt9SnUevFosOkMY2b7ipxlEctNKPmMD/VibeBI+ZcZCJK+4DPuw==", "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", - "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", "pino-abstract-transport": "^2.0.0", "pino-std-serializers": "^7.0.0", @@ -12564,6 +12806,7 @@ "quick-format-unescaped": "^4.0.3", "real-require": "^0.2.0", "safe-stable-stringify": "^2.3.1", + "slow-redact": "^0.3.0", "sonic-boom": "^4.0.1", "thread-stream": "^3.0.0" }, @@ -12766,14 +13009,14 @@ } }, "node_modules/prisma": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.16.1.tgz", - "integrity": "sha512-MFkMU0eaDDKAT4R/By2IA9oQmwLTxokqv2wegAErr9Rf+oIe7W2sYpE/Uxq0H2DliIR7vnV63PkC1bEwUtl98w==", + "version": "6.16.3", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.16.3.tgz", + "integrity": "sha512-4tJq3KB9WRshH5+QmzOLV54YMkNlKOtLKaSdvraI5kC/axF47HuOw6zDM8xrxJ6s9o2WodY654On4XKkrobQdQ==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/config": "6.16.1", - "@prisma/engines": "6.16.1" + "@prisma/config": "6.16.3", + "@prisma/engines": "6.16.3" }, "bin": { "prisma": "build/index.js" @@ -12868,13 +13111,10 @@ "license": "MIT" }, "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "license": "MIT", - "engines": { - "node": ">=6" - } + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", + "license": "MIT" }, "node_modules/pure-rand": { "version": "6.1.0", @@ -12909,6 +13149,18 @@ "node": ">= 4.0.0" } }, + "node_modules/qified": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/qified/-/qified-0.5.0.tgz", + "integrity": "sha512-Zj6Q/Vc/SQ+Fzc87N90jJUzBzxD7MVQ2ZvGyMmYtnl2u1a07CejAhvtk4ZwASos+SiHKCAIylyGHJKIek75QBw==", + "license": "MIT", + "dependencies": { + "hookified": "^1.12.1" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/qoa-format": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/qoa-format/-/qoa-format-1.0.1.tgz", @@ -12943,6 +13195,21 @@ "qrcode-terminal": "bin/qrcode-terminal.js" } }, + "node_modules/qrcode/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/qrcode/node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -12954,10 +13221,22 @@ "wrap-ansi": "^6.2.0" } }, - "node_modules/qrcode/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/qrcode/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/qrcode/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, "node_modules/qrcode/node_modules/find-up": { @@ -13012,6 +13291,15 @@ "node": ">=8" } }, + "node_modules/qrcode/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/qrcode/node_modules/pngjs": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", @@ -13021,20 +13309,6 @@ "node": ">=10.13.0" } }, - "node_modules/qrcode/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/qrcode/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -13229,6 +13503,30 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/readable-web-to-node-stream/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/readable-web-to-node-stream/node_modules/readable-stream": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", @@ -13408,13 +13706,12 @@ } }, "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/resolve-pkg-maps": { @@ -13428,20 +13725,17 @@ } }, "node_modules/restore-cursor": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", - "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "license": "MIT", "dependencies": { - "onetime": "^7.0.0", - "signal-exit": "^4.1.0" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/reusify": { @@ -13480,9 +13774,9 @@ } }, "node_modules/rollup": { - "version": "4.50.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.2.tgz", - "integrity": "sha512-BgLRGy7tNS9H66aIMASq1qSYbAAJV6Z6WR4QYTvj5FgF15rZ/ympT1uixHXwzbZUBDbkvqUI1KR0fH1FhMaQ9w==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.4.tgz", + "integrity": "sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==", "license": "MIT", "dependencies": { "@types/estree": "1.0.8" @@ -13495,27 +13789,28 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.50.2", - "@rollup/rollup-android-arm64": "4.50.2", - "@rollup/rollup-darwin-arm64": "4.50.2", - "@rollup/rollup-darwin-x64": "4.50.2", - "@rollup/rollup-freebsd-arm64": "4.50.2", - "@rollup/rollup-freebsd-x64": "4.50.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.50.2", - "@rollup/rollup-linux-arm-musleabihf": "4.50.2", - "@rollup/rollup-linux-arm64-gnu": "4.50.2", - "@rollup/rollup-linux-arm64-musl": "4.50.2", - "@rollup/rollup-linux-loong64-gnu": "4.50.2", - "@rollup/rollup-linux-ppc64-gnu": "4.50.2", - "@rollup/rollup-linux-riscv64-gnu": "4.50.2", - "@rollup/rollup-linux-riscv64-musl": "4.50.2", - "@rollup/rollup-linux-s390x-gnu": "4.50.2", - "@rollup/rollup-linux-x64-gnu": "4.50.2", - "@rollup/rollup-linux-x64-musl": "4.50.2", - "@rollup/rollup-openharmony-arm64": "4.50.2", - "@rollup/rollup-win32-arm64-msvc": "4.50.2", - "@rollup/rollup-win32-ia32-msvc": "4.50.2", - "@rollup/rollup-win32-x64-msvc": "4.50.2", + "@rollup/rollup-android-arm-eabi": "4.52.4", + "@rollup/rollup-android-arm64": "4.52.4", + "@rollup/rollup-darwin-arm64": "4.52.4", + "@rollup/rollup-darwin-x64": "4.52.4", + "@rollup/rollup-freebsd-arm64": "4.52.4", + "@rollup/rollup-freebsd-x64": "4.52.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.52.4", + "@rollup/rollup-linux-arm-musleabihf": "4.52.4", + "@rollup/rollup-linux-arm64-gnu": "4.52.4", + "@rollup/rollup-linux-arm64-musl": "4.52.4", + "@rollup/rollup-linux-loong64-gnu": "4.52.4", + "@rollup/rollup-linux-ppc64-gnu": "4.52.4", + "@rollup/rollup-linux-riscv64-gnu": "4.52.4", + "@rollup/rollup-linux-riscv64-musl": "4.52.4", + "@rollup/rollup-linux-s390x-gnu": "4.52.4", + "@rollup/rollup-linux-x64-gnu": "4.52.4", + "@rollup/rollup-linux-x64-musl": "4.52.4", + "@rollup/rollup-openharmony-arm64": "4.52.4", + "@rollup/rollup-win32-arm64-msvc": "4.52.4", + "@rollup/rollup-win32-ia32-msvc": "4.52.4", + "@rollup/rollup-win32-x64-gnu": "4.52.4", + "@rollup/rollup-win32-x64-msvc": "4.52.4", "fsevents": "~2.3.2" } }, @@ -13805,14 +14100,14 @@ "license": "ISC" }, "node_modules/sharp": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.3.tgz", - "integrity": "sha512-eX2IQ6nFohW4DbvHIOLRB3MHFpYqaqvXd3Tp5e/T/dSH83fxaNJQRvDMhASmkNTsNTVF2/OOopzRCt7xokgPfg==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.4.tgz", + "integrity": "sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "color": "^4.2.3", - "detect-libc": "^2.0.4", + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.0", "semver": "^7.7.2" }, "engines": { @@ -13822,28 +14117,28 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.34.3", - "@img/sharp-darwin-x64": "0.34.3", - "@img/sharp-libvips-darwin-arm64": "1.2.0", - "@img/sharp-libvips-darwin-x64": "1.2.0", - "@img/sharp-libvips-linux-arm": "1.2.0", - "@img/sharp-libvips-linux-arm64": "1.2.0", - "@img/sharp-libvips-linux-ppc64": "1.2.0", - "@img/sharp-libvips-linux-s390x": "1.2.0", - "@img/sharp-libvips-linux-x64": "1.2.0", - "@img/sharp-libvips-linuxmusl-arm64": "1.2.0", - "@img/sharp-libvips-linuxmusl-x64": "1.2.0", - "@img/sharp-linux-arm": "0.34.3", - "@img/sharp-linux-arm64": "0.34.3", - "@img/sharp-linux-ppc64": "0.34.3", - "@img/sharp-linux-s390x": "0.34.3", - "@img/sharp-linux-x64": "0.34.3", - "@img/sharp-linuxmusl-arm64": "0.34.3", - "@img/sharp-linuxmusl-x64": "0.34.3", - "@img/sharp-wasm32": "0.34.3", - "@img/sharp-win32-arm64": "0.34.3", - "@img/sharp-win32-ia32": "0.34.3", - "@img/sharp-win32-x64": "0.34.3" + "@img/sharp-darwin-arm64": "0.34.4", + "@img/sharp-darwin-x64": "0.34.4", + "@img/sharp-libvips-darwin-arm64": "1.2.3", + "@img/sharp-libvips-darwin-x64": "1.2.3", + "@img/sharp-libvips-linux-arm": "1.2.3", + "@img/sharp-libvips-linux-arm64": "1.2.3", + "@img/sharp-libvips-linux-ppc64": "1.2.3", + "@img/sharp-libvips-linux-s390x": "1.2.3", + "@img/sharp-libvips-linux-x64": "1.2.3", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.3", + "@img/sharp-libvips-linuxmusl-x64": "1.2.3", + "@img/sharp-linux-arm": "0.34.4", + "@img/sharp-linux-arm64": "0.34.4", + "@img/sharp-linux-ppc64": "0.34.4", + "@img/sharp-linux-s390x": "0.34.4", + "@img/sharp-linux-x64": "0.34.4", + "@img/sharp-linuxmusl-arm64": "0.34.4", + "@img/sharp-linuxmusl-x64": "0.34.4", + "@img/sharp-wasm32": "0.34.4", + "@img/sharp-win32-arm64": "0.34.4", + "@img/sharp-win32-ia32": "0.34.4", + "@img/sharp-win32-x64": "0.34.4" } }, "node_modules/shebang-command": { @@ -13946,25 +14241,11 @@ } }, "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/simple-swizzle": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", - "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.3.1" - } + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" }, "node_modules/simple-xml-to-json": { "version": "1.2.3", @@ -14002,34 +14283,11 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", - "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-east-asian-width": "^1.3.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/slow-redact": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/slow-redact/-/slow-redact-0.3.1.tgz", + "integrity": "sha512-NvFvl1GuLZNW4U046Tfi8b26zXo8aBzgCAS2f7yVJR/fArN93mOqSA99cB9uITm92ajSz01bsu1K7SCVVjIMpQ==", + "license": "MIT" }, "node_modules/smart-buffer": { "version": "4.2.0", @@ -14236,6 +14494,15 @@ "node": ">= 8" } }, + "node_modules/source-map/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/source-map/node_modules/tr46": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", @@ -14355,20 +14622,17 @@ } }, "node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/string-width-cjs": { @@ -14392,31 +14656,28 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=8" } }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "node_modules/string-width/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "node": ">=8" } }, "node_modules/string.prototype.trim": { @@ -14504,13 +14765,13 @@ } }, "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/strip-json-comments": { @@ -14577,6 +14838,15 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/sucrase/node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -14598,16 +14868,16 @@ } }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -14623,9 +14893,9 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.29.0.tgz", - "integrity": "sha512-gqs7Md3AxP4mbpXAq31o5QW+wGUZsUzVatg70yXpUR245dfIis5jAzufBd+UQM/w2xSfrhvA1eqsrgnl2PbezQ==", + "version": "5.29.3", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.29.3.tgz", + "integrity": "sha512-U99f/2YocRA2Mxqx3eUBRhQonWVtE5dIvMs0Zlsn4a4ip8awMq0JxXhU+Sidtna2WlZrHbK2Rro3RZvYUymRbA==", "license": "Apache-2.0", "dependencies": { "@scarf/scarf": "=1.4.0" @@ -14886,6 +15156,16 @@ "node": ">=6" } }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -14944,15 +15224,6 @@ } } }, - "node_modules/tsup/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/tsup/node_modules/tinyexec": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", @@ -14960,9 +15231,9 @@ "license": "MIT" }, "node_modules/tsx": { - "version": "4.20.5", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.5.tgz", - "integrity": "sha512-+wKjMNU9w/EaQayHXb7WA7ZaHY6hN8WgfvHNQ3t1PnU91/7O8TcTnIhCDYTZwnt8JsO9IBqZ30Ln1r7pPF52Aw==", + "version": "4.20.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz", + "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -15124,9 +15395,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", - "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", "bin": { @@ -15175,9 +15446,9 @@ } }, "node_modules/undici-types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", - "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.14.0.tgz", + "integrity": "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==", "license": "MIT" }, "node_modules/unicorn-magic": { @@ -15222,6 +15493,16 @@ "punycode": "^2.1.0" } }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -15242,12 +15523,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "license": "MIT" - }, "node_modules/utif2": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/utif2/-/utif2-4.1.0.tgz", @@ -15483,17 +15758,18 @@ } }, "node_modules/wrap-ansi": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", - "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -15517,65 +15793,75 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "license": "MIT", - "engines": { - "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=12" + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -15678,39 +15964,42 @@ } }, "node_modules/yargs": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", - "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, "license": "MIT", "dependencies": { - "cliui": "^9.0.1", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", - "string-width": "^7.2.0", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^22.0.0" + "yargs-parser": "^21.1.1" }, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", - "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, "license": "ISC", "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" + "node": ">=12" } }, "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", "dev": true, "license": "MIT", "engines": { - "node": ">=10" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" diff --git a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts index 6f7c292a..cb667f9c 100644 --- a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts +++ b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts @@ -71,7 +71,7 @@ export const useVoiceCallsBaileys = async ( socket.on('assertSessions', async (jids, force, callback) => { try { - const response = await baileys_sock.assertSessions(jids, force as any); + const response = await baileys_sock.assertSessions(jids); callback(response); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 2613ee4b..330c211c 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -4593,8 +4593,10 @@ export class BaileysStartupService extends ChannelStartupService { return response; } - public async baileysAssertSessions(jids: string[], force?: boolean) { - const response = await this.client.assertSessions(jids, force as any); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public async baileysAssertSessions(jids: string[], _force?: boolean) { + // Note: _force parameter kept for API compatibility but not used in Baileys 7.0.0-rc.5+ + const response = await this.client.assertSessions(jids); return response; }